Re: [f2py] Shared Object Failure

Marcel Loose <marcel.loose-RSh1/+X/PmFmR6Xm/[email protected]> Thu, 31 Jan 2013 23:35:44 +0100
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============0536560684937231219==
Content-Type: multipart/alternative;
 boundary="------------000802080301040407000006"

This is a multi-part message in MIME format.
--------------000802080301040407000006
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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.


--------------000802080301040407000006
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 text="#000000" bgcolor="#FFFFFF">
    <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&nbsp; --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.&nbsp; 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.&nbsp; 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 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>
    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>
  </body>
</html>

--------------000802080301040407000006--


--===============0536560684937231219==
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

--===============0536560684937231219==--