[ITK-users] Problems with the integration of LASPack package into ITK

Fotis Drakopoulos fdrakopo at gmail.com
Fri Jul 25 15:32:25 EDT 2014


Hi ITK developers,

I am working on the integration of the LASPack package (
http://www.netlib.org/linalg/) inside the ITK for solving for solving large
sparse systems of linear equations with iterative methods.
I created a new folder with name laspack under the directory :
Modules/ThirdParty/VNL/src/vxl/v3p/netlib/ with the following CMakeList.txt
:

*PROJECT( laspack )*

*# List sources for each library component.*
*SET(V3P_NETLIB_laspack_SOURCES*
*    eigenval.c*
*    errhandl.c*
*    factor.c*
*    itersolv.c*
*    matrix.c*
*    mlsolv.c*
*    operats.c*
*    precond.c*
*    qmatrix.c*
*    rtc.c*
*    vector.c*
*    eigenval.h*
*    elcmp.h*
*    errhandl.h*
*    factor.h*
*    itersolv.h*
*    lastypes.h*
*    matrix.h*
*    mlsolv.h*
*    operats.h*
*    precond.h*
*    qmatrix.h*
*    rtc.h*
*    vector.h*
*    version.h*
*    copyrght.h*
*    xc/getopts.c*
*    xc/xstring.c*
*    xc/getopts.h*
*    xc/version.h*
*    xc/xstring.h*
*    xc/xtypes.h*
*  )*

*# Create a library .*
*ADD_LIBRARY(itkv3p_laspack ${V3P_NETLIB_laspack_SOURCES})*
*IF(UNIX)*
*  TARGET_LINK_LIBRARIES( itkv3p_laspack m )*
*ENDIF(UNIX)*
*IF(ITK_LIBRARY_PROPERTIES)*
*  SET_TARGET_PROPERTIES(itkv3p_laspack PROPERTIES
${ITK_LIBRARY_PROPERTIES})*
*ENDIF(ITK_LIBRARY_PROPERTIES)*

*IF(NOT VXL_INSTALL_NO_LIBRARIES)*
*  INSTALL(TARGETS itkv3p_laspack*
*    EXPORT ${VXL_INSTALL_EXPORT_NAME}*
*    RUNTIME DESTINATION ${VXL_INSTALL_RUNTIME_DIR} COMPONENT
RuntimeLibraries*
*    LIBRARY DESTINATION ${VXL_INSTALL_LIBRARY_DIR} COMPONENT
RuntimeLibraries*
*    ARCHIVE DESTINATION ${VXL_INSTALL_ARCHIVE_DIR} COMPONENT Development)*
*ENDIF(NOT VXL_INSTALL_NO_LIBRARIES)*
*IF(NOT VXL_INSTALL_NO_DEVELOPMENT)*
*  INSTALL_NOBASE_HEADER_FILES(${VXL_INSTALL_INCLUDE_DIR}
${V3P_NETLIB_laspack_SOURCES})*
*ENDIF(NOT VXL_INSTALL_NO_DEVELOPMENT)*

Also in the CMakeLists.txt located in direcory : Modules/ThirdParty/VNL/src
I added the new *itkv3p_laspack* library as follows:

*add_subdirectory(vxl)*
*foreach(lib itkvcl itkv3p_netlib itkv3p_lsqr itkv3p_laspack itktestlib
itkvnl itkvnl_algo)*
*  itk_module_target(${lib} NO_INSTALL)*
*endforeach()*

When I build ITK I do not get any errors and the *libitkv3p_laspack. a*  is
normally created like all the other ITK libraries.
However when I compile an external project which links to ITK with
TARGET_LINK_LIBRARIES(PROJECT_NAME ${ITK_LIBRARIES}),   I am getting the
following link error:

*/home/fdrakopo/local/bin/ITKDev/release/lib/libitkvnl_algo-4.1.a(vnl_sparse_iterative_solver.cxx.o):
In function
`vnl_sparse_iterative_solver::vnl_sparse_iterative_solver(vnl_sparse_matrix<double>
const&)':*
*vnl_sparse_iterative_solver.cxx:(.text+0x6a): undefined reference to
`Q_SetName(QMatrixType*, char*)'*
*collect2: error: ld returned 1 exit status*
*make[2]: *** [PAPBNRR] Error 1*
*make[1]: *** [CMakeFiles/PAPBNRR.dir/all] Error 2*
*make: *** [all] Error 2*

The vnl_sparse_iterative_solver is a new class I created under :
Modules/ThirdParty/VNL/src/vxl/core/vnl/algo
and encapsulates the implemented calls (functions, etc.) to the LASPack
package (similarly to vnl_sparse_lu class that calls Kenneth's Kundert
SPARSE package).
Also the itkvnl_algo inks to itkv3p_laspack :
*TARGET_LINK_LIBRARIES( itkvnl_algo ${NETLIB_LIBRARIES} itkvnl itkv3p_lsqr
itkv3p_laspack ) *

Any ideas how can I solve the above link error?

Regards,
Fotis Drakopoulos
CRTC lab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140725/43b46566/attachment.html>


More information about the Insight-users mailing list