Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add detached vtkIECTransformLogic library to SlicerRT superbuild #254

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ferdymercury
Copy link
Contributor

@ferdymercury ferdymercury commented Sep 27, 2024

@cpinter
These commits were authored by @TrosnyogoSzakoca. I just tried rebasing it to current tip of master branch trying to fix merge conflicts due to the recent bugfixes by @MichaelColonel (thanks!!).

This should not be merged yet, as according to Mark, there are some problem with finding dlls in Windows (and on my side on Linux it runs well).

Comments/ideas are welcome.

Fixes EBATINCA/RadiotherapyTransformsIEC#19

This commit was authored by TrosnyogoSzakoca.
I just rebased it to current tip of master branch.

-Change existing code to use new library instead of vtkSlicerIECTransformLogic
-Delete old vtkSlicerIECTransformLogic
-Add new external cmake to superbuild folder
-Update CMakeLists
-Main problem: dll not found errors during SlicerRT startup
@MichaelColonel
Copy link
Collaborator

First thing first.
I think that a standalone library should be written for that, using CMake and VTK, as you suggested. For the start it can contain only one source file vtkIECTransformLogic.cxx and one header vtkIECTransformLogic.h. Then this library can be used in superbuild similar to Plastimatch libraries. IMHO.

@ferdymercury
Copy link
Contributor Author

First thing first. I think that a standalone library should be written for that, using CMake and VTK, as you suggested. For the start it can contain only one source file vtkIECTransformLogic.cxx and one header vtkIECTransformLogic.h. Then this library can be used in superbuild similar to Plastimatch libraries. IMHO.

It's already the case: https://github.com/EBATINCA/RadiotherapyTransformsIEC

(This merge request pulls the repo from there as a Superbuild, as you rightly suggest)

@MichaelColonel
Copy link
Collaborator

MichaelColonel commented Oct 12, 2024

I've tried to compile without SuperBuild and got some errors:
Both Plastimatch and vtkIECTransformLogic are included as external directories

cmake .. \
  -DSlicer_DIR=~/devel/git/Slicer/Slicer-SuperBuild-Release/Slicer-build/ \
  -DPlastimatch_DIR=~/devel/git/plastimatch/build-release/ \
  -DvtkIECTransformLogic_DIR=~/devel/git/RadiotherapyTransformsIEC/build-release/ \
  -DSlicerRT_SUPERBUILD:BOOL=OFF

CMake output:

CMake Error in Beams/Logic/CMakeLists.txt:
  Imported target "vtkIECTransformLogic" includes non-existent path

    "/home/user/devel/git/RadiotherapyTransformsIEC//home/user/devel/git/RadiotherapyTransformsIEC"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

Compilation output:

In file included from /home/user/devel/git/SlicerRT/Beams/Logic/vtkSlicerBeamsModuleLogic.cxx:22:
/home/user/devel/git/SlicerRT/Beams/Logic/vtkSlicerBeamsModuleLogic.h:34:10: fatal error: 
vtkIECTransformLogic.h: No such file or directory
   34 | #include <vtkIECTransformLogic.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~

Basically SlicerRT can't find non-existent include directory.

@ferdymercury
Copy link
Contributor Author

Thanks a lot for checking. I've just fixed the error in the include path. Could you git-pull the IEC repo and retry?

@ferdymercury ferdymercury marked this pull request as ready for review October 15, 2024 09:01
@MichaelColonel
Copy link
Collaborator

SuperBuild under Linux compiles and runs without errors.
There is a same error if both Plastimatch and vtkIECTransformLogic were included as external directories.

@ferdymercury
Copy link
Contributor Author

SuperBuild under Linux compiles and runs without errors. There is a same error if both Plastimatch and vtkIECTransformLogic were included as external directories.

You might need to erase the build directory of ~/devel/git/RadiotherapyTransformsIEC/build-release/, then git pull, and then rebuild from scratch. Then, the include error will be gone. (I see though some ITK linking errors).

@ferdymercury
Copy link
Contributor Author

Maybe @gregsharp knows the reason of the Plastimatch build errors when using SuperBuild=off

