17

「WindowsプラットフォームのGMPインストール手順」の手順に従いました。VisualStudioで使用できる32ビットバージョンのGMPを作成できました。

./configure --prefix=${gmp-install} --disable-static --enable-shared
make
make install

次に、mingw_w64とmsysを別のマシン(64ビットWindowsを実行している)にインストールして、コマンドを再実行しました。

./configureは問題なく実行されました。しかし、「make」を実行すると、次のようになります。

m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_add_n -DDLL_EXPORT -DPIC add_n.asm >tmp-add_n.s
gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n -O2 -pedantic -fomit-frame-pointer -mno-cygwin tmp-add_n.s -DDLL_EXPORT -DPIC -o .libs/add_n.o
tmp-add_n.s: Assembler messages:
tmp-add_n.s:84: Error: operand type mismatch for `push'
tmp-add_n.s:85: Error: operand type mismatch for `push'
tmp-add_n.s:86: Error: operand type mismatch for `push'
tmp-add_n.s:107: Error: operand type mismatch for `jmp'
tmp-add_n.s:114: Error: operand type mismatch for `pop'
tmp-add_n.s:115: Error: operand type mismatch for `pop'
tmp-add_n.s:116: Error: operand type mismatch for `pop'
make[2]: *** [add_n.lo] Error 1
make[2]: Leaving directory `/d/Temp/gmp-5.0.1/mpn'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/d/Temp/gmp-5.0.1'
make: *** [all] Error 2

代わりに「gmake」を使用すると、次のエラーが表示されました。

m4 gcc  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_add_n -DDLL_EXPORT -DPIC add_n.asm >tmp-add_n.s
m4: gcc: No such file or directory
gmake[2]: *** [add_n.lo] Error 1
gmake[2]: Leaving directory `d:/Temp/gmp-5.0.1/mpn'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `d:/Temp/gmp-5.0.1'
gmake: *** [all] Error 2

私はC++makeに精通していません。64ビット用にビルドしていることをmingw_w64に通知するには、フラグを指定する必要がありますか?ありがとう。

4

5 に答える 5

8

http://gladman.plushost.co.uk/oldsite/computing/gmp4win.phpを参照し、この段落に注意してください。

ただし、GMP の 64 ビット アセンブラー コードは Windows x64 呼び出し規則と互換性がないため、GMP は Windows 上で高性能の 64 ビット ライブラリを提供できません。これは、Windows 上の 64 ビット GMP ライブラリが、優れた 64 ビット アセンブラ サポートを持つ MPIR と比較すると非常に遅いことを意味します。

したがって、アセンブリを無効にするか、 MPIR./configure --disable-assemblyを使用します。

于 2011-01-17T15:36:08.520 に答える
7

MPIRをご覧になることをお勧めします。Visual Studio をネイティブにサポートする GMP のフォークです。

于 2011-01-17T15:31:40.493 に答える
6

私は以下を試しました。ライブラリは正常に構築できます。

./configure --prefix=/d/Temp/gmp-5.0.1-install --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --disable-static --enable-shared
于 2011-01-19T02:29:19.677 に答える