import GDL fails in python (ImportError: dynamic module does not define init function (initGDL))

Bug #1665355 reported by luluprat
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnudatalanguage (Ubuntu)
Fix Committed
Undecided
Unassigned

Bug Description

after a fresh install ubuntu 16.10

apt-get install python-gdl gnudatalanguage
with no errors

i try:

python
Python 2.7.12+ (default, Sep 17 2016, 12:08:02)
[GCC 6.2.0 20160914] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named gdl
>>> import GDL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (initGDL)

how to fix it ?

thanks

Tags: bionic artful
tags: added: yakkety
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue and help making Ubuntu better.

I get the same error message when attempting to import GDL in python with version 0.9.7-2 on Ubuntu Zesty. I also tested on a Debian Sid vm, but the package seemed to be imported without any problems, so it looks like this might be an Ubuntu-only issue.

Changed in gnudatalanguage (Ubuntu):
status: New → Confirmed
tags: added: zesty
summary: - python-gdl
+ import GDL fails in python (ImportError: dynamic module does not define
+ init function (initGDL))
Revision history for this message
dino99 (9d9) wrote :

This is an unsupported release now. Please think to install the next LTS 'Bionic 18.04'

http://cdimage.ubuntu.com/ubuntu-next/daily-live/current/
https://www.omgubuntu.co.uk/2018/02/ubuntu-18-04-minimal-install-option

Changed in gnudatalanguage (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

dino99: 17.04 might have reached end of life, but this issue is still present and reproducible. I was just able to verify it with gnudatalanguage 0.9.7-6 on Ubuntu bionic, so setting this back to Confirmed.

Also, it seems a bit premature to recommend 18.04 which won't be released for another two months.

Changed in gnudatalanguage (Ubuntu):
status: Invalid → Confirmed
tags: added: artful bionic
removed: yakkety zesty
Revision history for this message
Ole Streicher (olebole) wrote :

I must say that this is mystic to me. When I do check the shared library, it looks weird:

$ file /usr/lib/python2.7/dist-packages/GDL.x86_64-linux-gnu.so
/usr/lib/python2.7/dist-packages/GDL.x86_64-linux-gnu.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=e26bdadb883325ace849f99998ce1fe326d6ddcb, stripped

$ ldd /usr/lib/python2.7/dist-packages/GDL.x86_64-linux-gnu.so
 statically linked

$ ls -l /usr/lib/python2.7/dist-packages/GDL.x86_64-linux-gnu.so
-rw-r--r-- 1 root root 5608 Oct 27 14:47 /usr/lib/python2.7/dist-packages/GDL.x8

I have no idea where this "statically linked" comes from. The linking call in the build log is the same as in Debian (reformatted; the one exception is marked):

/usr/bin/c++
    -fPIC -g -O2
    -fdebug-prefix-map=/<<PKGBUILDDIR>>=.
    -fstack-protector-strong
    -Wformat
    -Werror=format-security
    -DBUILD_DATE="\"Oct 27 2017\""
    -Wdate-time
    -D_FORTIFY_SOURCE=2
    -Wl,-Bsymbolic-functions # This one is only in the Ubuntu call
    -Wl,-z,relro
    -Wl,-z,now
    -shared
    -o GDL.x86_64-linux-gnu.so
    CMakeFiles/pythongdl.dir/pythongdl.cpp.o
    -L/usr/lib/x86_64-linux-gnu/hdf5/serial
    libgnudatalanguage.so.0
    -lantlr-pic
    -fopenmp
    -L/usr/lib/x86_64-linux-gnu
    -pthread
    -ldl
    -lncurses
    -lform
    -lreadline
    -lhistory
    -lz
    -lpng
    -lgsl
    -lgslcblas
    -lplplot
    -lplplotcxx
    -lGraphicsMagick
    -lGraphicsMagick++
    -lwx_baseu-3.0
    -lwx_gtk2u_core-3.0
    -lwx_gtk2u_adv-3.0
    -lnetcdf
    -lhdf5_hl
    -lhdf5
    -lpthread
    -lsz
    -lz
    -lm
    -lcurl
    -lmfhdfalt
    -ldfalt
    -ljpeg
    /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
    -lpthread
    -lsz
    -ldl
    -lncurses
    -lform
    -lreadline
    -lhistory
    -lz
    -lpng
    -lgsl
    -lgslcblas
    -lplplot
    -lplplotcxx
    -lGraphicsMagick
    -lGraphicsMagick++
    -lwx_baseu-3.0
    -lwx_gtk2u_core-3.0
    -lwx_gtk2u_adv-3.0
    -lnetcdf
    -lhdf5_hl
    -lhdf5
    -lpthread
    -lsz
    -lz
    -lm
    -lcurl
    -lmfhdfalt
    -ldfalt
    -ljpeg
    /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
    -lpthread
    -lsz
    -ldl
    -lm
    -lfftw3
    -lfftw3f
    -lpython2.7
    -ludunits2
    -lps
    -lgrib_api
    -lqhull
    -lSM
    -lICE
    -lX11
    -lXext

I have no idea why this produces an unusable shared library on Ubuntu.

Revision history for this message
Ole Streicher (olebole) wrote :

Finally, I think I found the cause (as the problem appeared on Debian as well): The object file pythongdl.cpp.o was empty, and all functions (including initGDL and PyInit) were called from the library (libgnudatalanguage0) linked to. On gcc-9 (and probably on Ubuntu's gcc), the "as-needed" flag is implicite in the linking step, which prevents unneded libraries from being linked. Therefore, the symbols can't befound anymore.

This is now solved in the Debian package.

Changed in gnudatalanguage (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Lenin (gagarin) wrote :

ole i guess this can be closed meanwhile?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.