[  4%] Linking CXX shared library ../lib/Slicer-5.7/qt-loadable-modules/libvtkPlmCommon.so
cd /opt/SlicerRT_bld_off/PlmCommon && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/vtkPlmCommon.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC    -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2 -fdiagnostics-show-option -Wl,--no-undefined -fstack-protector-all -Wno-deprecated -Woverloaded-virtual -Wstrict-null-sentinel   -msse2 -Wall -Wno-deprecated  -g -shared -Wl,-soname,libvtkPlmCommon.so -o ../lib/Slicer-5.7/qt-loadable-modules/libvtkPlmCommon.so CMakeFiles/vtkPlmCommon.dir/PlmCommon.cxx.o   -L/opt/Slicer_bld/teem-build/bin  -L/opt/Slicer_bld/qRestAPI-build  -Wl,-rpath,/opt/Slicer_bld/teem-build/bin:/opt/Slicer_bld/qRestAPI-build:/opt/SlicerRT_bld_off/lib/Slicer-5.7/qt-loadable-modules:/opt/Slicer_bld/Slicer-build/bin:/opt/Slicer_bld/ITK-build/lib:/opt/Slicer_bld/LibArchive-install/lib:/opt/Slicer_bld/VTK-build/lib:/opt/Slicer_bld/DCMTK-build/lib:/usr/lib/x86_64-linux-gnu/hdf5/serial:/opt/Slicer_bld/tbb-install/lib/intel64/gcc4.8: ../lib/Slicer-5.7/qt-loadable-modules/libvtkSlicerRtCommon.so /opt/plastimatch-1.10.0/build/libplmsys.a /opt/plastimatch-1.10.0/build/libplmbase.a /opt/plastimatch-1.10.0/build/libdevillard.a /opt/plastimatch-1.10.0/build/libnkidecompress.a /opt/plastimatch-1.10.0/build/libplmutil.a /opt/plastimatch-1.10.0/build/libspecfun.a /opt/plastimatch-1.10.0/build/libplmdose.a /opt/plastimatch-1.10.0/build/liblbfgs.a /opt/plastimatch-1.10.0/build/libplmregister.a /opt/plastimatch-1.10.0/build/libplmreconstruct.a /opt/plastimatch-1.10.0/build/libplmsegment.a /opt/Slicer_bld/Slicer-build/bin/libMRMLCore.so /opt/Slicer_bld/Slicer-build/bin/libvtkAddon.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so /opt/Slicer_bld/Slicer-build/bin/libvtkITK.so /opt/Slicer_bld/ITK-build/lib/libitkGrowCut-5.4.so.1 /opt/Slicer_bld/Slicer-build/bin/libITKFactoryRegistration.so /opt/Slicer_bld/ITK-build/lib/libITKConvolution-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkMGHIO-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkIOScanco-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIODCMTK-5.4.so.1 /opt/Slicer_bld/LibArchive-install/lib/libarchive.so /opt/Slicer_bld/Slicer-build/bin/libvtkTeem.so /opt/Slicer_bld/teem-build/bin/libteem.so.1.12.0 /opt/Slicer_bld/Slicer-build/bin/libvtkSegmentationCore.so /opt/Slicer_bld/VTK-build/lib/libvtkFiltersFlowPaths-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkGUISupportQtSQL-9.2.so.9.2 /usr/lib/x86_64-linux-gnu/libQt5Sql.so.5.15.3 /opt/Slicer_bld/VTK-build/lib/libvtkRenderingQt-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkTestingRendering-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkViewsQt-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkGUISupportQt-9.2.so.9.2 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5.15.3 /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3 /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.3 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3 /opt/Slicer_bld/VTK-build/lib/libvtkViewsInfovis-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkWrappingTools-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkPythonInterpreter-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkPythonContext2D-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkRenderingLICOpenGL2-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOTecplotTable-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOMotionFX-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOMINC-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOInfovis-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtklibxml2-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOImport-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOIOSS-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkioss-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOExportPDF-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOExportGL2PS-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOExport-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkRenderingVtkJS-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkjsoncpp-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtklibharu-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkRenderingGL2PSOpenGL2-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkgl2ps-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkexodusII-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOChemistry-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOCesium3DTiles-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOCONVERGECFD-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIOAsynchronous-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkGeovisCore-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkViews-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkInfovisLayout-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkInteraction-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkImagingHybrid-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkFiltersPython-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkDomainsChemistryOpenGL2-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkOpenGL-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkglew-9.2.so.9.2 /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libXcursor.so /usr/lib/x86_64-linux-gnu/libXrender.so /usr/lib/x86_64-linux-gnu/libXfixes.so /opt/Slicer_bld/VTK-build/lib/libvtkRenderingHyperTreeGrid-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkRenderingUI-9.2.so.9.2 /usr/lib/x86_64-linux-gnu/libX11.so /opt/Slicer_bld/VTK-build/lib/libvtkDomainsChemistry-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkCommonPython-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkWrappingPythonCore3.9-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkChartsCore-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkInfovisCore-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkRendering-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkParallel-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkcgns-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkIO-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtktheora-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkogg-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtknetcdf-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkhdf5_hl-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkhdf5-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtklibproj-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkpng-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtksqlite-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkFiltersHybrid-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkexpat-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkdoubleconversion-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtklz4-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtklzma-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkDICOMParser-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkmetaio-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtktiff-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkjpeg-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkfreetype-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkzlib-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkImaging-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkFilters-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkfmt-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkverdict-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkCommon-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkpugixml-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtksys-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkloguru-9.2.so.9.2 /opt/Slicer_bld/VTK-build/lib/libvtkkissfft-9.2.so.9.2 /opt/plastimatch-1.10.0/build/libspecfun.a /opt/plastimatch-1.10.0/build/libplmregister.a /opt/plastimatch-1.10.0/build/libplmutil.a /opt/plastimatch-1.10.0/build/libplmbase.a /opt/plastimatch-1.10.0/build/libplmsys.a /opt/plastimatch-1.10.0/build/libnkidecompress.a /opt/plastimatch-1.10.0/build/libdevillard.a /usr/lib/x86_64-linux-gnu/libfftw3f.so /usr/lib/x86_64-linux-gnu/libfftw3.so /opt/plastimatch-1.10.0/build/liblbfgs.a /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.3.1 -litknetlib /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libjpeg.so -lznz -lniftiio /usr/lib/x86_64-linux-gnu/libpng.so -lITKBioCell /opt/Slicer_bld/DCMTK-build/lib/libi2d.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmjpeg.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libijg8.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libijg12.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libijg16.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmjpls.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmtkcharls.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libcmr.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmwlm.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmpstat.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmtls.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmsr.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmimage.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmdsig.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmqrdb.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmnet.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmrt.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmimgle.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmseg.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmtract.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmpmap.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmect.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmfg.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmiod.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libdcmdata.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/liboflog.so.16.3.6.6 /opt/Slicer_bld/DCMTK-build/lib/libofstd.so.16.3.6.6 -lnsl -lpthread /opt/Slicer_bld/ITK-build/lib/libITKDICOMParser-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKDeprecated-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOLSM-5.4.so.1 /usr/lib/x86_64-linux-gnu/libexpat.so -lITKFEM /opt/Slicer_bld/ITK-build/lib/libITKgiftiio-5.4.so.1 -lITKIOMesh /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/lib/x86_64-linux-gnu/libcurl.so /usr/lib/x86_64-linux-gnu/libpthread.a /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libdl.a /opt/Slicer_bld/ITK-build/lib/libITKIOBruker-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOCSV-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOHDF5-5.4.so.1 -lminc2 /usr/lib/x86_64-linux-gnu/libnetcdf.so /opt/Slicer_bld/ITK-build/lib/libITKIOMINC-5.4.so.1 -lrt /opt/Slicer_bld/ITK-build/lib/libITKIOMRC-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKOptimizersv4-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitklbfgs-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKReview-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOBMP-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOGDCM-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkgdcmMSFF-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkgdcmDICT-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkgdcmIOD-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkgdcmDSED-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkgdcmCommon-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOGIPL-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOJPEG-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOMeta-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKMetaIO-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIONIFTI-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKniftiio-5.4.so.1 -lm /opt/Slicer_bld/ITK-build/lib/libITKznz-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIONRRD-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKNrrdIO-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOPNG-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOTIFF-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitktiff-5.4.so.1 /opt/Slicer_bld/zlib-install/lib/libzlib.a /opt/Slicer_bld/ITK-build/lib/libitkjpeg-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOVTK-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKLabelMap-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKQuadEdgeMesh-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKPolynomials-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKBiasCorrection-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKFFT-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOBioRad-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOStimulate-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOSpatialObjects-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOXML-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKEXPAT-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOGE-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOSiemens-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOIPL-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOTransformHDF5-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOTransformInsightLegacy-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOTransformMatlab-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOTransformBase-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKTransformFactory-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKKLMRegionGrowing-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKVTK-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKWatersheds-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkopenjpeg-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKMathematicalMorphology-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKFastMarching-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKDeformableMesh-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKDiffusionTensorImage-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKMarkovRandomFieldsClassifiers-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKPDEDeformableRegistration-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKOptimizers-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKImageFeature-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKSmoothing-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKQuadEdgeMeshFiltering-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKRegionGrowing-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKStatistics-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkNetlibSlatec-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKSpatialObjects-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKMesh-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKTransform-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKPath-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKVideoIO-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKIOImageBase-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKVideoCore-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libITKCommon-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitksys-5.4.so.1 -ldl /opt/Slicer_bld/tbb-install/lib/intel64/gcc4.8/libtbb_debug.so.12 /opt/Slicer_bld/ITK-build/lib/libITKVNLInstantiation-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkvnl_algo-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkvnl-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkv3p_netlib-5.4.so.1 /opt/Slicer_bld/ITK-build/lib/libitkvcl-5.4.so.1 -lm -lm -Wl,-rpath-link,/opt/Slicer_bld/ITK-build/lib 
/usr/bin/ld: cannot find -litknetlib: No such file or directory
/usr/bin/ld: cannot find -lITKBioCell: No such file or directory
/usr/bin/ld: cannot find -lITKFEM: No such file or directory
/usr/bin/ld: cannot find -lITKIOMesh: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [PlmCommon/CMakeFiles/vtkPlmCommon.dir/build.make:153: lib/Slicer-5.7/qt-loadable-modules/libvtkPlmCommon.so] Error 1
make[2]: Leaving directory '/opt/SlicerRT_bld_off'
make[1]: *** [CMakeFiles/Makefile2:2731: PlmCommon/CMakeFiles/vtkPlmCommon.dir/all] Error 2
make[1]: Leaving directory '/opt/SlicerRT_bld_off'
make: *** [Makefile:166: all] Error 2

