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

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

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

Post by cormullion »

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

Code: Select all

ERR: problem loading library in function import : "dlopen(/usr/local/lib/libgmp.dylib, 9): no suitable image found.  Did find:\n\t/usr/local/lib/libgmp.dylib: mach-o, but wrong architecture"
In the directory /usr/local/lib, there's:

Code: Select all

libgmp.10.dylib	libgmp.a	libgmp.dylib	libgmp.la
In gmp.lsp, there's this code:

Code: Select all

(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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

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

Post by Lutz »

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:

Code: Select all

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
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

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

Post by cormullion »

Cool! Thanks, Lutz, that works great.

Locked