[CMake] Problem with shared libraries and python wrapping

Audrey Istace audrey.istace at imavie.fr
Tue Mar 24 06:08:59 EDT 2015


Hello,

I am trying to compile a VTK class (which uses itk), and would like to make a python wrapping for this class too.

I face two problems :


-        First, when I had the option < build_shared_libs > : OPTION(BUILD_SHARED_LIBS "Shared libraries." ON)
The Makefile is generated, but when I compile my project, I get the following error that I don't understand :
/usr/bin/ld: path/libitksys-4.8.a(SystemTools.cxx.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
Path/lib/libitksys-4.8.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status


-        My second problem happens with python wrapping. When I try enabling it in my CMakeLists : VTK_WRAP_PYTHON3(${MODULE_NAME} WrapSOURCES ${LIB_SOURCES})
The Makefile is not generated when I run CMake, and I get the following error : Unknown CMake command "VTK_WRAP_PYTHON3".
I compiled VTK (version 6.1) with the option PYTHON_WRAPPING ON.

Can someone help me with those problems please ?

Thank you,

Audrey

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150324/9b3c6239/attachment.html>


More information about the CMake mailing list