[CMake] Problem with shared libraries and python wrapping

Bill Hoffman bill.hoffman at kitware.com
Tue Mar 24 14:17:31 EDT 2015


On 3/24/2015 6:08 AM, Audrey Istace wrote:
> 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
>
ITK needs to be built shared as well.

> 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 ?
>
This is a question for the VTK mailing list.  But, "VTK_WRAP_PYTHON3" is 
a macro provided by VTK.  You would need to include that macro to use it.


-Bill



More information about the CMake mailing list