From: rif <rif@MIT.EDU> - 2004-12-20 20:25:38
|
> >>>>> "rif" == rif <rif@MIT.EDU> writes: > > rif> Once matlab is loaded, I have a file where I def-fortran-routine > rif> dpotrf. This scheme works fine on my laptop, but on the other > rif> machine, when I try to load this file, I get the error: > > rif> Undefined foreign symbol: "dpotrf_" > rif> [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR] > > This sounds like dpotrf is not in the matlisp LAPACK/BLAS library. > Are you sure both platforms have identical libraries? It may happen > that we don't compile all the LAPACK routines if we don't have a > matlisp interface to them. > > Ray OK, my understanding is increasing, but I'm not all the way there yet. As I now understand, matlisp does not by default load all of lapack, but only what it needs. When you specify --with-atlas= at config time, matlisp loads the atlas lapack library (this is also a subset of lapack, but it contains the routines I need). So this explains why my stuff doesn't work without atlas, on either the laptop or the new machine. What I still don't get is why, when I specify a --with-atlas=, it works on the laptop but not the new machine. Looking into lazy-loader.lisp, part of the call to ext::load-foreign includes the arguments (to be tokenized): "-L/cbcl/cbcl01/rif/Software/ATLAS/lib/Linux_P4SSE2_4/" " " "-llapack -lcblas -lf77blas -latlas" " " This code is clearly being run (if I add some made-up library name I get an error), so it's finding (and AFAIK loading) the libraries it wants. Furthermore, dpotrf_ appears to be in the library: [rif@node-06 Linux_P4SSE2_4]$ pwd /cbcl/cbcl01/rif/Software/ATLAS/lib/Linux_P4SSE2_4 [rif@node-06 Linux_P4SSE2_4]$ nm liblapack.a | grep dpotrf_ 00000000 T atl_f77wrap_dpotrf__ U atl_f77wrap_dpotrf__ 00000000 T dpotrf_ Nevertheless, when I try to compile and then load a file containing a def-foreign-function for dpotrf, it fails on this machine with an "Undefined symbol dpotrf_ error" (this works on my laptop). Note that I seem to be able to just load the .lisp file directly, but compiling it then loading it yields the undefined symbol error --- I don't know if this is relevant. In case anyone wants it, I've put the file matlisp-ext-lapack.lisp in http://fpn.mit.edu/Downloads. My goal is to, after loading matlisp, be able to compile and load this file. As a side question, is there any easy way to tell what exactly library files ext::load-foreign is actually picking up? This could be helpful for debugging purposes. Again, any help is appreciated. Cheers, rif |