GMP (gmp.lsp) doesn't work for me on MacOS X 10.6

Started by cormullion, September 19, 2010, 10:26:16 AM

Previous topic - Next topic

cormullion

I get the following when trying to run gmp.lsp:


ERR: problem loading library in function import : "dlopen(/usr/local/lib/libgmp.dylib, 9): no suitable image found.  Did find:nt/usr/local/lib/libgmp.dylib: mach-o, but wrong architecture"


In the directory /usr/local/lib, there's:


libgmp.10.dylib libgmp.a libgmp.dylib libgmp.la


In gmp.lsp, there's this code:


(set 'files '(
    "/usr/lib/libgmp.dylib" ;Mac OSX
    "/usr/lib/libgmp.3.dylib" ;Mac OSX
    "/opt/local/lib/libgmp.3.dylib" ;Mac OSX
    "/opt/local/lib/libgmp.dylib" ;Mac OSX
    "/usr/local/lib/libgmp.so.8.0" ; OpenBSD 4.6
    "/usr/lib/libgmp.so.3" ; Linux, BSDs
    "/usr/local/lib/libgmp.so" ; Linux, BSDs
    "/WINDOWS/system32/libgmp-3.dll" ; Win32 DLL path on current drive
    "libgmp-3.dll" ; Win32 in path for current directory
))


This is with the latest download of GMP (5.0.1).

Lutz

#1
The newer GMP lib version 5.0.1 is compiled for 64-bit? You can compile and install newLISP for 64-bit using the following on Mac OS-X from inside the newlisp-x.x.x directory:



make -f makefile_darwinLP64_utf8
sudo make install


Just made and tested GMP v. 5.0.1 on Mac OX X 10.6 and it passes all tests with newLISP compiled for 64-bit. Make sure you change the module file gmp.lsp, so it finds the correct library first.  Change the first line in 'files' to /usr/local/lib/libgmp.dylib .



We live in in this transition time where most of the apps and libraries are still 32-bit and many others are already 64-bit. Mac OS X does 64-bit by default only since version 10.6 Snow Leopard. newLISP still compiles and ships as 32-bit version by default. At one point we will switch over to 64-bit as a default for the binary distributions, but I think it is still to early.

cormullion

#2
Cool! Thanks, Lutz, that works great.