From: Nicholas Kinar on 10 Apr 2010 00:43 >> >> I would need to include the header files "mpfr.h" and "gmp.h" to be >> able to link to these libraries. >> >> Yikes, apparently I would need to include mpfr.h and gmp.h, and I >> don't see these two files in the > > Ok. Then I'd try to locate the include files you need and place them > where you can link to them. If you try to link to a dylib other than the > ones with Matlab, I expect you'll continue to have problems. > > BTW, my understanding is that Matlab uses the MKL version of gmp. So you > may still have some problem. Thanks Ben. I am going to have to see if I can find these particular header files or do some additional experimentation. Too bad that Matlab uses the Intel MKL.
From: Nicholas Kinar on 11 Apr 2010 01:56
To be able to link the libraries to the MEX files, I had to compile GMP and MPFR using the following configure: ../configure CFLAGS="-m32" CPPFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ABI=32 Then, when compiling the MEX file provide the absolute path to the library and also use the -read_only_relocs suppress switch when compiling the MEX file: 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 This tweak seems to work to compile the MEX file on Mac OS X 10.6 running Matlab R2010a. To the best of my knowledge, this does not currently work on any other platform or for any other libraries. |