[mpir-devel] Building MPIR with Visual Studio 2010

28 views
Skip to first unread message

Cactus

unread,
May 24, 2010, 5:05:32 AM5/24/10
to mpir-devel
The files needed to build MPIR with Visual Studio 2010 are now in the
MPIR SVN repository.

The extent to which these files will work with Visual C++ 2010 Express
is unclear at the moment since this only supports win32 projects when
installed on its own. But Microsoft have said that adding the soon
to be released Windows 7 SDK to VC++ 2010 Express will allow x64
builds. There is hence a prospect that the build files will become
fully operational with the 2010 Express product in the not too distant
future.

Please also note that the assembler based builds of MPIR on Windows
use a version of the open source YASM assembler (vsyasm) that has been
specifically designed for use with Visual Studio 2010. It is
available here:

http://www.tortall.net/projects/yasm/wiki/Download

The MPIR build with Visual Studio 2010 needs to be considered as a
preliminary release at this stage as it has had very limited testing.
I would appreciate reports of any issues encountered with it and I am
willing to do what I can to assist with any problems encountered that
are reported here.

For those who are unwilling to build from the repository, we hope to
make a new release with a Visual Studio build capability fairly soon
now.

best regards to all

Brian

--
You received this message because you are subscribed to the Google Groups "mpir-devel" group.
To post to this group, send email to mpir-...@googlegroups.com.
To unsubscribe from this group, send email to mpir-devel+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.

Chris Saunders

unread,
May 25, 2010, 1:00:00 AM5/25/10
to mpir-devel
Hey Brian. You mention the "soon to be released Windows 7 SDK" did you mean
that there is going to be a new Windows 7 SDK as I already have one
installed and wonder if I need to wait awhile before trying to use Visual
C++ 2010 Express with the MPIR svn version?

Regards
Chris Saunders

--------------------------------------------------
From: "Cactus" <riem...@googlemail.com>
Sent: Monday, May 24, 2010 5:05 AM
To: "mpir-devel" <mpir-...@googlegroups.com>
Subject: [mpir-devel] Building MPIR with Visual Studio 2010

Chris Saunders

unread,
May 25, 2010, 1:35:44 AM5/25/10
to mpir-devel
I just downloaded the SVN version of MPIR. I looked in the build.vc9
directory and only found a mpir-tests.sln but none for MPIR itself. I think
that previous times when I have built this library there was such. Am I
missing something?

Regards
Chris Saunders

Cactus

unread,
May 25, 2010, 4:09:30 AM5/25/10
to mpir-devel


On May 25, 6:00 am, "Chris Saunders" <e...@mountaincable.net> wrote:
> Hey Brian.  You mention the "soon to be released Windows 7 SDK" did you mean
> that there is going to be a new Windows 7 SDK as I already have one
> installed and wonder if I need to wait awhile before trying to use Visual
> C++ 2010 Express with the MPIR svn version?

Hi Chris

I am only reflecting what Microsoft have said here:

http://blogs.msdn.com/b/windowssdk/rss.aspx

It is my understanding that Visual C++ 2010 Express will require the
Windows SDK v7.1 in oder to build for x64 targets.

So I doubt that you will be able to do x64 targets with VC++ 2010
Express with your current Windows 7 SDK version.

This new SDK version is due for release in mid June.

chrmhoffmann

unread,
May 25, 2010, 4:16:53 AM5/25/10
to mpir-devel

Hi,

Thanks for your efforts!

I checked out svn trunk rev 2957 and tried to compile with vs2010.
When compiling dll_mpir_gc with win32 debug, I get the following error
message:

6> Creating library C:\wss\test\mpir\tools\mpir
\build.vc10\Win32\Debug\mpir.lib and object C:\wss\test\mpir\tools\mpir
\build.vc10\Win32\Debug\mpir.exp
6>logops_n.obj : error LNK2019: unresolved external symbol _call
referenced in function _func
6>C:\wss\test\mpir\tools\mpir\build.vc10\Win32\Debug\mpir.dll : fatal
error LNK1120: 1 unresolved externals

I tried the dll_mpir_p4 as well (same config win32, debug) and I get
same error message.

Any hints?

Regards,
Chris

Cactus

unread,
May 25, 2010, 4:18:32 AM5/25/10
to mpir-devel


On May 25, 6:35 am, "Chris Saunders" <e...@mountaincable.net> wrote:
> I just downloaded the SVN version of MPIR.  I looked in the build.vc9
> directory and only found a mpir-tests.sln but none for MPIR itself.  I think
> that previous times when I have built this library there was such.  Am I
> missing something?

Hi Chris,

It all works fine for me. So this issue and the earlier errors you
reported suggest that there is something wrong with your SVN client.

On a few occasions I have had problems with SVN access and I think
this occurs when someone else is doing a commit and some of the files
hence get locked.

I usually try a little later and all is then ok.

You might want delete what you have now and start again in a new
directory.

Brian

Cactus

unread,
May 25, 2010, 6:28:25 AM5/25/10
to mpir-devel


