〇〇 发表于 2010-10-21 12:24:02

FILE *fp;
    fp=fopen(argv,"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
   gcdtime =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
   gcdtime =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
   gcdtime =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
   gcdtime =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.904wallclock =0.000
total      cputime =1.279wallclock =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.893wallclock =0.000
total      cputime = 23.119wallclock =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版本是否能用

G-Spider 发表于 2011-1-8 17:53:30

我也编译了一下,windows平台
vc可用。

wayne 发表于 2011-1-9 19:05:15

25# G-Spider
牛人啊,可否告诉俺是咋编译出来的?

wayne 发表于 2011-1-9 19:22:15

25# G-Spider
不过好像有问题, 是运行时错误,排查了一下,发现问题出在 mpz_out_str 函数上

wayne 发表于 2011-1-9 19:27:28

25# G-Spider
:victory: ,GMP版本是5.0.1 , ......
可否给我们编译出支持C++ 的版本?

G-Spider 发表于 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文件了。

wayne 发表于 2011-1-10 00:27:17

29# G-Spider
能否把你的def文件传上来,谢谢了
页: 1 2 [3] 4 5 6 7 8
查看完整版本: mathe能否提供更新的windows版gmp库