Skip to content

ENH: Add detached vtkIECTransformLogic library to SlicerRT superbuild #254

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

Merged
merged 1 commit into from
Nov 26, 2024
Merged

ENH: Add detached vtkIECTransformLogic library to SlicerRT superbuild #254

merged 1 commit into from
Nov 26, 2024

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

@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.

@cpinter
Copy link
Member

cpinter commented Nov 21, 2024

I tried this after your latest commit, and the issue is the same as before, some DLLs are not found.

However I get an error when compiling SlicerRt concerning "ofstd" lib not found (link error) during the Plastimatch build step.

This is now fixed, so if you update Slicer and SlicerRT, and do a clean build, then it will work.

We've had some really crazy weeks, but the grants were submitted yesterday. If you have something I can test then happy to do it.

@ferdymercury
Copy link
Contributor Author

ferdymercury commented Nov 21, 2024

Hi Csaba, thanks for the reply.
I just did a clean re-build on Windows and now it builds fine and it also runs fine (SlicerWithSlicerRt.exe). I have no warning about the DLLs not being found. I tried loading RoomsEyeView and rotating, and it seems to work. I just get an annoying warning about the ImagingPanel not defined so assuming LPS or sth like that. What is your exact build command?
I compiled it directly from terminal, not from the sln.

@ferdymercury
Copy link
Contributor Author

ferdymercury commented Nov 21, 2024

I did this:

C:\Qt\Tools\CMake_64\bin\cmake.exe -G "Visual Studio 17 2022" -A x64 -Qt5_DIR:PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5 -S C:\Users\Name\Slicer_src -B C:\Users\Name\Slicer_bld
C:\Qt\Tools\CMake_64\bin\cmake.exe --build C:\Users\Name\Slicer_bld --config Release
C:\Qt\Tools\CMake_64\bin\cmake.exe -G "Visual Studio 17 2022" -A x64 -Qt5_DIR:PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5 -S C:\Users\Name\SlicerRT_src -B C:\Users\Name\SlicerRT_bld -DCMAKE_BUILD_TYPE:STRING=Release -DSlicer_DIR:PATH=C:\Users\Name\Slicer_bld\Slicer-build
C:\Qt\Tools\CMake_64\bin\cmake.exe --build C:\Users\Name\SlicerRT_bld --config Release
C:\Users\Name\SlicerRT_bld\inner-build\SlicerWithSlicerRT.exe

ProcessMRMLEvents: Invalid MRML scene
Switch to module:  "Welcome"
Switch to module:  "RoomsEyeView"
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/Collimator.stl does not contain coordinate system information. Assuming LPS.
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/Gantry.stl does not contain coordinate system information. Assuming LPS.
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/PatientSupport.stl does not contain coordinate system information. Assuming LPS.
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/TableTop.stl does not contain coordinate system information. Assuming LPS.
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/LinacBody.stl does not contain coordinate system information. Assuming LPS.
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/ImagingPanelLeft.stl does not contain coordinate system information. Assuming LPS.
ReadDataInternal ((unknown)): File C:/Users/Name/SlicerRT_bld/inner-build/share/Slicer-5.7/qt-loadable-modules/RoomsEyeView/VarianTrueBeamSTx/ImagingPanelRight.stl does not contain coordinate system information. Assuming LPS.

@cpinter
Copy link
Member

cpinter commented Nov 21, 2024

You're right! Using that executable it works for me as well. OK then this is just the same "superbuild syndrome" as with other extensions (like SlicerVR, SlicerVMTK, SlicerIGSIO, etc.). I use many extensions at the same time, so I cannot use executables like SlicerWithSlicerRt.exe, instead I need to add all the binary folders that are needed. And sometimes some DLLs need to be copied. Thanks a lot for investigating! I'll get back after some more testing.

Copy link
Member

@cpinter cpinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR seems good to me! Just three little comments. And please squash the two commits.

Thank you so much for finishing this @ferdymercury ! Sorry for us the whole November has been really crazy (actually from mid-October). Thanks again for your patience and persistence.

@cpinter
Copy link
Member

cpinter commented Nov 22, 2024

@ferdymercury Copying the DLL (SlicerRT_R\bin\Release\vtkIECTransformLogic.dll) on windows to a folder that is included in the additional module directories (such as qt-loadable-modules\Release) fixes the issue, which is acceptable for development.
However, I tried making a package, and the vtkIECTransformLogic.dll is not included. This means that the factory-generated package of SlicerRT will not work on Windows. In case you don't know, in Linux packaging can be triggered by make package in the inner-build folder (if I remember correctly) and on Windows it is done by building the SlicerRT_R\inner-build\PACKAGE.vcxproj project.

