[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Help with package a library with python bindings



Hi,
I'm trying to package a library freesteam.
I'm moving their build system from scons to cmake to be able to build python bindings
for both python and python3.

I've managed to get cmake working
but I have trouble with swig generated python bindings.
More precisely:

dpkg-shlibdeps: warning: debian/python-freesteam/usr/lib/python2.7/dist-packages/_freesteam.x86_64-linux-gnu.so contains an unresolvable reference to symbol _Z19freesteam_region_pudd: it's probably a plugin

the missing symbols are actually in the libfreesteam.so  library build at the same time.
What shall I do to get _freesteal..so to get the symbols from plain libfreesteam.so?

Best
C

PS:
The CMakeLists.txt for the python bindings looks like this:

cmake_policy(SET CMP0078 OLD)

find_package(SWIG )
if (SWIG_FOUND)
  INCLUDE(${SWIG_USE_FILE})
  
  include_directories(${PYTHON_INCLUDE_DIRS})
  
  set(PYFREESTEAM_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages/)

  set (UseSWIG_TARGET_NAME_PREFERENCE LEGACY)
  set_property(SOURCE freesteam.i PROPERTY CPLUSPLUS ON)

  swig_add_library(freesteam TYPE SHARED LANGUAGE python SOURCES freesteam.i)

  swig_link_libraries(freesteam ${PYTHON_LIBRARIES} freesteam)
  install(TARGETS ${SWIG_MODULE_freesteam_REAL_NAME} DESTINATION ${PYFREESTEAM_INSTALL_DIR})
  install(FILES ${CMAKE_BINARY_DIR}/python/freesteam.py DESTINATION ${PYFREESTEAM_INSTALL_DIR})

endif()

and the debian/rules:

override_dh_auto_configure:
dh_auto_configure -Bbuild.python3 -- $(extra_flags) -DFREESTEAM_PYTHON_VERSION=3
dh_auto_configure -Bbuild.python2 -- $(extra_flags) -DFREESTEAM_PYTHON_VERSION=2.7

override_dh_auto_build:
dh_auto_build -Bbuild.python3
dh_auto_build -Bbuild.python2

override_dh_auto_install:
dh_auto_install -Bbuild.python3
dh_auto_install -Bbuild.python2
ldd debian/tmp/usr/lib/python*/dist-packages/_freesteam*.so

override_dh_auto_test:
dh_auto_test -Bbuild.python3
cd build.python3 && ./test
dh_auto_test -Bbuild.python2
cd build.python2 && ./test

override_dh_shlibdeps:
dh_makeshlibs
dh_shlibdeps -v

and d/control:

Source: freesteam
Section: contrib/science
Priority: extra
Maintainer: John Pye <john@curioussymbols.com>
Build-Depends: debhelper (>= 9), cmake, gcc (>= 4.3), swig, 
 libgsl-dev (>= 2.3+dfsg-1~),
 dh-python,
 python3-all-dev (>= 3.5~), 
 python-all-dev (>= 2.6.6-3~)
X-Python-Version: current
X-Python3-Version: >= 3.2
Standards-Version: 3.7.2
...
Package: python-freesteam
Architecture: any
Section: python
Depends: libfreesteam-dev (= ${binary:Version}), ${python:Depends}
Description:Steam properties calculation library (Python bindings)
...

Christophe TROPHIME
Research Engineer

    CNRS - LNCMI
25, rue des Martyrs
BP 166
38042 GRENOBLE Cedex 9
FRANCE    

Tel : +33 (0)4 76 88 90 02
Fax : +33 (0) 4 76 88 10 01
Office U 19
M@il : christophe.trophime@lncmi.cnrs.fr

Reply to: