Annotation of OpenXM/doc/HOWTO/gmp-on-Windows.txt, Revision 1.1
1.1 ! ohara 1: Windows $B$K$*$1$k(B GMP/MPFR/MPC $B$N%S%k%IK!(B
! 2:
! 3: Risa/Asir $B$N%i%$%;%s%9$NET9g>e!"(BLGPL $B$N%i%$%V%i%j$H$OF0E*7k9g$9$kI,MW$,$"$k!#(B
! 4: $B$3$NJ8=q$G$O!"(BWindows $B$K$*$$$F(B GNU MP ($B$^$?$O(B MPIR), MPFR, MPC $B$NF0E*%i%$%V%i%j(B
! 5: (*.dll)$B$*$h$S%$%s%]!<%H%i%$%V%i%j(B(*.lib)$B$r:n@.$9$kJ}K!$r@bL@$9$k!#(B
! 6:
! 7: $BBh0lIt(B: Visual Studio 2013$BJT(B
! 8:
! 9: 1. $B=`Hw(B
! 10:
! 11: MPIR, MPFR, MPC $B$N%=!<%9$rE,Ev$J%G%#%l%/%H%j(B($BNc(B: c:\Users\ohara\OpenXM_dist )
! 12: $B$KMQ0U$9$k!#$3$3$G$O!"0J2<$N%P!<%8%g%s$rMQ$$$k!#(B
! 13:
! 14: mpir-2.7.0.zip
! 15: mpfr-3.1.3.tar.bz2
! 16: mpc-1.0.3.tar.gz
! 17:
! 18: $B$^$?!"(Bmpfr, mpc $B$K$D$$$F$O!"(Bhttp://www.gladman.me.uk/ $B$+$i(B
! 19: Visual Studio $BMQ$N%W%m%8%'%/%H%U%!%$%k$rF~<j$9$k!#$"$o$;$F(B
! 20: vsyasm $B$b%$%s%9%H!<%k$7$F$*$/$3$H!#(B
! 21:
! 22: $B$^$:!"$=$l$>$l$N%=!<%9$rE83+$9$k!#(B(mingw $B$r;H$&!#E,;~!"FI$_$+$($k$3$H(B)
! 23:
! 24: d=/c/Users/ohara/OpenXM_dist
! 25: unzip $d/mpir-2.7.0.zip
! 26: tar jxf $d/mpfr-3.1.3.tar.bz2
! 27: tar zxf $d/mpc-1.0.3.tar.gz
! 28: for i in mpir-2.7.0 mpfr-3.1.3 mpc-1.0.3; do mv $i ${i%-*}; done
! 29: (cd mpfr; unzip $d/mpfr.svn9046.build.vc12.zip;
! 30: cd src; touch fpif.c get_float128.c rndna.c set_float128.c;
! 31: cd x86_64; cp -Rp core2 corei5)
! 32: (cd mpfr; unzip $d/mpc.svn1450.build.vc12.zip)
! 33:
! 34:
! 35: 2. MPIR $B$N%S%k%I(B
! 36:
! 37: mpir/build.vc12/mpir.sln $B$r3+$/!#(B
! 38:
! 39: $B<B9T;~$K(B msvcr120.dll (Visual C++ $B:FHRI[2DG=%Q%C%1!<%8(B) $B$K0MB8$7$J$$$h(B
! 40: $B$&$K!"(Bdll $B$r:n@.$9$k$?$a$K!"%j%s%+$N@_Dj$rJQ99$9$k!#%/%i%9%S%e!<$G!"(B
! 41: dll_mpir_gc $B$N%W%m%Q%F%#$r3+$-!"!V9=@.%W%m%Q%F%#!W(B->$B!V(BC/C++$B!W(B->
! 42: $B!V%3!<%I@8@.!W(B->$B!V%i%s%?%$%`%i%$%V%i%j!W$,!"(BRelease/Win32 $B$N$H$-$K!"(B
! 43: $B!V%^%k%A%9%l%C%I(B(/MT)$B!W$G$"$k$3$H$r3NG'$9$k!#(BRelease/Win32 $B$K$D$$$F!"(B
! 44: dll_mpir_gc $B$r%S%k%I$9$k!#(B
! 45:
! 46: $B$^$?!"%/%i%9%S%e!<$G!"(Bdll_mpir_core2 $B$N%W%m%Q%F%#$r3+$-!"F1$8$h$&$K!"(B
! 47: $B!V%i%s%?%$%`%i%$%V%i%j!W$,!"(BRelease/x64 $B$N$H$-$K!"(B
! 48: $B!V%^%k%A%9%l%C%I(B(/MT)$B!W$G$"$k$3$H$r3NG'$9$k!#(BRelease/x64 $B$K$D$$$F!"(B
! 49: dll_mpir_core2 $B$r%S%k%I$9$k!#(B
! 50:
! 51: $B@8@.J*$O!"(Bmpir/dll/{Win32,x64}/Release/ $B$K$"$k!#(B
! 52:
! 53:
! 54: 3. MPFR $B$N%S%k%I(B
! 55:
! 56: mpir/build.vc12/dll_mpfr.sln $B$r3+$/!#(B
! 57:
! 58: ******** $B$3$N%W%m%8%'%/%H%U%!%$%k$K$O%P%0$,$"$k!#(B ********
! 59:
! 60: $B%/%i%9%S%e!<$G!"(Bdll_mpfr $B$N%W%m%Q%F%#$r3+$-!"!V9=@.%W%m%Q%F%#!W(B->
! 61: $B!V(BC/C++$B!W(B->$B!V%3!<%I@8@.!W(B->$B!V%W%j%W%m%;%C%5!W(B->$B!V%W%j%W%m%;%C%5$NDj5A!W(B
! 62: $B$r3NG'$7!"(BRelease/Win32 $B$N$H$-$K!"!V(B_WIN64$B!W$NDj5A$r:o=|$9$k!#(B
! 63:
! 64: ******** $B$3$l$G%P%0$N=$@5$O40N;$G$"$k!#(B ********
! 65:
! 66: $B<!$K!"!V%i%s%?%$%`%i%$%V%i%j!W$,!"(BRelease/Win32 $B$*$h$S(B Release/x64
! 67: $B$N$H$-$K!"!V%^%k%A%9%l%C%I(B(/MT)$B!W$G$"$k$3$H$r3NG'$9$k!#(B
! 68:
! 69: Release/Win32 $B$*$h$S(B Release/x64 $B$K$D$$$F!"(Bdll_mpfr $B$r%S%k%I$9$k!#(B
! 70:
! 71: $B@8@.J*$O!"(Bmpfr/dll/{Win32,x64}/Release/ $B$K$"$k!#(B
! 72:
! 73: 4. MPC $B$N%S%k%I(B
! 74:
! 75: mpc/build.vc12/mpc.sln $B$r3+$/!#<!$K%/%i%9%S%e!<$G!"(Bmpc_dll $B$N%W%m%Q%F%#$r3+$-!"(B
! 76: $B!V9=@.%W%m%Q%F%#!W(B->$B!V(BC/C++$B!W(B->$B!V%3!<%I@8@.!W(B->$B!V%i%s%?%$%`%i%$%V%i%j!W$,!"(B
! 77: Release/Win32 $B$*$h$S(B Release/x64 $B$N$H$-$K!"!V%^%k%A%9%l%C%I(B(/MT)$B!W$G$"$k$3$H$r3NG'$9$k!#(B
! 78:
! 79: Release/Win32 $B$*$h$S(B Release/x64 $B$K$D$$$F!"(Bmpc_dll $B$r%S%k%I$9$k!#(B
! 80:
! 81: $B@8@.J*$O!"(Bmpc/dll/{Win32,x64}/Release/ $B$K$"$k!#(B
! 82:
! 83:
! 84: 5. $B%S%k%I$N8e(B
! 85:
! 86: {mpir,mpfr,mpc}/dll/{Win32,x64}/Release/
! 87: $B$K%U%!%$%k$,@8@.$5$l$k!#(B
! 88:
! 89: $B:G=*E*$KI,MW$JJ*$O!"(B
! 90: $B%X%C%@(B gmp.h, gmpxx.h, mpfr.h, mpc.h
! 91: $BF0E*%i%$%V%i%j(B mpir.dll, mpfr.dll, mpc.dll
! 92: $B%$%s%]!<%H%i%$%V%i%j(B mpir.lib, mpfr.lib, mpc.lib
! 93: $B$G$"$k!#(B
! 94:
! 95:
! 96: $BBhFsIt(B: MinGW $BJT(B
! 97:
! 98: mingw/msys2 $B$N%$%s%9%H!<%kJ}K!$K$D$$$F$O!"(B
! 99: how_to_install_MinGW-MSYS2.txt $B$r;2>H$N$3$H!#(B
! 100:
! 101: 1. $B35@b!&J}?K(B
! 102:
! 103: $B@EE*%i%$%V%i%j$N@8@.$rHr$1$k$?$a!"(Bconfigure $B$N%*%W%7%g%s$K!"(B
! 104: --enable-shared --disable-static
! 105: $B$r2C$($k$3$H$H$9$k!#(B
! 106:
! 107: $B$5$i$K!"Hs(B mingw $B4D6-$G$b<B9T2DG=$J%i%$%V%i%j$r:n@.$7$?$$!#(B
! 108:
! 109: $B$3$3$GLdBj$K$J$k$N$,!"(Bmingw $B$K$*$1$kNc30=hM}$NJ}K!$G$"$k!#(BWindows $B$NI8(B
! 110: $B=`(B(= VisualStudio)$B$G$O!"(BSEH ($B9=B$2=Nc30=hM}(B)$B$r;H$&$3$H$K$J$C$F$$$F!"(B
! 111: MinGW 64 $B$G$O!"(Bgcc $B$b%5%]!<%H$9$k!#(B
! 112:
! 113: $B$7$+$7$J$,$i!"(BMinGW 32 $B$N(B gcc $B$O(B dwarf-2 $BNc30=hM}$r;HMQ$7!"(BSEH $B$O%5%]!<(B
! 114: $B%H$7$F$$$J$$!#$=$N$?$a!"$3$l$r<B8=$9$k(B libgcc_s_dw2-1.dll $B$H%j%s%/$7$h(B
! 115: $B$&$H$9$k!#@EE*$K%j%s%/$9$k$K$O!"(Bgcc $B$K%*%W%7%g%s(B -static-libgcc $B$rM?$($k!#(B
! 116:
! 117:
! 118: 2. $B%S%k%I(B
! 119:
! 120: GNU MP, MPFR, MPC $B$N%=!<%9$rE,Ev$J%G%#%l%/%H%j(B($BNc(B: c:\Users\ohara\OpenXM_dist )
! 121: $B$KMQ0U$9$k!#$3$3$G$O!"0J2<$N%P!<%8%g%s$rMQ$$$k!#(B
! 122:
! 123: gmp-5.1.3.tar.gz
! 124: mpfr-3.1.3.tar.bz2
! 125: mpc-1.0.3.tar.gz
! 126:
! 127: $BIUO?(B1 $B$GM?$($k%7%'%k%9%/%j%W%H(B mk.sh $B$r<B9T$7$F!"%i%$%V%i%j$r:n@.$9$k!#(B
! 128: $B@8@.J*$O!"(B${LOCAL}/{bin,include,lib} $B$K=PNO$5$l$k!#(B
! 129:
! 130: 3. Visual Studio $BMQ%$%s%]!<%H%i%$%V%i%j(B
! 131:
! 132: mingw $BIUB0$N(B gendef $B$N=PNO$9$k(B *.def $B$r!"(BMS lib.exe $B$G=hM}$9$k$3$H$K$h$j!"(B
! 133: $B%$%s%]!<%H%i%$%V%i%j$r:n@.$G$-$k!#6qBNE*$K$O!"IUO?(B2 $B$GM?$($k%P%C%A%U%!%$%k$r(B
! 134: *.def $B$NB8:_$9$k%G%#%l%/%H%j(B (${LOCAL}/bin) $B$G<B9T$9$k$H$h$$!#(B
! 135:
! 136: A. $BIUO?(B1
! 137:
! 138: $B!V(Bmingw-w64 win64 shell$B!W$^$?$O!V(Bmingw-w64 win32 shell$B!W>e$G<B9T$9$k%7%'%k%9%/%j%W%H$G$"$k!#(B
! 139:
! 140: #!/bin/bash
! 141:
! 142: LOCAL=/usr/local"${MSYSTEM#MINGW}"
! 143: [ -d ${LOCAL} ] || mkdir -p ${LOCAL}
! 144:
! 145: dist=/c/Users/ohara/OpenXM_dist
! 146: gmp=gmp-5.1.3
! 147: mpf=mpfr-3.1.3
! 148: mpc=mpc-1.0.3
! 149:
! 150: for i in ${gmp}.tar.gz ${mpf}.tar.bz2 ${mpc}.tar.gz ; do case "$i" in *.bz2) tar jxf ${dist}/"$i";; *.gz) tar zxf ${dist}/"$i";; esac; done
! 151:
! 152: pushd ${gmp}
! 153: ./configure --prefix=${LOCAL} --enable-shared --disable-static --disable-cxx
! 154: make
! 155: if [ "$MSYSTEM" = MINGW32 ]; then
! 156: gcc -static-libgcc -shared .libs/*.o */.libs/*.o -m32 -Wl,--export-all-symbols -Wl,--output-def -Wl,.libs/libgmp-3.dll.def -o .libs/libgmp-10.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libgmp.dll.
! 157: a
! 158: fi
! 159: make install
! 160: (cd .libs; gendef libgmp-10.dll; cp -p libgmp-10.def ${LOCAL}/bin)
! 161: popd
! 162:
! 163: pushd ${mpf}
! 164: ./configure --prefix=${LOCAL} --enable-shared --disable-static --with-gmp=${LOCAL} --disable-thread-safe
! 165: make
! 166: if [ "$MSYSTEM" = MINGW32 ]; then
! 167: cd src
! 168: gcc -static-libgcc -shared .libs/*.o -L${LOCAL}/lib ${LOCAL}/lib/libgmp.dll.a -m32 -Wl,--output-def -Wl,.libs/libmpfr-4.dll.def -o .libs/libmpfr-4.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmpfr.dll.a
! 169: cd ..
! 170: fi
! 171: make install
! 172: (cd src/.libs; gendef libmpfr-4.dll; cp -p libmpfr-4.def ${LOCAL}/bin)
! 173: popd
! 174:
! 175: pushd ${mpc}
! 176: ./configure --prefix=${LOCAL} --enable-shared --disable-static --with-gmp=${LOCAL} --with-mpfr=${LOCAL}
! 177: make
! 178: if [ "$MSYSTEM" = MINGW32 ]; then
! 179: cd src
! 180: gcc -static-libgcc -shared .libs/*.o -L${LOCAL}/lib ${LOCAL}/lib/libmpfr.dll.a ${LOCAL}/lib/libgmp.dll.a -m32 -o .libs/libmpc-3.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmpc.dll.a
! 181: cd ..
! 182: fi
! 183: make install
! 184: (cd src/.libs; gendef libmpc-3.dll; cp -p libmpc-3.def ${LOCAL}/bin)
! 185: popd
! 186:
! 187: B. $BIUO?(B2
! 188:
! 189: $B%3%^%s%I%W%m%s%W%H>e$G<B9T$9$k%P%C%A%U%!%$%k$G$"$k!#(B
! 190: $B4D6-$K$h$j(B 32bit $B$^$?$O(B 64bit $B$N%i%$%V%i%j$,@8@.$5$l$k$3$H$KCm0U!#(B
! 191:
! 192: @echo off
! 193: lib /def:libmpc-3.def /out:libmpc-3.lib
! 194: lib /def:libmpfr-4.def /out:libmpfr-4.lib
! 195: lib /def:libgmp-10.def /out:libgmp-10.lib
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>