Compiling MPIR with Visual C++ 2010

558 views
Skip to first unread message

Russell Wallace

unread,
Jan 21, 2011, 9:23:56 AM1/21/11
to mpir-...@googlegroups.com
Hi all,

I'm hoping to use MPIR for the Windows build of a theorem prover I'm
working on, and to that end trying to compile it from the command
line. My setup is pretty bog standard, Windows Vista 32-bit, Visual
C++ 2010 express edition, and I'm just going for a completely vanilla
32-bit static library build, not trying to use the IDE. The
information I could find with a Google search says:

1. Install the appropriate version of yasm.
2. Go into build.vc10
3. Configure.bat
4. Make.bat

I managed to get as far as step 3 seeming to work, and past the first
obstacle in step 4, but now it's tripping up on this line in make.bat:

%MS_BUILD% gen-mpir\gen-mpir.vcxproj /p:Platform=Win32;Configuration=Release

As far as the searches I've run can determine, there is no gen-mpir
anywhere in the entire directory tree, nor any other reference to
such. What am I missing?

Cactus

unread,
Jan 21, 2011, 9:56:57 AM1/21/11
to mpir-devel
Hi,

Unfortunately the batch build is a bit out of date so it does not work
for the MPIR SVN version.

These lines in make.bat should be deleted:

%MS_BUILD% gen-bases\gen-bases.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-fac_ui\gen-fac_ui.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-fib\gen-fib.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-psqr\gen-psqr.vcxproj /
p:Platform=Win32;Configuration=Release

and this line:

%MS_BUILD% gen-mpir\gen-mpir.vcxproj /
p:Platform=Win32;Configuration=Release

should be changed to:

%MS_BUILD% gen-mpir_h\gen-mpir.vcxproj /
p:Platform=Win32;Configuration=Release

This will I hope get you closer - if you report your progress here I
will endeavour to solve any further issues you encounter.

Brian

Cactus

unread,
Jan 21, 2011, 10:05:04 AM1/21/11
to mpir-devel


On Jan 21, 2:23 pm, Russell Wallace <russell.wall...@gmail.com> wrote:

Cactus

unread,
Jan 21, 2011, 10:06:20 AM1/21/11
to mpir-devel


On Jan 21, 2:23 pm, Russell Wallace <russell.wall...@gmail.com> wrote:
I'm afraid my earlier post was wrong - I will get back to you shortly
with what you need to do.

Brian

Russell Wallace

unread,
Jan 21, 2011, 10:13:19 AM1/21/11
to mpir-...@googlegroups.com
I should clarify that I'm using the 2.2.1 tarball, not the latest
version from SVN.

> --
> 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.
>
>

Cactus

unread,
Jan 21, 2011, 10:32:03 AM1/21/11
to mpir-devel
After running configure, edit config_params.bat to set BCPU to your
machine type if it is not right.

Then take out ALL these lines in make.bat:

%MS_BUILD% gen-mpir\gen-mpir.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-bases\gen-bases.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-fac_ui\gen-fac_ui.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-fib\gen-fib.vcxproj /
p:Platform=Win32;Configuration=Release
%MS_BUILD% gen-psqr\gen-psqr.vcxproj /
p:Platform=Win32;Configuration=Release

Then run make. It will declare errors but if you are lucky the library
will be built in one of the VC++ directories.

For example, if you choose nehalem the library will be built in the
directory lib_mpir_nehalem\win32\release\

Brian

Russell Wallace

unread,
Jan 21, 2011, 10:40:44 AM1/21/11
to mpir-...@googlegroups.com
That got past that step, so, progress! ^.^

It doesn't seem to have successfully built the library, though. Output
below; it looks like it's attaching a spurious " (x86)" to the name of
the Program Files directory. Any idea where it's doing that?

C:\mpir\build.vc10>make
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 21/01/2011 15:33:57.
Project "C:\mpir\build.vc10\lib_mpir_p3\lib_mpir_p3.vcxproj" on node 1
(default targets).
PrepareForBuild:
Creating directory "Win32\Release\".
InitializeBuildStatus:
Creating "Win32\Release\lib_mpir_p3.unsuccessfulbuild" because
"AlwaysCreate" was specified.
PreBuildEvent:
cd ..\
prebuild p3 win32

