找回密码
 欢迎注册
楼主: 〇〇

[讨论] mathe能否提供更新的windows版gmp库

[复制链接]
 楼主| 发表于 2010-10-21 12:24:02 | 显示全部楼层
FILE *fp; fp=fopen(argv[2],"w"); mpf_out_str(fp, 10, d+2, qi); fclose(fp); 修改了4行 D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>timer gpi 11048576 1 Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31 #terms=779075, depth=21 sieve time = 0.000 .................................................. bs time = 0.000 gcd time = 0.000 div time = 0.000 sqrt time = 0.000 mul time = 0.000 total time = 0.000 P size=16085707 digits (1.455908) Q size=16085700 digits (1.455907) pi(0,779075)= Kernel Time = 0.904 = 3% User Time = 22.370 = 96% Process Time = 23.275 = 99% Global Time = 23.299 = 100% D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>timer gpi 1048576 1 Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31 #terms=73938, depth=18 sieve time = 0.000 .................................................. bs time = 0.000 gcd time = 0.000 div time = 0.000 sqrt time = 0.000 mul time = 0.000 total time = 0.000 P size=1526302 digits (1.455595) Q size=1526295 digits (1.455588) pi(0,73938)= Kernel Time = 0.031 = 2% User Time = 1.310 = 96% Process Time = 1.341 = 98% Global Time = 1.363 = 100%
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2010-10-21 12:27:40 | 显示全部楼层
D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>cl /O2 gpi.c /I . /link gmp.lib Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 Copyright (C) Microsoft Corporation. All rights reserved. gpi.c gpi.c(210) : warning C4005: 'min' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(855) : see previous definition of 'min' gpi.c(211) : warning C4005: 'max' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(854) : see previous definition of 'max' Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:gpi.exe gmp.lib gpi.obj D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>timer gpi 11048576 1 Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31 #terms=779075, depth=21 sieve time = 0.000 .................................................. bs time = 0.000 gcd time = 0.000 div time = 0.000 sqrt time = 0.000 mul time = 0.000 total time = 0.000 P size=16085707 digits (1.455908) Q size=16085700 digits (1.455907) pi(0,779075)= Kernel Time = 0.904 = 3% User Time = 22.370 = 96% Process Time = 23.275 = 99% Global Time = 23.299 = 100% D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>timer gpi 1048576 1 Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31 #terms=73938, depth=18 sieve time = 0.000 .................................................. bs time = 0.000 gcd time = 0.000 div time = 0.000 sqrt time = 0.000 mul time = 0.000 total time = 0.000 P size=1526302 digits (1.455595) Q size=1526295 digits (1.455588) pi(0,73938)= Kernel Time = 0.031 = 2% User Time = 1.310 = 96% Process Time = 1.341 = 98% Global Time = 1.363 = 100% D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>cl /O2 pin.c /I . /link gmp.lib Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 Copyright (C) Microsoft Corporation. All rights reserved. pin.c Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:pin.exe gmp.lib pin.obj D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>timer pin 1048576 1 Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31 #terms=73938 depth=18 nprocs=1 SERIAL bs cputime = 0.904 wallclock = 0.000 total cputime = 1.279 wallclock = 0.000 P size=2169550 digits (2.069044) Q size=2169543 digits (2.069037) pi(0,73938)= Kernel Time = 0.093 = 5% User Time = 1.544 = 93% Process Time = 1.638 = 99% Global Time = 1.654 = 100% D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>timer pin 11048576 1 Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31 #terms=779075 depth=21 nprocs=1 SERIAL bs cputime = 17.893 wallclock = 0.000 total cputime = 23.119 wallclock = 0.000 P size=25250481 digits (2.285406) Q size=25250475 digits (2.285405) pi(0,779075)= Kernel Time = 1.419 = 4% User Time = 28.360 = 95% Process Time = 29.780 = 99% Global Time = 29.811 = 100% D:\temp\m\mpir-2.1.3\build.vc10\lib\x64\Release>
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2010-10-21 14:44:59 | 显示全部楼层
mpir 2.1.3=> gmp.h /* Major version number is the value of __GNU_MP__ too, above and in mp.h. */ #define __GNU_MP_VERSION 5 #define __GNU_MP_VERSION_MINOR 0 #define __GNU_MP_VERSION_PATCHLEVEL 1 #define GMP_VERSION "5.0.1"
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2010-10-21 20:35:27 | 显示全部楼层
我用vc2010编译的谁试验一下,其他vc版本是否能用
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-8 17:53:30 | 显示全部楼层
我也编译了一下,windows平台 vc可用。 gmp_5.1.0_dll.rar (223.46 KB, 下载次数: 6)
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-9 19:05:15 | 显示全部楼层
25# G-Spider 牛人啊,可否告诉俺是咋编译出来的?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-9 19:22:15 | 显示全部楼层
25# G-Spider 不过好像有问题, 是运行时错误,排查了一下,发现问题出在 mpz_out_str 函数上 截图00.png
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-9 19:27:28 | 显示全部楼层
25# G-Spider ,GMP版本是5.0.1 , ...... 可否给我们编译出支持C++ 的版本?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-9 23:20:02 | 显示全部楼层
28# wayne GMP版本是5.0.1 还是之前的编译思路,在msys.bat中加入下面语句: call "D:\Program Files\Microsoft Visual Studio 9.0\VC\bin\VCVARS32.BAT" (调用环境变量,根据VCVARS32.BAT具体路径) 生成了dll,好像还有一个def文件 再用vs中的lib.exe生成导入库lib c++版本的还没试过,有时间我再编译一下。. 比如,生成了libgmp.dll 有个libgmp.def (必须改成只有后缀不一样) 复制这两个文件到lib.exe所在目录中,好像是vc\bin中 启用cmd,切换到lib.exe的目录下,如cd **vc\bin 输入命令: lib /DEF:libgmp.def 就可以在该目录下生成libgmp.lib文件了。

评分

参与人数 1鲜花 +5 收起 理由
wayne + 5 谢谢,我试试

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-10 00:27:17 | 显示全部楼层
29# G-Spider 能否把你的def文件传上来,谢谢了
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-12-27 07:14 , Processed in 0.037447 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表