[f2py] I need help on liking external libs

Paulo Teotonio Sobrinho teotonio@fma.if.usp.br
Mon, 25 Feb 2002 14:04:23 -0300 (BRT)


Dear Peterson 

On Sat, 23 Feb 2002, Pearu Peterson wrote:

> 
> Hi Paulo,
> 
> On Fri, 22 Feb 2002, Paulo Teotonio Sobrinho wrote:
> 
> > When I use it in fortran (program test.f) I link like this
> > 
> > g77 -o test initgraphics.o test.o -L/usr/X11R6/lib -lm -lg2 -lX11 -lgd
> > 
> > Now, I want to to use it in pyhton. What I did was
> > 
> > f2py -c initgraphics.f  -m test -L/usr/X11R6/lib -lm -lg2 -lX11 -lgd
> > 
> > It does not work. What I get is
> > 
> > >>> import test 
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> > ImportError: ./test.so: undefined symbol: g2_open_x11_
> > >
> > 
> > Can some one tell me what is the correct way to wrap my initgraphics.f ? 
> 
> Get the latest f2py that has the latest scipy_distutils and that fixes
> this bug. And you used the correct way already but when linking, just the
> libraries were not in the correct order, I believe.
> 

I removed my old f2py and installed  f2py 2.13.175-1212. After 
f2py -c initgraphics.f  -m test -L/usr/X11R6/lib -lm -lg2 -lX11 -lgd
I still get

>>> import test
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: ./test.so: undefined symbol: g2_open_x11_
 
When I try ldd test.so I see that the libraries are all there. I also try
to link just libg2.so but I still get the same message. Please help...

Paulo