On May 25, 9:16 am, chrmhoffmann <chrmhoffm...@gmail.com> wrote:
> Hi,
>
> Thanks for your efforts!
>
> I checked out svn trunk rev 2957 and tried to compile with vs2010.
> When compiling dll_mpir_gc with win32 debug, I get the following error
> message:
>
> 6>     Creating library C:\wss\test\mpir\tools\mpir
> \build.vc10\Win32\Debug\mpir.lib and object C:\wss\test\mpir\tools\mpir
> \build.vc10\Win32\Debug\mpir.exp
> 6>logops_n.obj : error LNK2019: unresolved external symbol _call
> referenced in function _func
> 6>C:\wss\test\mpir\tools\mpir\build.vc10\Win32\Debug\mpir.dll : fatal
> error LNK1120: 1 unresolved externals
>
> I tried the dll_mpir_p4 as well (same config win32, debug) and I get
> same error message.

Hi Chris,

Thanks for picking this up - its a Windows build error for both Visual
Studio 2008 and 2010.

The logops_n.c file is not effective on Windows (could somone check
that it works on Linux) so I have added logops.c to solve this.

I have now corrected this in the MPIR SVN.

I also picked up another problem with the Visual Studio 2010 builds
that I have now corrected.

But I now need to double check the latter so it might possibly change
again later today if I find any mistakes in my corrections.

Brian

Bill Hart

unread,
May 25, 2010, 7:47:43 AM5/25/10
to mpir-...@googlegroups.com
OK, maybe it isn't completely clear that the latest version we are
working on is in the directory trunk.

I've updated the svn address on the MPIR website to *only* give you
trunk. Developers who need other branches will probably know that they
have to get the whole repo.

Sorry for the confusion.

Bill.

Jason Moxham

unread,
May 25, 2010, 11:29:04 AM5/25/10
to mpir-...@googlegroups.com
On Tuesday 25 May 2010 11:28:25 Cactus wrote:
> On May 25, 9:16 am, chrmhoffmann <chrmhoffm...@gmail.com> wrote:
> > Hi,
> >
> > Thanks for your efforts!
> >
> > I checked out svn trunk rev 2957 and tried to compile with vs2010.
> > When compiling dll_mpir_gc with win32 debug, I get the following error
> > message:
> >
> > 6> Creating library C:\wss\test\mpir\tools\mpir
> > \build.vc10\Win32\Debug\mpir.lib and object C:\wss\test\mpir\tools\mpir
> > \build.vc10\Win32\Debug\mpir.exp
> > 6>logops_n.obj : error LNK2019: unresolved external symbol _call
> > referenced in function _func
> > 6>C:\wss\test\mpir\tools\mpir\build.vc10\Win32\Debug\mpir.dll : fatal
> > error LNK1120: 1 unresolved externals
> >
> > I tried the dll_mpir_p4 as well (same config win32, debug) and I get
> > same error message.
>
> Hi Chris,
>
> Thanks for picking this up - its a Windows build error for both Visual
> Studio 2008 and 2010.
>
> The logops_n.c file is not effective on Windows (could somone check
> that it works on Linux) so I have added logops.c to solve this.
>

logops_n.c works fine in linux , ie just did a generic C build (--build=none-
unknown-linux-gnu)

Bill Hart

unread,
May 25, 2010, 11:27:44 AM5/25/10
to mpir-...@googlegroups.com
Do we really need logops.c and logops_n.c. Should we do some kind of
rationalisation?

Bill.

Cactus

unread,
May 25, 2010, 12:12:13 PM5/25/10
to mpir-devel
On May 25, 4:27 pm, Bill Hart <goodwillh...@googlemail.com> wrote:
> Do we really need logops.c and logops_n.c. Should we do some kind of
> rationalisation?

I am open to suggestions :-)

I don't know how to get logops_n.c working on its own - I assume that
it needs another file that includes it repeatedly with the various
OPERATION_??? defines set to specialise it.

I could have written logops.c this way but it was more bother than it
was worth.

Bill Hart

unread,
May 25, 2010, 12:22:38 PM5/25/10
to mpir-...@googlegroups.com
OK, I see. That issue is Windows specific due to the OPERATION_blah
things not being defined by configure scripts, etc.

No problem. That looks fine to me.

The other way of doing it is to simply define a macro and invoke it
numerous times. That could all be done in the logops_n.c file. I
recall this is what Neils Moller did for his gcd functions, e.g. he
had bgcd, sgcd, ngcd, etc, functions, all defined by macros.

See mpz/gcd.c in http://www.lysator.liu.se/~nisse/archive/gmp-gcd-3.tar.gz

This won't work on linux though I think, as for some platforms there
is assembly code for these logops functions and we actually need to
respect the OPERATION_blah things. So probably best to stick with what
you did.

Bill.

Cactus

unread,
May 25, 2010, 12:42:53 PM5/25/10
to mpir-devel


On May 25, 5:22 pm, Bill Hart <goodwillh...@googlemail.com> wrote:
> OK, I see. That issue is Windows specific due to the OPERATION_blah
> things not being defined by configure scripts, etc.
>
> No problem. That looks fine to me.
>
> The other way of doing it is to simply define a macro and invoke it
> numerous times. That could all be done in the logops_n.c file. I
> recall this is what Neils Moller did for his gcd functions, e.g. he
> had bgcd, sgcd, ngcd, etc, functions, all defined by macros.

I thought about doing it this way in logops_n.c (with an MSC_VER guard
around it) but because we are close to a release I decided to avoid
any changes that might impact outside Windows.

But I agree that it would be easy to, in effect, rationalise the two
logops files into one - I was just being cautious.
Reply all
Reply to author
Forward
0 new messages