f2py errors - ld: symbol(s) not found

Faisal Moledina faisal.moledina at gmail.com
Tue Nov 9 06:42:12 PST 2010


That did it. I had my LDFLAGS set to "-L/opt/local/lib". I must have
needed it when compiling something outside of MacPorts that depended
on something installed in /opt/local. I guess I shouldn't always have
that set as such. Thanks a lot!

Faisal

On Tue, Nov 9, 2010 at 8:47 AM, Michael Dickens <michaelld at macports.org> wrote:
> Hi Faisal - F2PY has the issue of allowing its internal LDFLAGS to be overwritten by the user's -- and thus linking will fail unless the necessary compiler flags (as found in the internal LDFLAGS) are added to the user's LDFLAGS.  Although this might not be the problem, it is worth trying since it's relatively simple: "unset LDFLAGS" before using F2PY and see if it works.  Whatever you do, do not add "-lpython" to the LDFLAGS, since if you do eventually get the module to link cleaning then it won't import correctly.  That's all I can think of right now.  Good luck! - MLD
>
> On Nov 8, 2010, at 11:59 PM, Faisal Moledina wrote:
>> I'm using f2py to compile a relatively simple example I found online
>> (at https://gist.github.com/226473). The relevant commands are
>>
>> f2py-2.6 -c -m deeming periodogram.f90 -lgomp
>> f2py-2.6 -c -m deemingomp periodogram.f90 --f90flags="-fopenmp " -lgomp
>>
>> I am using f2py installed using the py26-numpy port (py26-numpy
>> @1.5.0_1+atlas+gcc44 compiled yesterday). The error I'm getting is
>> attached, the main part being:
>>
>> /opt/local/bin/gfortran-mp-4.4 -Wall -L/opt/local/lib
>> /var/folders/eq/eqiWX9FuH+afuWb+TR7dCU+++TI/-Tmp-/tmprHTKyE/var/folders/eq/eqiWX9FuH+afuWb+TR7dCU+++TI/-Tmp-/tmprHTKyE/src.macosx-10.6-x86_64-2.6/deemingompmodule.o
>> /var/folders/eq/eqiWX9FuH+afuWb+TR7dCU+++TI/-Tmp-/tmprHTKyE/var/folders/eq/eqiWX9FuH+afuWb+TR7dCU+++TI/-Tmp-/tmprHTKyE/src.macosx-10.6-x86_64-2.6/fortranobject.o
>> /var/folders/eq/eqiWX9FuH+afuWb+TR7dCU+++TI/-Tmp-/tmprHTKyE/periodogram.o
>> -L/opt/local/lib/gcc44/gcc/x86_64-apple-darwin10/4.4.5 -lgomp
>> -lgfortran -o ./deemingomp.so
>> Undefined symbols:
>>  "_PyDict_New", referenced from:
>


More information about the macports-users mailing list