[Numpy-discussion] f2py from numpy 1.0.5 on OSX 10.4.11/QuadPPC fails with undefined symbols

Harry Mangalam harry.mangalam@uci....
Sun Mar 30 20:16:34 CDT 2008


Answering part of my own question, one missing lib is (not 
surprisingly) libpython2.5 (add -lpython2.5) so that the link command 
is:

/usr/local/bin/g95 -L/opt/local/lib/ \
/tmp/tmp1r96Q9/tmp/tmp1r96Q9/src.macosx-10.3-ppc-2.5/fd_rrt1dmodule.o\ 
 /tmp/tmp1r96Q9/tmp/tmp1r96Q9/src.macosx-10.3-ppc-2.5/fortranobject.o\
 /tmp/tmp1r96Q9/CQZ.o /tmp/tmp1r96Q9/Umatrix1D.o \
 /tmp/tmp1r96Q9/fd_rrt1d.o \
 /tmp/tmp1r96Q9/tmp/tmp1r96Q9/src.macosx-10.3-ppc-2.5/fd_rrt1d-f2pywrappers.o\ 
-lpython2.5 \
-lSystemStubs \
-o ./fd_rrt1d.so -Wl,-framework -Wl,Accelerate
ld: Undefined symbols:
_MAIN_

You'd think that this would be added automatically, but this might be 
due to my previous installation of python2.5 (via the ports system) 
with the LDFLAGS set.

In order to fix this, I have to uninstall, then reinstall, the 
entirety of the python 2.5 dependency tree.  I'll set this to run 
later tonight.

So the only remaining undefined symbol is _MAIN_ . ...?  I don't know 
at what level to attack this; the main fortran routine is 
called 'fd_rrt1d', not 'main', but this was not a problem on Linux - 
it compiled and linked just fine.

Any ideas?

Harry






On Sunday 30 March 2008, Harry Mangalam wrote:
> Hi Robert,
> thanks very much for your help - responses inline below.
>
> On Friday 28 March 2008, Robert Kern wrote:
> > Can you triple-check that the "unset LDFLAGS" worked by using
> > env(1)? You still seem to have a -L/Users/hjm/lib flag that is
> > obviously not coming from the command line.
>
> $ env |grep LDFLAGS
> <nothing>
>
> That LDFLAGS was coming from my .profile and I've commented it out.
>
> I just re-installed numpy (successfully, it seems) and re-tried the
> f2py command:
>
> f2py --opt="-O3" -c -m fd_rrt1d --fcompiler=g95  --link-lapack_opt
> *.f
>
> which results in an otherwise successful run except that the last
> few lines are identical to the one I posted before:
>
> /usr/local/bin/g95
> /tmp/tmp9hmmi5/tmp/tmp9hmmi5/src.macosx-10.3-ppc-2.5/fd_rrt1dmodule
>.o
> /tmp/tmp9hmmi5/tmp/tmp9hmmi5/src.macosx-10.3-ppc-2.5/fortranobject.
>o /tmp/tmp9hmmi5/CQZ.o /tmp/tmp9hmmi5/Umatrix1D.o
> /tmp/tmp9hmmi5/fd_rrt1d.o
> /tmp/tmp9hmmi5/tmp/tmp9hmmi5/src.macosx-10.3-ppc-2.5/fd_rrt1d-f2pyw
>rappers.o -o ./fd_rrt1d.so -Wl,-framework -Wl,Accelerate ld:
> Undefined symbols:
> _PyArg_ParseTupleAndKeywords
> _PyCObject_AsVoidPtr
> _PyCObject_FromVoidPtr
> _PyCObject_Type
> _PyComplex_Type
> _PyDict_GetItemString
> _PyDict_SetItemString
>
> <many more but you get the idea>
>
> However, the LDFLAGS was set when I installed a numpy via the ports
> system previously- could that have 'poisoned' the install by
> setting some variable that prevents finding the appropriate lib?
>
> And do you know which lib is not being found?  I could just insert
> it into the final link command.
>
> Harry



-- 
Harry Mangalam - Research Computing, NACS, E2148, Engineering Gateway, 
UC Irvine 92697  949 824 0084(o), 949 285 4487(c)
--
[A Nation of Sheep breeds a Government of Wolves.
Edward R. Murrow]


More information about the Numpy-discussion mailing list