Re: [mpir-devel] Compiling MPIR in visual studio 2010 and 2012

1,079 views
Skip to first unread message

Brian Gladman

unread,
Oct 11, 2012, 3:13:36 AM10/11/12
to mpir-...@googlegroups.com
-----Original Message-----
From: Richard Marton
Sent: Wednesday, October 10, 2012 11:51 PM
To: mpir-...@googlegroups.com
Subject: [mpir-devel] Compiling MPIR in visual studio 2010 and 2012

Hello there!

I am Richard Marton, a hungarian college student who is trying to use MPIR
to develop an RSA-coder in c++.

I have found this guide to compile and install MPIR in Visual Studio 2010.
http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/
After downloading the archive, documentation and placing vsyasm.exe, i tried
to compile using the P4 library version. I got a really long error code,
like there was a wrong semicolon in one of the commands about vsyasm.exe. I
have reinstalled my windows 7 and updated to VS2012 but the same error
appears. The general C version compiles but some of the result files are
missing.

My main question is: do I really need to compile MPIR for myself or can I
use someone else's already compiled libraries in Visual Studio C++? If the
latter is true, please help me out.
My computer has a core 2 duo processor but I'd like to have compatibility,
so i would choose general c. Or do i need to use Cygwin or Linux to use this
library?

=====================================
Hi Richard,

It is normally necessary to compile MPIR for yourself but you might find
someone who will be willing to do it for you.

But another option is to describe your problems in more detail here so that
we can help you to resolve the errors you are experiencing.

Can you indicate the versions of Visual Studio 2010 and MPIR that you are
using?

Can you also post the error messages and any other output you obtain when
you try to build the p4 and generic versions of MPIR?

Are you selecting the right platform and configuration (e.g. Win32 and
release for the P4 version)?

Are you trying to use the static or DLL libraries? And are you selecting
the right run-time libraries in your own code - MPIR uses specific runtime
libraries and you need to use the same ones in your own code (or change
these in MPIR).

When you say that the generic C build works but some result files are
missing, can you list the files you expect to see that are not present?

If you can supply these details, we may be able to tell you what is going
wrong.

with regards,

Brian Gladman

Richard Marton

unread,
Oct 11, 2012, 4:12:42 AM10/11/12
to mpir-...@googlegroups.com
I lost a wall of text now....

I followed the guide, then I get these errors when building the P4 version:
Error    17    error MSB3721: The command ""C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\"vsyasm.exe -Xvc -f Win32 -g cv8 -i "..\..\mpn\x86_64w\\" -o "Win32\Release\mpn\\" -rnasm -pnasm   ..\..\mpn\x86w\add_n.asm  ..\..\mpn\x86w\addmul_1.asm  ..\..\mpn\x86w\copyd.asm  ..\..\mpn\x86w\copyi.asm  ..\..\mpn\x86w\divexact_1.asm  ..\..\mpn\x86w\divexact_by3c.asm  ..\..\mpn\x86w\divrem_1.asm  ..\..\mpn\x86w\lshift.asm  ..\..\mpn\x86w\mod_1.asm  ..\..\mpn\x86w\mod_34lsub1.asm  ..\..\mpn\x86w\mul_1.asm  ..\..\mpn\x86w\mul_basecase.asm  ..\..\mpn\x86w\rshift.asm  ..\..\mpn\x86w\sub_n.asm  ..\..\mpn\x86w\submul_1.asm  ..\..\mpn\x86w\udiv_qrnnd.asm  ..\..\mpn\x86w\umul_ppmm.asm" exited with code 1.    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\vsyasm.targets    45    5    lib_mpir_p4

Warning    1    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    2    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    3    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    4    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    5    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    6    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    7    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    8    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    9    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    10    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    11    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4
Warning    12    warning : can open only one input file, only the last file will be processed    c:\txt\suli\VII\szakdoli\RC\SOURCE\2\mpir-2.5.2\mpir-2.5.2\build.vc10\lib_mpir_p4\yasm    lib_mpir_p4

 when compiling the gc and cxx versions, i get a bunch of object files:
http://i138.photobucket.com/albums/q280/martonr/general_c.png