:VCEnd
building MPIR for p3
creating mpir.h for win32
copying tmp.h to ..\\mpir.h
copying tmp.h to ..\\config.h
copying ..\mpn\x86w\p3\gmp-mparam.h to ..\\gmp-mparam.h
ComputeYASMOutput:
Creating directory "C:\mpir\build.vc10\lib_mpir_p3\Win32\Release\mpn\".
_YASM:
Assembling aors_n.asm
Assembling aorsmul_1.asm
Assembling copyd.asm
Assembling copyi.asm
Assembling divexact_1.asm
Assembling divexact_by3c.asm
Assembling divrem_1.asm
Assembling lshift.asm
Assembling mod_1.asm
Assembling mod_34lsub1.asm
Assembling modexact_1c_odd.asm
Assembling mul_1.asm
Assembling mul_basecase.asm
Assembling rshift.asm
Assembling sqr_basecase.asm
Assembling udiv.asm
Assembling umul.asm
Assembling popham.asm
cmd.exe /C "C:\Users\a\AppData\Local\Temp\c638ce3a91ef457593ce9f199f5b4220.cmd"
"C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin\"vsyasm.exe -Xvc -f Win32 -g cv8 -i "..\..\mpn\x86w\\" -o
"Win32\Release\mpn\\" -rnasm -pnasm ..\..\mpn\x86w\aors_n.asm
..\..\mpn\x86w
\p6\aorsmul_1.asm ..\..\mpn\x86w\p6\copyd.asm
..\..\mpn\x86w\copyi.asm ..\..\mpn\x86w\p6\divexact_1.asm
..\..\mpn\x86w\p6\divexact_by3c.asm ..\..\mpn\x86w\p6\mod_1.asm
..\..\mpn\x86w\mod_34ls
ub1.asm ..\..\mpn\x86w\p6\modexact_1c_odd.asm
..\..\mpn\x86w\mul_1.asm ..\..\mpn\x86w\mul_basecase.asm
..\..\mpn\x86w\p6\sqr_basecase.asm ..\..\mpn\x86w\udiv.asm
..\..\mpn\x86w\umul.asm ..\.
.\mpn\x86w\p6\mmx\divrem_1.asm ..\..\mpn\x86w\p6\mmx\lshift.asm
..\..\mpn\x86w\p6\p3mmx\popham.asm ..\..\mpn\x86w\p6\mmx\rshift.asm
The system cannot find the path specified.
C:\mpir\build.vc10\vsyasm.targets(45,5): error MSB3721: The command
""C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin\"vsyasm.exe -Xvc -f Win32 -g cv8 -i "..\..\mpn\x86w\\" -o
"Win32\Relea
se\mpn\\" -rnasm -pnasm ..\..\mpn\x86w\aors_n.asm
..\..\mpn\x86w\p6\aorsmul_1.asm ..\..\mpn\x86w\p6\copyd.asm
..\..\mpn\x86w\copyi.asm ..\..\mpn\x86w\p6\divexact_1.asm
..\..\mpn\x86w\p6\divexa
ct_by3c.asm ..\..\mpn\x86w\p6\mod_1.asm
..\..\mpn\x86w\mod_34lsub1.asm ..\..\mpn\x86w\p6\modexact_1c_odd.asm
..\..\mpn\x86w\mul_1.asm ..\..\mpn\x86w\mul_basecase.asm
..\..\mpn\x86w\p6\sqr_basec
ase.asm ..\..\mpn\x86w\udiv.asm ..\..\mpn\x86w\umul.asm
..\..\mpn\x86w\p6\mmx\divrem_1.asm ..\..\mpn\x86w\p6\mmx\lshift.asm
..\..\mpn\x86w\p6\p3mmx\popham.asm ..\..\mpn\x86w\p6\mmx\rshift.asm"
exited with code 1. [C:\mpir\build.vc10\lib_mpir_p3\lib_mpir_p3.vcxproj]
Done Building Project
"C:\mpir\build.vc10\lib_mpir_p3\lib_mpir_p3.vcxproj" (default targets)
-- FAILED.


Build FAILED.

"C:\mpir\build.vc10\lib_mpir_p3\lib_mpir_p3.vcxproj" (default target) (1) ->
(_YASM target) ->
C:\mpir\build.vc10\vsyasm.targets(45,5): error MSB3721: The command
""C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin\"vsyasm.exe -Xvc -f Win32 -g cv8 -i "..\..\mpn\x86w\\" -o
"Win32\Rel
ease\mpn\\" -rnasm -pnasm ..\..\mpn\x86w\aors_n.asm
..\..\mpn\x86w\p6\aorsmul_1.asm ..\..\mpn\x86w\p6\copyd.asm
..\..\mpn\x86w\copyi.asm ..\..\mpn\x86w\p6\divexact_1.asm
..\..\mpn\x86w\p6\dive
xact_by3c.asm ..\..\mpn\x86w\p6\mod_1.asm
..\..\mpn\x86w\mod_34lsub1.asm ..\..\mpn\x86w\p6\modexact_1c_odd.asm
..\..\mpn\x86w\mul_1.asm ..\..\mpn\x86w\mul_basecase.asm
..\..\mpn\x86w\p6\sqr_bas
ecase.asm ..\..\mpn\x86w\udiv.asm ..\..\mpn\x86w\umul.asm
..\..\mpn\x86w\p6\mmx\divrem_1.asm ..\..\mpn\x86w\p6\mmx\lshift.asm
..\..\mpn\x86w\p6\p3mmx\popham.asm ..\..\mpn\x86w\p6\mmx\rshift.asm
" exited with code 1. [C:\mpir\build.vc10\lib_mpir_p3\lib_mpir_p3.vcxproj]

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:04.65
"ERROR BUILDING"