@MichaelColonel
Copy link
Collaborator

You might need to erase the build directory of ~/devel/git/RadiotherapyTransformsIEC/build-release/, then git pull, and then rebuild from scratch. Then, the include error will be gone. (I see though some ITK linking errors).

That works! After pull and rebuild, SlicerRT compiles and runs without errors.

@cpinter
Copy link
Member

cpinter commented Oct 16, 2024

Build works on Windows as well. The problem with finding the DLL is still there though. This is the error at startup. It seems the Beams module cannot locate the IEC dll.

[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerBeamsModule.dll: The specified module could not be found.
[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerDicomRtImportExportModule.dll: The specified module could not be found.
[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerDicomSroImportExportModule.dll: The specified module could not be found.
[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerDrrImageComputationModule.dll: The specified module could not be found.
[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerExternalBeamPlanningModule.dll: The specified module could not be found.
[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerPlmProtonDoseEngineModule.dll: The specified module could not be found.
[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerRoomsEyeViewModule.dll: The specified module could not be found.
DLL load failed while importing vtkSlicerBeamsModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerBeamsModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerBeamsModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDicomRtImportExportModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDicomRtImportExportModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDicomRtImportExportModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.
[Qt] When loading module  "BatchStructureSetConversion" , the dependency "DicomRtImportExport" failed to be loaded.
[Qt] When loading module  "IGRTWorkflow_SelfTest" , the dependency "DicomRtImportExport" failed to be loaded.

@ferdymercury
Copy link
Contributor Author

ferdymercury commented Oct 16, 2024

Thanks Csaba for checking. I don't have Windows, so it's hard for me to debug, but could you try adding:

  set_target_properties(${lib_name} PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Slicer_QTLOADABLEMODULES_BIN_DIR}"
    LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Slicer_QTLOADABLEMODULES_LIB_DIR}"
    ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Slicer_QTLOADABLEMODULES_LIB_DIR}"
    )

or

set_target_properties(${lib_name} PROPERTIES FOLDER ${MODULEVTKLIBRARY_FOLDER})

to see if things improve?

I copied that snippet from https://github.com/Slicer/Slicer/blob/main/CMake/SlicerMacroBuildModuleVTKLibrary.cmake#L125

so maybe another option would be to directly copy-paste that full CMake macro instead?

@cpinter
Copy link
Member

cpinter commented Oct 23, 2024

Neither option helped unfortunately. I printed the directory path and saw that the configuration was missing (DLL was inside a Release folder), so I tried to append /Release just for trying, but the DLLs were not found at runtime this way either. Unfortunately I don't know CMake well enough to solve this.

@ferdymercury
Copy link
Contributor Author

Thanks a lot Csaba for checking!

Last attempt: does it work if you specify this flag as the hard-coded path where the dlls are found?

https://cmake.org/cmake/help/latest/prop_tgt/BUILD_RPATH.html

@cpinter
Copy link
Member

cpinter commented Oct 29, 2024

Sorry @ferdymercury I'm extremely busy these days, and I have been postponing this because it seems I'd need to look into it in detail and it could take an hour or two. Do you happen to have a more concrete suggestion what to try? Then I can help in a more timely manner.

@ferdymercury
Copy link
Contributor Author

No hurries and thanks for the reply. I am sorry not to be a very good helping hand here, as I am no Windows expert.
I finally found a Windows machine and was able to install 3DSlicer. However I get an error when compiling SlicerRt concerning "ofstd" lib not found (link error) during the Plastimatch build step. So unless I figure out how to fix that, I cannot give any more detailed suggestion.
I did find this note about external modules (https://github.com/SlicerRt/SlicerRT/wiki/SlicerRt-developers-page#how-to-link-between-external-modules) by @jcfr and @pieper that specified that the file .s4ext had to be modified, but I do not know if this only applies to SuperBuild-Off builds and whether it helps here. Weird thing is though that it works perfectly well on Linux but not on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use this library from within SlicerRt
4 participants