tewarfel / wrapitk

Automatically exported from code.google.com/p/wrapitk
0 stars 0 forks source link

Compilation Error: Wrapitk with Python 2.7.1 on Ubuntu11 #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compiled the tools and libraries required for wrapitk
2. ccmake ../wrapitk
3. configure settings
4. sudo make install

Outputs:
[  0%] Built target install_wrapitk_compatibility
[  1%] Built target copy_python_files
[  1%] Built target copy_python_extras_files
[  1%] Built target ITKPyBaseIdx
[  1%] Built target ITKPyBaseSwig
[  1%] Built target ITKPyBasePython
[  2%] Built target VXLNumericsIdx
[  2%] Built target VXLNumericsSwig
Linking CXX shared module ../../lib/_VXLNumericsPython.so
/usr/bin/ld: 
/usr/local/lib/InsightToolkit/libitkvnl_inst.a(vnl_c_vector+short-.o): 
relocation R_X86_64_32 against `.bss' can not be used when making a shared 
object; recompile with -fPIC
/usr/local/lib/InsightToolkit/libitkvnl_inst.a: could not read symbols: Bad 
value
collect2: ld returned 1 exit status
make[2]: *** [lib/_VXLNumericsPython.so] Error 1
make[1]: *** [Libraries/VXLNumerics/CMakeFiles/VXLNumericsPython.dir/all] Error 
2
make: *** [all] Error 2

What is the expected output? What do you see instead?
Complete 100% compilation of Wrapitk

What version of the product are you using? On what operating system?
OS: Ubuntu11
Python 2.7.1

Please provide any additional information below.
Under configure settings (advanced mode), I added the option -fPIC to 
cmake_ccx_flags and still received the same error message.

It would be great if anyone has encountered this issue and solved it. Thanks!

Original issue reported on code.google.com by lsiy...@gmail.com on 2 Jun 2011 at 5:23

GoogleCodeExporter commented 9 years ago
it seems that you are not using the same architecture than the one used by your 
python.
You can use

  file /usr/bin/python

to know which architecture is used on your system, and force it in cmake by 
using the option -m32 or -m64 in CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.

Original comment by gaetan.l...@gmail.com on 6 Jun 2011 at 7:55

GoogleCodeExporter commented 9 years ago
I ran into a similar problem with a different file. I'm using CentOS 64 bit 
version, and I used file /usr/bin/python to check its build (64bit). I added 
-fPIC and -m64 to both CMAKE_CXX_FLAGS and CMAKE_C_FLAGS, but did not solve the 
problem.

..................................
[ 24%] Building CXX object 
Code/Numerics/FEM/CMakeFiles/ITKFEM.dir/itkFEMUtility.o
[ 24%] Building CXX object 
Code/Numerics/FEM/CMakeFiles/ITKFEM.dir/itkFEMInitialization.o
[ 24%] Building C object Code/Numerics/FEM/CMakeFiles/ITKFEM.dir/dsrc2c.o
Linking CXX shared library ../../../bin/libITKFEM.so
[ 24%] Built target ITKFEM
[ 24%] Built target install_wrapitk_compatibility
[ 24%] Generating swigrun.xml
[ 24%] Generating swigrunPython.cxx
Scanning dependencies of target SwigRuntimePython
[ 24%] Building CXX object 
Wrapping/WrapITK/SwigRuntime/CMakeFiles/SwigRuntimePython.dir/swigrunPython.o
Linking CXX shared library ../../../bin/libSwigRuntimePython.so
/usr/bin/ld: /home/lwei/software/lib/libpython2.7.a(abstract.o): relocation 
R_X86_64_32 against `a local symbol' can not be used when making a shared 
object; recompile with -fPIC
/home/lwei/software/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [bin/libSwigRuntimePython.so] Error 1
make[1]: *** 
[Wrapping/WrapITK/SwigRuntime/CMakeFiles/SwigRuntimePython.dir/all] Error 2
make: *** [all] Error 2

Original comment by smartn...@gmail.com on 19 Jul 2011 at 7:01