<div dir="ltr">Hi ITK developers,<div><br></div><div>I am working on the integration of the LASPack package (<a href="http://www.netlib.org/linalg/">http://www.netlib.org/linalg/</a>) inside the ITK for solving for solving large sparse systems of linear equations with iterative methods.</div>
<div>I created a new folder with name laspack under the directory : Modules/ThirdParty/VNL/src/vxl/v3p/netlib/ with the following CMakeList.txt :</div><div><div><br></div><div><i>PROJECT( laspack )</i></div><div><i><br></i></div>
<div><i># List sources for each library component.</i></div><div><i>SET(V3P_NETLIB_laspack_SOURCES</i></div><div><i>    eigenval.c</i></div><div><i>    errhandl.c</i></div><div><i>    factor.c</i></div><div><i>    itersolv.c</i></div>
<div><i>    matrix.c</i></div><div><i>    mlsolv.c</i></div><div><i>    operats.c</i></div><div><i>    precond.c</i></div><div><i>    qmatrix.c</i></div><div><i>    rtc.c</i></div><div><i>    vector.c</i></div><div><i>    eigenval.h</i></div>
<div><i>    elcmp.h</i></div><div><i>    errhandl.h</i></div><div><i>    factor.h</i></div><div><i>    itersolv.h</i></div><div><i>    lastypes.h</i></div><div><i>    matrix.h</i></div><div><i>    mlsolv.h</i></div><div><i>    operats.h</i></div>
<div><i>    precond.h</i></div><div><i>    qmatrix.h</i></div><div><i>    rtc.h</i></div><div><i>    vector.h</i></div><div><i>    version.h</i></div><div><i>    copyrght.h</i></div><div><i>    xc/getopts.c</i></div><div>
<i>    xc/xstring.c</i></div><div><i>    xc/getopts.h</i></div><div><i>    xc/version.h</i></div><div><i>    xc/xstring.h</i></div><div><i>    xc/xtypes.h</i></div><div><i>  )</i></div><div><i><br></i></div><div><i># Create a library .</i></div>
<div><i>ADD_LIBRARY(itkv3p_laspack ${V3P_NETLIB_laspack_SOURCES})</i></div><div><i>IF(UNIX)</i></div><div><i>  TARGET_LINK_LIBRARIES( itkv3p_laspack m )</i></div><div><i>ENDIF(UNIX)</i></div><div><i>IF(ITK_LIBRARY_PROPERTIES)</i></div>
<div><i>  SET_TARGET_PROPERTIES(itkv3p_laspack PROPERTIES ${ITK_LIBRARY_PROPERTIES})</i></div><div><i>ENDIF(ITK_LIBRARY_PROPERTIES)</i></div><div><i><br></i></div><div><i>IF(NOT VXL_INSTALL_NO_LIBRARIES)</i></div><div><i>  INSTALL(TARGETS itkv3p_laspack</i></div>
<div><i>    EXPORT ${VXL_INSTALL_EXPORT_NAME}</i></div><div><i>    RUNTIME DESTINATION ${VXL_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries</i></div><div><i>    LIBRARY DESTINATION ${VXL_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries</i></div>
<div><i>    ARCHIVE DESTINATION ${VXL_INSTALL_ARCHIVE_DIR} COMPONENT Development)</i></div><div><i>ENDIF(NOT VXL_INSTALL_NO_LIBRARIES)</i></div><div><i>IF(NOT VXL_INSTALL_NO_DEVELOPMENT)</i></div><div><i>  INSTALL_NOBASE_HEADER_FILES(${VXL_INSTALL_INCLUDE_DIR} ${V3P_NETLIB_laspack_SOURCES})</i></div>
<div><i>ENDIF(NOT VXL_INSTALL_NO_DEVELOPMENT)</i></div></div><div><br></div><div>Also in the CMakeLists.txt located in direcory : Modules/ThirdParty/VNL/src I added the new <i><b>itkv3p_laspack</b></i> library as follows: </div>
<div><br></div><div><div><i>add_subdirectory(vxl)</i></div><div><i>foreach(lib itkvcl itkv3p_netlib itkv3p_lsqr <b>itkv3p_laspack</b> itktestlib itkvnl itkvnl_algo)</i></div><div><i>  itk_module_target(${lib} NO_INSTALL)</i></div>
<div><i>endforeach()</i></div></div><div><br></div><div>When I build ITK I do not get any errors and the <b><i>libitkv3p_laspack. a</i></b>  is normally created like all the other ITK libraries.</div><div>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:</div>
<div><br></div><div><i>/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&)':</i></div>
<div><i>vnl_sparse_iterative_solver.cxx:(.text+0x6a): undefined reference to `Q_SetName(QMatrixType*, char*)'</i></div><div><i>collect2: error: ld returned 1 exit status</i></div><div><i>make[2]: *** [PAPBNRR] Error 1</i></div>
<div><i>make[1]: *** [CMakeFiles/PAPBNRR.dir/all] Error 2</i></div><div><i>make: *** [all] Error 2</i></div><div> </div><div>The vnl_sparse_iterative_solver is a new class I created under : Modules/ThirdParty/VNL/src/vxl/core/vnl/algo </div>
<div>and encapsulates the implemented calls (functions, etc.) to the LASPack package (similarly to vnl_sparse_lu class that calls Kenneth's Kundert SPARSE package).</div><div>Also the itkvnl_algo inks to itkv3p_laspack :</div>
<div><i>TARGET_LINK_LIBRARIES( itkvnl_algo ${NETLIB_LIBRARIES} itkvnl itkv3p_lsqr <b>itkv3p_laspack</b> ) </i></div><div><br></div><div>Any ideas how can I solve the above link error?</div><div><br></div><div>Regards,</div>
<div>Fotis Drakopoulos</div><div>CRTC lab</div><div><br></div></div>