Re: [f2py] Shared Object Failure
Kevin Manross <[email protected]> Thu, 31 Jan 2013 15:58:13 -0700
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============3991260114143107666== Content-Type: multipart/alternative; boundary="------------090908010109000005030706" This is a multi-part message in MIME format. --------------090908010109000005030706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Excellent tip! I'll dig around and see if I can find the dynamic library. Many thanks!!! -kevin. On 1/31/13 3:35 PM, Marcel Loose wrote: > Op 31-01-13 18:10, Kevin Manross schreef: >> >> Greetings, >> >> I am trying to wrap a FORTRAN library and am running into the >> following error: >> >> >> manross@yslogin3[BUFRTesting/BUFRLIB2PY] % set list1= ( *.f ) >> manross@yslogin3[BUFRTesting/BUFRLIB2PY] % f2py -c $list1 -m >> pybufrlib --f77flags="-fPIC" --f90flags="-fPIC" >> -L/glade/u/home/manross/BUFRTesting/BUFRLIB2PY -lbufr >> --fcompiler=intelem --compiler=intelem >> >> ... >> ... >> ... >> >> >> ld: >> /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a(abstract.o): relocation >> R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when >> making a shared object; recompile with -fPIC >> /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a: could not >> read symbols: Bad value >> ld: >> /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a(abstract.o): relocation >> R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when >> making a shared object; recompile with -fPIC >> /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a: could not >> read symbols: Bad value >> >> I have compiled the bufr library with -fPIC, included -fPIC as f77 >> and f90 flags in my f2py line. I (believe) I have even verified that >> the python and numpy installs used -fPIC >> >> BUILD_DIR/logs/DAVIDE.install.log:C compiler: icc -m64 -fPIC >> BUILD_DIR/numpy-1.6.2/DAVIDE.install.log:C compiler: icc -m64 -fPIC >> >> I am at a loss as to how to work through this error. I am on a >> 64-bit machine, FWIW. >> >> If anyone could shed some light on this, I would be much obliged! >> >> -kevin. >> >> >> >> -- >> Kevin Manross >> NCAR/CISL/Data Support Section >> Phone: (303)-497-1218 >> Email:[email protected] <mailto:[email protected]> >> Web:http://rda.ucar.edu >> >> >> _______________________________________________ >> f2py-users mailing list >> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] >> http://cens.ioc.ee/mailman/listinfo/f2py-users > Hi Kevin, > > You're linking against a static Python library, which is wrong. In > general, static libraries are not built with -fPIC. You should link > against the dynamic library libpython2.7.so, which must be installed > on your system somewhere. > > Cheers, > Marcel Loose. > > > > _______________________________________________ > f2py-users mailing list > f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] > http://cens.ioc.ee/mailman/listinfo/f2py-users -- Kevin Manross NCAR/CISL/Data Support Section Phone: (303)-497-1218 Email:[email protected] <mailto:[email protected]> Web:http://rda.ucar.edu --------------090908010109000005030706 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <br> Excellent tip! I'll dig around and see if I can find the dynamic library.<br> <br> Many thanks!!!<br> <br> -kevin.<br> <br> <div class="moz-cite-prefix">On 1/31/13 3:35 PM, Marcel Loose wrote:<br> </div> <blockquote cite="mid:510AF1C0.4070206-RSh1/+X/PmFmR6Xm/[email protected]" type="cite"> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <div class="moz-cite-prefix">Op 31-01-13 18:10, Kevin Manross schreef:<br> </div> <blockquote cite="mid:[email protected]" type="cite"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <br> Greetings,<br> <br> I am trying to wrap a FORTRAN library and am running into the following error:<br> <br> <br> manross@yslogin3[BUFRTesting/BUFRLIB2PY] % set list1= ( *.f )<br> manross@yslogin3[BUFRTesting/BUFRLIB2PY] % f2py -c $list1 -m pybufrlib --f77flags="-fPIC" --f90flags="-fPIC" -L/glade/u/home/manross/BUFRTesting/BUFRLIB2PY -lbufr --fcompiler=intelem --compiler=intelem<br> <br> ...<br> ...<br> ...<br> <br> <br> ld: /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC<br> /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a: could not read symbols: Bad value<br> ld: /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC<br> /glade/apps/opt/python/2.7.3/gnu/4.7.1/lib/libpython2.7.a: could not read symbols: Bad value<br> <br> I have compiled the bufr library with -fPIC, included -fPIC as f77 and f90 flags in my f2py line. I (believe) I have even verified that the python and numpy installs used -fPIC<br> <br> BUILD_DIR/logs/DAVIDE.install.log:C compiler: icc -m64 -fPIC<br> BUILD_DIR/numpy-1.6.2/DAVIDE.install.log:C compiler: icc -m64 -fPIC<br> <br> I am at a loss as to how to work through this error. I am on a 64-bit machine, FWIW.<br> <br> If anyone could shed some light on this, I would be much obliged!<br> <br> -kevin.<br> <br> <br> <br> <div class="moz-signature">-- <br> Kevin Manross<br> NCAR/CISL/Data Support Section<br> Phone: (303)-497-1218<br> Email:<a moz-do-not-send="true" href="mailto:[email protected]">[email protected]</a><br> Web:<a moz-do-not-send="true" href="http://rda.ucar.edu">http://rda.ucar.edu</a><br> </div> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ f2py-users mailing list <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]">f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://cens.ioc.ee/mailman/listinfo/f2py-users">http://cens.ioc.ee/mailman/listinfo/f2py-users</a> </pre> </blockquote> Hi Kevin,<br> <br> You're linking against a static Python library, which is wrong. In general, static libraries are not built with -fPIC. You should link against the dynamic library libpython2.7.so, which must be installed on your system somewhere.<br> <br> Cheers,<br> Marcel Loose.<br> <br> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ f2py-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]">f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]</a> <a class="moz-txt-link-freetext" href="http://cens.ioc.ee/mailman/listinfo/f2py-users">http://cens.ioc.ee/mailman/listinfo/f2py-users</a> </pre> </blockquote> <br> <div class="moz-signature">-- <br> Kevin Manross<br> NCAR/CISL/Data Support Section<br> Phone: (303)-497-1218<br> Email:<a href="mailto:[email protected]">[email protected]</a><br> Web:<a href="http://rda.ucar.edu">http://rda.ucar.edu</a><br> </div> </body> </html> --------------090908010109000005030706-- --===============3991260114143107666== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ f2py-users mailing list f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] http://cens.ioc.ee/mailman/listinfo/f2py-users --===============3991260114143107666==--