Hello Brian---
Thank you very much for your response; this is greatly appreciated!
1>fits_intmax.obj : warning LNK4221: no public symbols found; archive
member will be inaccessible
1>Performing Post-Build Event...
1>Build log was saved at
"file://e:\Programs\common\MPIR\mpfr\build.vc9\lib_mpfr\Win32\Release\BuildLog.htm"
1>lib_mpfr - 0 error(s), 118 warning(s)
This is normal. These files don't add symbols because they don't have
code in them that is needed on Windows. For example, 'double' and
'long double' are the same on Windows so 'long double' conversion
isn't needed. I leave them in the build in case they become
necessary at some point in the future.
That's understandable, and it doesn't affect anything since MPIR also
beautifully passes all of the tests initiated by the Python script
/mpir-tests/run-tests.py. Rather than using a command-line compile,
I've now built these project files inside the Visual Studio IDE:
lib_mpir_p3
lib_mpir_cxx
These files are projects inside of the mpir.sln file. In addition, I've
built these two projects using the Release | Win32 target. My computer
processor is a 2.66GHz Intel Core 2 Duo running Windows Vista (32-bit).
Thus I have selected the P3 build in lieu of another which may be more
appropriate for a 64-bit architecture. All of the MPIR tests pass with
this configuration.
Using the Python script that you provide (run_lib_tests.py), I run some
tests on the static library, finding that:
157 tests:
2 failed to build
118 ran correctly
37 failed
.. completed - press ENTER
That looks bad. Did MPIR pass all its tests?
Here is the final output of the check initiated on the MPIR library:
174 tests:
174 ran correctly
.. completed - press ENTER
There's nothing to worry about here with MPIR. Using the lib_mpfr
Visual Studio solution file, I built the MPFR library and the tests
using the Release | Win32 target. The MPFR library built successfully.
I believe that I am using an identical configuration for both the MPIR
and MPFR builds.
Can you locate the two tests that failed to build and build them each
individually to see whay they failed?
Can you list the full test output so that I can see which tests
failed?
It is _very_ important to set _identical_ configurations when you
build MPIR and MPFR.
That is, if you build MPIR for 'release' and 'win32', you must also
build mpfr for 'release' and 'win32'.
Strangely enough, all of the tests did indeed build using the
lib_mpfr_tests project inside of the lib_mpfr solution:
========== Build: 101 succeeded, 0 failed, 57 up-to-date, 0 skipped
==========
Now running the run_lib_tests.py script, the full test output is shown
at the bottom of this e-mail.
However, I have now been able to build my MEX file with the MPIR and
MPFR libraries! This is wonderful, and thank you very much for helping
me to achieve this result!
I used the following invocation of the Malab MEX compiler to compile
my files on Windows Vista:
mex
-IE:\Programs\common\numerical-library-build\mpir\build.vc9\lib\Win32\Release
-IE:\Programs\common\numerical-library-build\mpfr T_Zeta.cpp mpreal.cpp
E:\Programs\common\numerical-library-build\mpir\build.vc9\lib\Win32\Release\mpir.lib
E:\Programs\common\numerical-library-build\mpfr\build.vc9\lib\Win32\Release\mpfr.lib
However, since I am using the C++ wrapper provided by Pavel Holoborodko
( and Brian as well, who is credited in the current release of the
wrapper as "Brain,"
see line 22 of mpreal.h), I had to comment out the following function in
mpreal.h:
/*you can't use this with the most recent SVN version of MPFR*/
/*since it has been deprecated */
/*
inline const mpreal random2 (mp_size_t size, mp_exp_t exp)
{
mpreal x;
mpfr_random2(x.mp,size,exp);
return x;
}
*/
I then ran my own custom function which has been compiled to MEX:
[re, im] = T_Zeta(13.000)
re = 0.6681
im = 0.7077
These values appear to be very reasonable for my T(Zeta) function, and I
have a strange suspicion that the MPIR and MPFR libraries might have
actually compiled correctly.
Perhaps something has changed in the SVN version of MPFR which would
cause the MPFR tests to fail on Windows using Visual Studio 2008?
BTW, to inject a philosophical argument into this discussion, I've tried
once again to compile the GMP and MPFR libraries on Mac OS X, and I've
found that compilation and linking with the MEX file is indeed possible
using the following MEX invocation and linking using the
"-read_only_relocs suppress" flag:
mex LDFLAGS="\$LDFLAGS -read_only_relocs suppress"
-I/usr/local/include T_Zeta.cpp mpreal.cpp /usr/local/lib/libgmp.a
/usr/local/lib/libmpfr.a
But IMHO this is really indicative of something pathological with the
linker on this platform:
http://lists.apple.com/archives/darwin-dev/2009/Jul/msg00123.html
IMHO, the best way to proceed would be to use MPIR and your custom build
files.
Thank you very much for your help, and for your excellent Visual Studio
build files!
Nicholas
OUTPUT of run_lib_tests.py script on Windows Vista:
-----------------------------------------------------------------------
Testing \mpfr.lib in Win32\Release :
mpf_compat : success
mpfr_compat : success
reuse : success
tabs : success
tacos : success
tacosh : ERROR ( 1 )
results differ for x=1.1010010010111010e54 prec=31 rnd_mode=MPFR_RNDZ
got 1.001101001111010110001110011101e5
expected 1.001101001111010110001110011100e5
approx 0.10011010011110101100011100111001111110110E6
tadd : success
tadd1sp : success
tadd_d : success
tadd_ui : success
tagm : ERROR ( 1 )
results differ for x=1.0101001110110101111100011000e-4
u=1.0011011001001101011111000000e-4 prec=36 rnd_mode=MPFR_RNDZ
got 1.01000100110101110001110001101111101e-4
expected 1.01000100110101110001110001110000001e-4
approx 0.1010001001101011100011100011100000011010100001E-3
tai : success
tasin : success
tasinh : ERROR ( 1 )
Error: mpfr_asinh (2)
tatan : success
tatanh : ERROR ( 1 )
Error: mpfr_atanh (2)
taway : success
tbuildopt : success
tcan_round : success
tcbrt : success
tcheck : success
tcmp : success
tcmp2 : success
tcmp_d : success
tcmp_ld : success
tcmp_ui : success
tcmpabs : success
tcomparisons : success
tconst_catalan : success
tconst_euler : success
tconst_log2 : success
tconst_pi : success
tcopysign : success
tcos : ERROR ( 1 )
mpfr_cos failed for x=1.00288304857059840103, rnd=MPFR_RNDZ
mpfr_cos gives cos(x)=5.3787406202252686e-1, expected
0.537874062022526966409
tcosh : success
tcot : ERROR ( 1 )
results differ for
x=1.010011011010101010101101111110101000111100001011010101110001000e-1
prec=64 rnd_mode=MPFR_RNDZ
got 1.010011111001001000101000110011111011010110110110111000110110000
expected 1.010011111001001000101000110011111011010110110110111000110110001
approx
0.10100111110010010001010001100111110110101101101101110001101100010110001100E1
tcoth : success
tcsc : ERROR ( 1 )
results differ for
x=1.110010100111101111001010101010111111100110000110011001001011110e-2
prec=69 rnd_mode=MPFR_RNDU
got
1.00100111101010010101100111100111011110010110000101100110001111000101e1
expected
1.00100111101010010101100111100111011110010110000101100110001111000011e1
approx
0.1001001111010100101011001111001110111100101100001011001100011110000100101110010E2
tcsch : success
td_div : success
td_sub : success
tdigamma : ERROR ( 1 )
results differ for x=1.00101011001101010000101e-1 prec=31
rnd_mode=MPFR_RNDA
got -1.100110010011111110111100101111
expected -1.100110010011111110111100110000
approx -0.11001100100111111101111001011110011010010E1
tdim : success
tdiv : ERROR ( 1 )
Wrong inexact flag for rnd=MPFR_RNDZ
expected 1, got -1
x=0.100E0
u=0.11100011011010111001011100110010E-1
y=0.10010000000101011110110110101000101100110101011011E1
y*u=0.1000000000000000000000000000000000010001100000101100101101101101011100100011000110E0
tdiv_d : success
tdiv_ui : success
teint : ERROR ( 1 )
results differ for x=1.011110111111111110e-2 prec=19
rnd_mode=MPFR_RNDA
got -1.011010011110001100e-8
expected -1.011010011110001101e-8
approx -0.10110100111100011000000000101E-7
teq : success
terf : ERROR ( 1 )
Error: erf for worst case (1)
texceptions : success
texp : success
texp10 : ERROR ( 1 )
results differ for x=1.10001001111101110e21 prec=18 rnd_mode=MPFR_RNDA
got 1.11001111011101101e10721057
expected 1.11001111011101110e10721057
approx 0.1110011110111011011110111010E10721058
texp2 : ERROR ( 1 )
results differ for x=1.011101100110000011111e-1 prec=28
rnd_mode=MPFR_RNDZ
got 1.101010001111011110101011010
expected 1.101010001111011110101011011
approx 0.11010100011110111101010110110000000010E1
texpm1 : success
tfactorial : success
tfits : success
tfma : success
tfmod : success
tfms : success
tfprintf : success
tfrac : success
tgamma : success
tget_d : success
tget_d_2exp : success
tget_f : success
tget_flt : success
tget_ld_2exp : success
tget_set_d64 : success
tget_sj : success
tget_str : success
tget_z : success
tgmpop : ERROR ( 1 )
Range error for prec=33 and mul
q1=1010101000100110100010100101101/100010110001111010110000100101
q2=10001111111100111110110000111000/11000110010110011101100100001011
fr_dn=0.111000110011101101110101001001100E1
fr_q =0.111000110011101101110101001001101E1
fr_up=0.111000110011101101110101001001100E1
thyperbolic : success
thypot : success
tinits : success
tinp_str : success
tinternals : success
tisnan : success
tisqrt : success
tj0 : ERROR ( 1 )
results differ for x=1.111111111000000000000011111111e7 prec=33
rnd_mode=MPFR_RNDD
got -1.01100111101000010110011011011101e-5
expected -1.01100111101000010110011011011110e-5
approx -0.1011001111010000101100110110111010010000000E-4
tj1 : ERROR ( 1 )
results differ for x=1.11111111111e4 prec=37 rnd_mode=MPFR_RNDA
got -1.110001010110011101100000101101101000e-6
expected -1.110001010110011101100000101101011111e-6
approx -0.11100010101100111011000001011010111100100001111E-5
tjn : success
tl2b : success
tlgamma : success
tli2 : ERROR ( 1 )
Wrong inexact flag for rnd=MPFR_RNDN: expected -2, got 1
x=-0.110001111111101110011011110000000000000E0
y=-0.10101010011110010111110011011111010011E0
t=-0.1010101001111001011111001110E0
tlngamma : success
tlog : ERROR ( 1 )
results differ for x=1.10100001111110101111101111e-1 prec=27
rnd_mode=MPFR_RNDA
got -1.10011111100001001101010100e-3
expected -1.10011111100001001101010011e-3
approx -0.1100111111000010011010100101111110011E-2
tlog10 : ERROR ( 1 )
results differ for x=1.11011111110011110100000001e-1 prec=27
rnd_mode=MPFR_RNDU
got -1.11001110000010111100100001e-6
expected -1.11001110000010111100100010e-6
approx -0.1110011100000101111001000100000101100E-5
tlog1p : ERROR ( 1 )
results differ for x=-1.1010110010011011010010000e-5 prec=26
rnd_mode=MPFR_RNDZ
got -1.1011100000111001110111100e-5
expected -1.1011100000111001110111101e-5
approx -0.110111000001110011101111010000010000E-4
tlog2 : ERROR ( 1 )
results differ for x=1.1111011101011010110001e-1 prec=25
rnd_mode=MPFR_RNDU
got -1.100100101000100100110101e-6
expected -1.100100101000100100110100e-6
approx -0.11001001010001001001101000110010011E-5
tmin_prec : success
tminmax : success
tmodf : success
tmul : ERROR ( 1 )
(1)mpfr_mul failed for x=2.63978122803639081440e-01
y=6.8378615379333496093e-1 with rnd=MPFR_RNDN
correct is 0.180504585267044603, mpfr_mul gives 1.8050458515e-1tmul_2exp
: success
tmul_d : ERROR ( 1 )
results differ for x=1.111111111111111100000e-1
u=1.1111111111111110000111111111111111100000000000000000 prec=22
rnd_mode=MPFR_RNDU
got 1.111111111111110100101
expected 1.111111111111110100100
approx 0.11111111111111101001000000000000E1
tmul_ui : success
tnext : success
tout_str : success
toutimpl : success
tpow : ERROR ( 1 )
Error in mpfr_pow for prec=30, rnd=MPFR_RNDN
tpow3 : ERROR ( 1 )
results differ for x^y with x=1.0111000010111011011100011e-1
y=-1.0101010011010111111001011000100e-2 prec=26 rnd_mode=MPFR_RNDA
got 1.0001110110001110010110101
expected 1.0001110110001110010110100
approx 0.100011101100011100101101000000000000E1
tpow_all : ERROR ( 1 )
Error in underflow_up2
with mpfr_pow
x = 7.fffff...@-1,
y = 1073741824, MPFR_RNDN
Expected 1.0000000000000...@-268435456, inex = 1, flags = 9
Got 1.8000000000000...@-268435456, inex = 1, flags = 9
tpow_z : ERROR ( 1 )
Error for p = 14, z = 822099334, rnd = MPFR_RNDZ and x =
0.10101000110100E1
Ypowsi = 0.11010010101100E328246116
Ypowz = 0.11010001100101E328246116
tprintf : success
trandom : success
trec_sqrt : success
tremquo : success
trint : success
troot : success
tround_prec : success
tsec : ERROR ( 1 )
results differ for
x=-1.011111111101100010010011000010100101111000010111010110110011101e-1
prec=64 rnd_mode=MPFR_RNDU
got 1.010111011100011100001001100100001000010100000011000010101001001
expected 1.010111011100011100001001100100001000010100000011000010101001000
approx
0.10101110111000111000010011001000010000101000000110000101010001111110100111E1
tsech : success
tset : success
tset_d : success
tset_exp : success
tset_f : success
tset_ld : success
tset_q : success
tset_si : success
tset_sj : success
tset_str : success
tset_z : success
Build failure for tset_z_exp
tsgn : success
tsi_op : success
tsin : ERROR ( 1 )
mpfr_sin failed for x=4.984987858808754279e-1, rnd=MPFR_RNDD
mpfr_sin gives sin(x)=4.7810755953933304e-1, expected
4.781075595393329824e-1
tsin_cos : ERROR ( 1 )
mpfr_sin_cos failed for x=4.984987858808754279e-1, rnd=MPFR_RNDD
mpfr_sin_cos gives sin(x)=4.7810755953933304e-1, expected
4.781075595393329824e-1
tsinh : success
tsinh_cosh : success
tsprintf : success
tsqr : ERROR ( 1 )
ERROR: for MPFR_RNDN and prec=51
INPUT=0.100110110010011001110111011010010011000000001010100E0
Output=0.101111000000111100110100110000100001011000110011111E-1
InexactMul= 1 InexactSqr= -1
tsqrt : ERROR ( 1 )
Error: wrong inexact flag, expected 1, got -1
x=0.101100011011001001101100111001000011001001011111101111E0 rnd=MPFR_RNDZ
y=0.110101010100100011101011101000111110111111101110001101E0
tsqrt_ui : success
tstckintc : success
Build failure for tstdint
tstrtofr : success
tsub : success
tsub1sp : success
tsub_d : success
tsub_ui : success
tsubnormal : success
tsum : success
tswap : success
ttan : ERROR ( 1 )
results differ for
x=-1.011111111101100010010011000010100101111000010111010110110011101e-1
prec=64 rnd_mode=MPFR_RNDU
got
-1.110111001011000010010110111111011100001111111101011010111001111e-1
expected
-1.110111001011000010010110111111011100001111111101011010111001110e-1
approx
-0.11101110010110000100101101111110111000011111111010110101110011100001100010E0
ttanh : success
ttrunc : success
tui_div : ERROR ( 1 )
Wrong inexact flag for u=2295343335, rnd=MPFR_RNDN
expected -1, got 0
x=0.10E0
y=0.100010001101000000101000111001110E33
y*x=0.10001000110100000010100011100110000E32
tui_pow : ERROR ( 1 )
results differ for x=1.10001111101011010101e-1 n=198529486 prec=21
rnd_mode=MPFR_RNDU
got 1.01101110011110110010e21
expected 1.01101110011110110001e21
approx 0.1011011100111101100001111111010E22
tui_sub : success
turandom : success
tversion : success
ty0 : ERROR ( 1 )
results differ for x=1.1111111111111111e5 prec=39 rnd_mode=MPFR_RNDA
got 1.00101111010010001101001001001110000001e-5
expected 1.00101111010010001101001001001101111011e-5
approx 0.1001011110100100011010010010011011110100111101101E-4
ty1 : ERROR ( 1 )
results differ for x=1.1111111111111111e5 prec=39 rnd_mode=MPFR_RNDA
got -1.01111010001001101011001001001111100100e-4
expected -1.01111010001001101011001001001111011101e-4
approx -0.1011110100010011010110010010011110111000110100111E-3
tyn : success
tzeta : success
tzeta_ui : success
157 tests:
2 failed to build
118 ran correctly
37 failed
.. completed - press ENTER
-----------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To post to this group, send email to mpir-de...@googlegroups.com.
To unsubscribe from this group, send email to
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/mpir-devel?hl=en.