Since the error message said vsyasm.exe instead of yasm.exe, i renamed it. It did not solve the problem.


On Thursday, October 11, 2012 12:51:40 AM UTC+2, Richard Marton wrote:
Hello there!

I am Richard Marton, a hungarian college student who is trying to use MPIR to develop an RSA-coder in c++.

I have found this guide to compile and install MPIR in Visual Studio 2010. http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/
After downloading the archive, documentation and placing vsyasm.exe, i tried to compile using the P4 library version. I got a really long error code, like there was a wrong semicolon in one of the commands about vsyasm.exe. I have reinstalled my windows 7 and updated to VS2012 but the same error appears. The general C version compiles but some of the result files are missing.

My main question is: do I really need to compile MPIR for myself or can I use someone else's already compiled libraries in Visual Studio C++? If the latter is true, please help me out.
My computer has a core 2 duo processor but I'd like to have compatibility, so i would choose general c. Or do i need to use Cygwin or Linux to use this library?

Thanks for your time.

Brian Gladman

unread,
Oct 11, 2012, 4:23:45 AM10/11/12
to mpir-...@googlegroups.com
-----Original Message-----
From: Richard Marton
Sent: Thursday, October 11, 2012 9:12 AM
To: mpir-...@googlegroups.com
Subject: [mpir-devel] Re: Compiling MPIR in visual studio 2010 and 2012

I lost a wall of text now....

I followed the guide, then I get these errors when building the P4 version:
Error 17 error MSB3721: The command ""C:\Program Files (x86)\Microsoft
Visual Studio 11.0\VC\bin\"vsyasm.exe -Xvc -f Win32 -g cv8 -i
"..\..\mpn\x86_64w\\" -o "Win32\Release\mpn\\" -rnasm

[snip details]

when compiling the gc and cxx versions, i get a bunch of object files:
http://i138.photobucket.com/albums/q280/martonr/general_c.png

Since the error message said vsyasm.exe instead of yasm.exe, i renamed it.
It did not solve the problem.

==================================
You are using the wrong version of YASM - the one you need for Visual Studio
2010 is VSYASM, which is a _different_ version that is available on the YASM
site:

http://yasm.tortall.net/Download.html

Win32 VS2010 .zip (for use with VS2010 on 32-bit Windows)
Win64 VS2010 .zip (for use with VS2010 on 64-bit Windows)

Which one you need depends on whether you are using a 32 or 64 bit version
of Windows.

Brian

Brian Gladman

unread,
Oct 11, 2012, 4:35:20 AM10/11/12
to mpir-...@googlegroups.com
-----Original Message-----
From: Richard Marton
Sent: Thursday, October 11, 2012 9:12 AM
To: mpir-...@googlegroups.com
Subject: [mpir-devel] Re: Compiling MPIR in visual studio 2010 and 2012

[snip]

when compiling the gc and cxx versions, i get a bunch of object files:
http://i138.photobucket.com/albums/q280/martonr/general_c.png

=======================
This is normal but you are looking in the wrong location for the library.

If you are building for win32\release the library will be put in:

...\mpir-2.5.2\lib\win32\release

The directory structure used is:

mpir root directory
build.vc10 - the build files
lib - static library output
dll - DLL library output
bin - binary output (if any)

Brian

Message has been deleted

Brian Gladman

unread,
Oct 11, 2012, 5:21:42 AM10/11/12
to mpir-...@googlegroups.com
-----Original Message-----
From: Richard Marton
Sent: Thursday, October 11, 2012 10:14 AM
To: mpir-...@googlegroups.com
Subject: Re: [mpir-devel] Re: Compiling MPIR in visual studio 2010 and 2012

Thank you! So I will need to rename "yasm-1.2.0-win64.exe" to "vsyasm.exe"?

========================

No - if you have downloaded the correct zip file from the YASM site, it will
contain vsyasm.exe so you don't need to rename it - just put it in the right
place (see the vc10 readme.txt).

Brian

Richard Marton

unread,
Oct 11, 2012, 10:53:11 AM10/11/12
to mpir-...@googlegroups.com
I have successfully compiled the P4 version with c++, the result files look what they should be.

Thank you for the fast assistance!
Reply all
Reply to author
Forward
0 new messages