Some kind of linking error?

Issue #74 new
Greg Fleishman created an issue

Hello,

I was previously successful in building PyCA on my Mac, but am now building on a linux system. It compiles, but when I try to run the ROFTV.py example, I get an import error:

File "/groups/scicompsoft/home/fleishmang/bin/py2714/lib/python2.7/site-packages/PyCA/Core.py", line 22, in swig_import_helper _mod = imp.load_module('_Core', fp, pathname, description) ImportError: /groups/scicompsoft/home/fleishmang/bin/pyca/bin/libPyCA.so: undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE

I've tried compiling with both c++ and gcc, I get the same error in both cases, but I believe it's a different symbol that is undefined. Attached are screenshots of my ccmake configuration, would someone be willing to take a look and see if anything looks incorrect?

Comments (3)

  1. Greg Fleishman reporter

    Here is the ldd output:

    fleishmang@c11u25:bin> ldd ./libPyCA.so

    linux-vdso.so.1 =>  (0x00007ffead3cd000)
    libfftw3f.so.3 => /lib64/libfftw3f.so.3 (0x00002aca1de84000)
    libfftw3f_threads.so.3 => /lib64/libfftw3f_threads.so.3 (0x00002aca1e1fe000)
    libfftw3.so.3 => /lib64/libfftw3.so.3 (0x00002aca1e405000)
    libfftw3_threads.so.3 => /lib64/libfftw3_threads.so.3 (0x00002aca1e78a000)
    libm.so.6 => /lib64/libm.so.6 (0x00002aca1e992000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00002aca1ec94000)
    libgomp.so.1 => /lib64/libgomp.so.1 (0x00002aca1ee98000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aca1f0bf000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aca1f2d5000)
    libc.so.6 => /lib64/libc.so.6 (0x00002aca1f4f1000)
    /lib64/ld-linux-x86-64.so.2 (0x0000563c925d1000)
    
  2. Greg Fleishman reporter

    Resolved:

    My ITK library was built using CMake 2.8.12, which seems to compile several libraries with undefined symbols (e.g. https://discourse.itk.org/t/undefined-reference-to-vnl-vector-t-vnl-vector/291/5). Two options then:

    (1) Rebuild ITK (or in my case ANTs, which builds ITK in the process) using a newer version of CMake (previous link suggests 3.6.1 or higher), then try building PyCA against that

    (2) Ensure that the ITK lib file that actually does define these symbols appears last in the call to the linker. I did this (with the help of a very experienced builder) manually adding the appropriate lib (found using nm [all itk libs] | grep [my undefined symbol]) to the end of link.txt, which is somewhere in the CXX subdirectory of the build directory (after your run ccmake and configure).

    I did not test (1), but could be easier for some; (2) worked for me.

  3. Greg Fleishman reporter

    Update:

    I've now followed through with option (1) also, works. So just make sure PyCA is built against an ITK library that was built with CMake version 3.6.1 or higher.

  4. Log in to comment