Re: matlisp on Mac OS X (Intel)

Enphilistor <[email protected]> Sat, 21 Apr 2007 05:18:41 -0500
Newsgroups gmane.lisp.matlisp.user
Message-ID <[email protected]>
Jan,

Okay.  I think I've found the problem.   Go back to the file  
configure.in and edit the block that deals with Darwin.  Change  
things so that you end up with:

FLIBS="-llapack -lblas -lg2c -lSystem /usr/lib/dylib1.o"
SHARED_LIB_LDFLAGS="-dylib -single_module"

Then run:

	autoconf configure.in > configure

and then run

	./configure --prefix=`pwd` --with-fflags="-O3 -fPIC"  --with- 
lisp=sbcl --with-lisp-exec=sbcl

This will create a libmatlisp.so that CAN be loaded into sbcl and  
which will allow the 'make' process to run to completion (i.e. the  
loading and processing of 'start.lisp' works).
Note that the -llapack -lblas entries in the FLIBS statement will  
load the apple vecLib framework optimized lapack and blas libraries  
as can be seen in the resulting shared object:

% otool -L lib/libmatlisp.so

lib/libmatlisp.so:
         ./lib/libmatlisp.so (compatibility version 0.0.0, current  
version 0.0.0)
         /System/Library/Frameworks/Accelerate.framework/Versions/A/ 
Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib (compatibility  
version 1.0.0, current version 192.15.0)
         /System/Library/Frameworks/Accelerate.framework/Versions/A/ 
Frameworks/vecLib.framework/Versions/A/libBLAS.dylib (compatibility  
version 1.0.0, current version 192.15.0)
         /usr/local/lib/libg2c.0.dylib (compatibility version 1.0.0,  
current version 1.0.0)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 88.3.7)

Anyway this seems to work for me.
Cheers,

-- E


On Apr 21, 2007, at 3:41 AM, Jan Rychter wrote:

>> Jan,
>> I'm trying to get things working with Mac OS X on intel as well.  I
>> am also using the g77, gfortran, and gcc from the Mac HPC page on
>> sourceforge.  I've noticed that the default distribution from cvs
>> seems to have been built assuming that folks would be using Fink.
>> I'm definitely not and that's what's causing the link to fail for
>> me.  I've found that if you'll edit configure.in, search for "-L/sw/
>> lib" down under the case for darwin you'll find some rules that
>> pertain to the problem at hand.  If you'll replace the line that  
>> says:
>>
>> 	FLIBS="-L/sw/lib -lf2c -lSystem /usr/lib/bundle1.o"
>>
>> with
>>
>> 	FLIBS="-lSystem /usr/lib/bundle1.o"
>>
>> and then save the file and run "autoconf configure.in > configure"
>> and then ./configure as usual, and then make, you should get through
>> the link.  This is about as far as I've gotten so far.  Which lisp
>> are you using?  I'm using SBCL.
>
> This is a good bit of advice -- one thing I was missing was that I've
> been trying to use the included configure script, instead of
> regenerating it using autoconf. Running autoconf definitely improved
> things.
>
> libmatlisp.so does get built now -- but SBCL is unable to load it:
>
> debugger invoked on a SIMPLE-ERROR:
>   Error opening shared object "/Users/jwr/lisp/matlisp/lib/ 
> libmatlisp.so":
>   dlopen(3) failed.
>
> [10:40] tnuctip:/Users/jwr>file /Users/jwr/lisp/matlisp/lib/ 
> libmatlisp.so
> /Users/jwr/lisp/matlisp/lib/libmatlisp.so: Mach-O bundle i386
> [10:40] tnuctip:/Users/jwr>
>
> I thought SBCL did support loading shared objects on Mac OS X?
>
> AllegroCL seems to load the same library just fine.
>
> --J.
>
>> On Apr 20, 2007, at 4:50 AM, Jan Rychter wrote:
>>
>>> Does anyone use matlisp on Mac OS X on an Intel CPU? If so, which
>>> fortran compiler did you use? Which exact version and where did you
>>> get
>>> it?
>>>
>>> I can't seem to get through the linking phase for BLAS/LAPACK. I  
>>> tried
>>> gfortran from the gcc 4.3 package from http://hpc.sourceforge.net/,
>>> and
>>> now tried g77 from GNU Fortran (GCC) 3.4.0. They work fine until ld
>>> gets
>>> invoked and then things break. One reason for the breakage is that
>>> configure insists on trying to link in crt1.o into libraries, which
>>> won't work, but even removing that doesn't get me anywhere.
>>>
>>> Since some people reported being able to get it to work with minor
>>> adjustments, there must be something I'm doing wrong.
>>>
>>> Any hints?
>>>
>>> --J.
>
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Matlisp-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matlisp-users


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/