Issue to compile python module

24 views
Skip to first unread message

Thomas B

unread,
Oct 4, 2018, 2:44:29 AM10/4/18
to scikit-build
Hello

I have difficulties to deploy scikit-build on a project. I am able to compile the several share libraries. But at runtime I get missing symbol error.

git clone https//github.com/Thomasb81/hdlConvertor.git -b  devel2

python setup.py build -- -DANTLR_JAR_LOCATION=../../../antlr4/antlr-4.7.1-complete.jar -DCMAKE_BUILD_TYPE=Debug -- VERBOSE=1

The build script failed at install stage ... while I only ask to build:
error: package directory '_skbuild/linux-x86_64-2.7/cmake-install/hdlConvertor' does not exist

But what worry me is that my module is not ok.

inside dist directory:
python -c "import hdlConvertor"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /home/tom/prog/git/hdlConvertor/dist/libparseVhdl.so.1.0.0: undefined symbol: _ZTI6Symbol

Also the cmake option -DCMAKE_BUILD_TYPE=Debug does not have the expected result : the build system still compile in -O3 while I would expect to use -O0 -g

I do not understand at all what 's wrong with my setup.py and CMakelist.txt files.
Any help or guidance would be appreciate

I am working on Ubuntu 18.04
Python 2.7.15rc1
Cython 0.26.1
scikit-build 0.8.1

In an other branch I was able to port the project on cmake : git clone https//github.com/Thomasb81/hdlConvertor.git -b  devel
But the usual python build system with commodity to publish the module is not supported.

Thanks
Thomas

Jean-Christophe Fillion-Robin

unread,
Oct 4, 2018, 11:25:04 AM10/4/18
to thoma...@gmail.com, scikit-build
Hi Thomas,

Thanks for reaching out.

Attempting to reproduce the problem, it seems the branch "devel2" doesn't make sure of scikit-build and still reference. Would be able to share the branch using scikit-build ?


That said, if you want help to simplify your build system and leverage scikit-build, I should be able to help later this week.

Thanks
Jc

--
You received this message because you are subscribed to the Google Groups "scikit-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-build...@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scikit-build/e2c32118-bca7-4fd5-af23-8c132a99c602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Burg

unread,
Oct 4, 2018, 4:28:14 PM10/4/18
to jc...@kitware.com, scikit...@googlegroups.com
Hi Jean-Christophe,

I forget to push on the server. :(
It should be ok now. The setup file look to be compatible with scikit-build now.

Thanks for your help.
Thomas

Thomas Burg

unread,
Oct 6, 2018, 8:23:50 AM10/6/18
to jc...@kitware.com, scikit...@googlegroups.com
Hello

I dig a little bit my issue and finally point to a link issue.

With those lines in the CMakeLists.txt:
add_cython_target(hdlConvertor CXX)
add_library(hdlConvertor MODULE ${hdlConvertor} ${libhdlconvertor_SRC} ${generateParsers_GENERATED_SRC} )
add_dependencies(hdlConvertor generateParsers)
python_extension_module(hdlConvertor)

The link command to create hdlConvertor.so is generated with '--version-script' switch. That is restricting the externally viewed symbol.
I create hdlConvertor.so  libparsesv.so libparseVerilog.so libparseVhdl.so to reduce re-compilation time. Each libparse.*.so and hdlConvertor.so have both side dependencies.

If I try with
add_cython_target(hdlConvertor CXX)
add_library(hdlConvertor SHARE ${hdlConvertor} ${libhdlconvertor_SRC} ${generateParsers_GENERATED_SRC} )
add_dependencies(hdlConvertor generateParsers)
python_extension_module(hdlConvertor)

I do not anymore the '--version-script' switch on linker command line but it end up to create share library 'libdlConvertor.so' that is not anymore loadable with python import.

It look like my use case with my bundle of share libraries is not compatible with scikit-build.
Any suggestion is welcome.

Thomas

Reply all
Reply to author
Forward
0 new messages