Since this is almost the same structure as for the SlicerIGSIO extension (that some superbuild DLLs are created in SlicerRT_R\bin\Release\vtkIECTransformLogic.dll and SlicerIGSIO_R\bin\Release\vtkIGSIOCommon.dll), I'd expect the same packaging. I just packaged SlicerIGSIO and it has this third bin folder in the package zip besides the usual lib and share folders:
image
While in the SlicerRT package there are only the lib and share. I would look at the install steps in the CMake files of SlicerIGSIO to see how these DLLs are deployed correctly (https://github.com/IGSIO/SlicerIGSIO).

Update: These lines are my first suspects. Maybe adding something like this to the bottom of the main CMakeLists.txt file would help
https://github.com/IGSIO/SlicerIGSIO/blob/master/CMakeLists.txt#L75-L79
I cannot try this now, maybe next week. If you can give a try I appreciate the help! Thanks again!

@ferdymercury
Copy link
Contributor Author

ferdymercury commented Nov 22, 2024

However, I tried making a package, and the vtkIECTransformLogic.dll is not included.

Thanks for checking!

However, to me, the question is more: ¿are the Plastimatch.dll included in that folder "bin" you mention? Because we are following their Superbuild.cmake structure, IGSIO is different in the sense that it directly depends on Slicer from the very beginning.
Thus, I think we should try to find 'suspect CPack' lines in the Plastimatch CMakeLists.txt that is more analogous to vktIEC lib.

This seems related: https://gitlab.com/plastimatch/plastimatch/-/commit/992b95721d30a4220ee80800f97636556c2700e3

So maybe we could try:
install (FILES vtkIECTransformLogic.dll DESTINATION bin)

@cpinter
Copy link
Member

cpinter commented Nov 22, 2024

I think Plastimatch is statically built into the DLLs of different modules.

@cpinter
Copy link
Member

cpinter commented Nov 25, 2024

It seems that if I use the very same structure as in SlicerIGSIO then the install step is correct. This is the end of the main CMake file after the changes.

#-----------------------------------------------------------------------------
set(EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS)
list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${vtkIECTransformLogic_DIR};vtkIECTransformLogic;RuntimeLibraries;/")
set(${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS "${EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS}" CACHE STRING "List of external projects to install" FORCE)
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS}")

include(${Slicer_EXTENSION_GENERATE_CONFIG})
include(${Slicer_EXTENSION_CPACK})

I'm doing a clean build too and I'll give an update if there are any issues. Otherwise I think this could be used.

@ferdymercury
Copy link
Contributor Author

ferdymercury commented Nov 25, 2024

Amazing, thanks for finding out. The only thing is that we should put this within an "ifdef" clause, something like if (SLICER_DEFINED)
so that this library can be reused by other projects that do not depend on slicer.
Otherwise it would give there an error when calling an undefined variable such as ${Slicer_EXTENSION_GENERATE_CONFIG}

@cpinter
Copy link
Member

cpinter commented Nov 25, 2024

This change is in the main CMake file of SlicerRT, so there is always Slicer.

In the meantime the clean build succeeded, and the extension install also worked.

Can you add this change to SlicerRT/CMakeLists.txt please? It's simpler if everything stays in this PR. Thanks!

@ferdymercury
Copy link
Contributor Author

Ohh, thanks, I thought you meant in the CMake file of the IEC library. Ok, I will do it.

@ferdymercury ferdymercury requested a review from cpinter November 25, 2024 12:13
Copy link
Member

@cpinter cpinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two extra lines to delete. Please squash the commits and ready to go. Thank you so much!

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

FIX: remove debug comment

FIX: try to mimick exactly the Plastimatch cmake structure

FIX: require package in every submodule, as done with plastimatch

FIX: make package was missing the external library vtkIEC

Commit by cpinter. Inspired from IGSIO library.
@ferdymercury
Copy link
Contributor Author

Just two extra lines to delete. Please squash the commits and ready to go. Thank you so much!

Done! Thanks a lot to you two, you did an amazing job and the outcome is really great.

@ferdymercury ferdymercury requested a review from cpinter November 26, 2024 11:20
@cpinter cpinter merged commit 1913d09 into SlicerRt:master Nov 26, 2024
@cpinter
Copy link
Member

cpinter commented Nov 26, 2024

Merged! Crossing fingers so that it works on MacOS too, and that there are no other issues either.

@ferdymercury ferdymercury deleted the detached-iec branch November 26, 2024 12:32
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