I am trying to wrap FORTRAN90 code using f2py by writing the following commands
gfortran -c nrt.f90
gfortran -c lu.f90
gfortran -c sqn.f90
gfortran -c csm.f90 -llapack -lblas
gfortran -c pa.f90
f2py -c nrt.f90 lu.f90 sqn.f90 csm.f90 pa.f90 -m p_avg
I call the LAPACK function zhegv() inside csm.f90. Everything compiles, but when I call ipython from the terminal
ipython --pylab
And then in ipython type
from p_avg import pa
I see
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-8181d9e1b27d> in <module>()
----> 1 from p_avg import pa
ImportError: ./p_avg.so: undefined symbol: zhegv_
Is there something else I need to do to make sure f2py can understand this LAPACK function call? I see other people have asked about using f2py directly with LAPACK modules, but here I am using a LAPACK function from within another piece of FORTRAN code.
Thank you.
Update: When I try the command suggested in the comments by typing the following at the terminal,
f2py -L/usr/lib/lapack -llapack -c nrt.f90 lu.f90 sqn.f90 csm.f90 pa.f90 -m p_avg
or
f2py -L/usr/lib/ -llapack -c nrt.f90 lu.f90 sqn.f90 csm.f90 pa.f90 -m p_avg
And then typing the following in ipython,
from p_avg import pa
I get
---------------------------------------------------------------- -----------
ImportError Traceback (most recent call last)
<ipython-input-1-8181d9e1b27d> in <module>()
----> 1 from p_avg import pa
ImportError: No module named p_avg