C:\mpir\build.vc10>

Cactus

unread,
Jan 21, 2011, 10:51:05 AM1/21/11
to mpir-devel

The YASM assembler failed. Which version of YASM do you have
installed (you need VSYASM)?

Brian

Russell Wallace

unread,
Jan 21, 2011, 10:54:45 AM1/21/11
to mpir-...@googlegroups.com
vsyasm-1.1.0-win32.zip, just freshly downloaded today from the yasm website.

Are you sure it was yasm that failed? The call to it failed,
certainly, but it looked to me like that was because it was trying to
use the wrong path (wrong name for the Program Files directory)?

Bill Hart

unread,
Jan 21, 2011, 10:59:27 AM1/21/11
to mpir-...@googlegroups.com
A theorem prover!?

That sounds very interesting. I'd certainly like to hear about that if
you have the time.

Bill.

Cactus

unread,
Jan 21, 2011, 11:06:15 AM1/21/11
to mpir-devel


On Jan 21, 3:54 pm, Russell Wallace <russell.wall...@gmail.com> wrote:
> vsyasm-1.1.0-win32.zip, just freshly downloaded today from the yasm website.
>
> Are you sure it was yasm that failed? The call to it failed,
> certainly, but it looked to me like that was because it was trying to
> use the wrong path (wrong name for the Program Files directory)?

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
\"vsyasm.exe

looked OK so I was guessing it failed - I assumed that you had VSYASM
at this location.

Brian

Russell Wallace

unread,
Jan 21, 2011, 11:08:11 AM1/21/11
to mpir-...@googlegroups.com
Nope, the correct location would be

"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vsyasm.exe"

Russell Wallace

unread,
Jan 21, 2011, 11:11:46 AM1/21/11
to mpir-...@googlegroups.com
The website is http://code.google.com/p/ayane/ though there isn't a
huge amount to see at the moment, the currently available version 2.0
(written in C#) only handles first-order logic. I'm currently working
on version 3.0, a rewrite in C++ for performance among other reasons
(which is why I need MPIR), designed to handle the new TPTP
higher-order logic format; if all goes well, I'm hoping to have it
ready for the CASC competition this summer, in which case I'll also do
a write up at that time explaining the design and implementation
ideas.

Bill Hart

unread,
Jan 21, 2011, 11:20:40 AM1/21/11
to mpir-...@googlegroups.com
Looks interesting indeed. I look forward to your writeup in the
summer! Good luck with the competition.

Cactus

unread,
Jan 21, 2011, 11:21:48 AM1/21/11
to mpir-devel


On Jan 21, 4:08 pm, Russell Wallace <russell.wall...@gmail.com> wrote:
> Nope, the correct location would be
>
> "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vsyasm.exe"

But Visual Studio is a 32bit application so its files go into 'Program
Files (x86)'..

So this is where the MPIR build expects to find vsyasm (i.e alongside
the other VC++ tools).

Does it still fail if you put vsyasm here?

Brian

Russell Wallace

unread,
Jan 21, 2011, 11:24:58 AM1/21/11
to mpir-...@googlegroups.com
On Fri, Jan 21, 2011 at 4:21 PM, Cactus <riem...@gmail.com> wrote:
> But Visual Studio is a 32bit application so its files go into 'Program
> Files (x86)'..

*scratches head* Erm no, there is no Program Files (x86) directory on
this machine, never has been. -- wait, is that something that happens
on 64-bit Windows? As I said earlier, I'm on a 32-bit setup (I know, I
know, I really ought to upgrade :)).

Cactus

unread,
Jan 21, 2011, 11:40:22 AM1/21/11
to mpir-devel


On Jan 21, 4:24 pm, Russell Wallace <russell.wall...@gmail.com> wrote:
> On Fri, Jan 21, 2011 at 4:21 PM, Cactus <rieman...@gmail.com> wrote:
> > But Visual Studio is a 32bit application so its files go into 'Program
> > Files (x86)'..
>
> *scratches head* Erm no, there is no Program Files (x86) directory on
> this machine, never has been. -- wait, is that something that happens
> on 64-bit Windows? As I said earlier, I'm on a 32-bit setup (I know, I
> know, I really ought to upgrade :)).

Ah, that explains it!

Edit this line:

<YasmPath Condition= "'$(YASMPATH)' == ''">C:\Program Files
(x86)\Microsoft Visual Studio 10.0\VC\bin\</YasmPath>

in vsyasm.props to point to where your vsyasm is located.

Brian

Russell Wallace

unread,
Jan 21, 2011, 11:51:49 AM1/21/11
to mpir-...@googlegroups.com
That worked! Generated a couple of error messages, but compiled the
library, and a small test program linked with it successfully computed
and printed the result 1+2=3. Thanks for the help!

Reply all
Reply to author
Forward
0 new messages