Menu

#52 Plplot 15.4.0 build fails on OpenSuse 15.1 Linux with ld error on libpython3.8.a

open
nobody
None
5
2021-04-03
2021-01-29
Walt Kailey
No

had to install version 5.14.0, because latest CMAKE available with OpenSuse 15.1 is 3.10.2, and there does not seem to be an upgrade path to 3.13.x. I need the Python bindings, and I have built and installed python 3.8.6 from source available at python.org. Swig is installed at /usr/share/swig/4.0.2, and the cmake step succeeds. After that, the make step fails with repeated messages that look like this

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libpython3.8.a(abstract.o): relocation R_X86_64_32S against symbol _Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libpython3.8.a(boolobject.o): relocation R_X86_64_32S against symbol_Py_FalseStruct' can not be used when making a shared object; recompile with -fPIC

And much more like that. The linker ld is complaining that you are trying to build a shared library using a static library that was not built with relocatable code, as near as I can understand the message.

After about twenty of these lovely messages, make bails with

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: [bindings/python/CMakeFiles/_plplotc.dir/build.make:108: bindings/python/_plplotc.so] Error 1
make[2]: Leaving directory '/usr/plplot/build_directory'
make[1]:
[CMakeFiles/Makefile2:1316: bindings/python/CMakeFiles/_plplotc.dir/all] Error 2
make[1]: Leaving directory '/usr/plplot/build_directory'
make: *** [Makefile:152: all] Error 2

Related

Support Requests: #52

Discussion

  • Alan W. Irwin

    Alan W. Irwin - 2021-01-29

    On 2021-01-29 00:25-0000 Walt Kailey wrote:

    [support-requests:#52] Plplot 15.4.0 build fails on OpenSuse 15.1 Linux with ld error on libpython3.8.a

    libpython3.8.a is a static library that clearly will not be compiled
    with the correct -fPIC flags required by the shared library version of
    PLplot. The linker preferentially searches for shared libraries named
    .so (i.e., libpython3.8.so in your case) and only falls back to the
    static
    .a form if it cannot find the *.so form. Therefore, it
    appears your system does not have the libpython3.8.so symlink to the
    shared python libraries installed. Ordinarily that symlink is available as
    part of the python development package so try installing that package
    to see if that fixes the problem.

     

    Related

    Support Requests: #52

  • Alan W. Irwin

    Alan W. Irwin - 2021-01-29

    Sorry. Now that I have read your message more carefully, I suspect you simply have not built
    or installed the shared version of the Python libraries that you need.

    So to fix this current issue, I recommend that you reconfigure your
    Python build so that the *.so symlink and corresponding Python shared
    library are installed and follow up by checking that the PLplot
    configuration actually finds that shared Python library that you
    have built.

     
  • Stefan Brüns

    Stefan Brüns - 2021-04-03

    Note openSUSE 15.1 has been EOLed for quite some time. Leap 15.2 and Leap 15.3 (currently in late Beta) both contain the latest released version of PLPlot, 5.15.0.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.