SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
124 stars 60 forks source link

SlicerRT Slicer extension is not working on mac #242

Closed fedorov closed 2 months ago

fedorov commented 3 months ago

As discussed in this thread https://discourse.slicer.org/t/failure-to-load-rtstruct-dicom-file/33504/5, it has been failing at least since Slicer 5.6.1.

Qt]   Error(s):
[Qt]     Cannot load library /Applications/Slicer-5.7.0-20240306.app/Contents/Extensions-32750/SlicerRT/lib/Slicer-5.7/qt-loadable-modules/libqSlicerBeamsModule.dylib: (dlopen(/Applications/Slicer-5.7.0-20240306.app/Contents/Extensions-32750/SlicerRT/lib/Slicer-5.7/qt-loadable-modules/libqSlicerBeamsModule.dylib, 0x0085): Library not loaded: @rpath/libomp.dylib
[Qt]   Referenced from: <8CC410E5-7FE3-33F6-BC6E-A68391968FE8> /Applications/Slicer-5.7.0-20240306.app/Contents/Extensions-32750/SlicerRT/lib/Slicer-5.7/qt-loadable-modules/libvtkSlicerBeamsModuleMRML.dylib
[Qt]   Reason: tried: '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/QuantitativeReporting/lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/SlicerDevelopmentToolbox/lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/IDCBrowser/lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/DCMQI/lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/DCMQI/lib/Slicer-5.7/cli-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/PETDICOMExtension/lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/PETDICOMExtension/lib/Slicer-5.7/cli-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/SlicerRT/lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/SlicerRT/lib/Slicer-5.7/cli-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../Extensions-32750/SlicerRT/lib/Slicer-5.7/qt-loadable-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../bin/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../lib/Slicer-5.7/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../lib/Slicer-5.7/cli-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../lib/Slicer-5.7/qt-loadable-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../../lib/Slicer-5.7/qt-loadable-modules/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../lib/Python/lib/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../lib/Python/lib/python3.9/site-packages/numpy/core/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/bin/../lib/Python/lib/python3.9/site-packages/numpy/lib/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/../lib/Slicer-5.7/qt-loadable-modules/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/Users/svc-dashboard/D/Support/clang+llvm-14.0.6-x86_64-apple-darwin/lib/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/Support/clang+llvm-14.0.6-x86_64-apple-darwin/lib/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/qRestAPI-build/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/Frameworks/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/Frameworks/QtCore.framework/Versions/5/Frameworks/libomp.dylib' (no such file), '/Applications/Slicer-5.7.0-20240306.app/Contents/MacOS/../libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/CTK-build/CMakeExternals/Install/lib/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/CTK-build/CMakeExternals/Install/lib/libomp.dylib' (no such file), '/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/svc-dashboard/D/P/A/teem-build/bin/libomp.dylib' (no such file), '/usr/local/lib/libomp.dylib' (no such file), '/usr/lib/libomp.dylib' (no such file, not in dyld cache))
cpinter commented 3 months ago

Thanks @fedorov for creating the ticket! This has been an issue for a long time now, and it would be important to fix this. Unfortunately we don't use Mac at all, and I don't even have one (nor the experience to work on such issues on Mac). Can we add the high priority label for this? It can be a blocking issue for Mac users not to be able to install certain extensions.

lassoan commented 3 months ago

One solution could be to get rid of OpenMP.

Recently the same problem came up in Elastix extension, and after consulting with Jc and Matt McCormick, the decision was to disable use of OpenMP, because it usually does not provide perceivable performance improvement and often causes packaging problems like this.

cpinter commented 3 months ago

In terms of SlicerRT, this will need to be consulted with @gregsharp . If we can remove OpenMP from the package without having much effect on the current modules, then it sounds like an acceptable solution.

kirbyju commented 2 months ago

I just ran into this same problem. Any updates?

lassoan commented 2 months ago

In which Slicer version? Latest stable and preview should work fine.

kirbyju commented 2 months ago

v5.6.2. Here's the error message:

image
lassoan commented 2 months ago

Could you please copy the application log here? Not screenshots, as they are not searchable and show only a tiny piece of the full log. Please also test with the latest Slicer Preview Release. Thank you!

cpinter commented 2 months ago

Latest stable and preview should work fine

@lassoan Are you sure? There has been no activity in SlicerRT since we discussed the issue on Mac, see above. Did I miss something?

kirbyju commented 2 months ago

Here's the full log from 5.6.2.
slicer-5.6.2-slicerRT-error.txt

lassoan commented 2 months ago

Thank you. It is indeed the same OpenMP issue and I did not remember correctly (I made the same workaround for SlicerElastix and not for SlicerRT). I've pushed a commit now to disable OpenMP in Plastimatch. @kirbyju please test tomorrow and close this issue if SlicerRT works. Thank you!

cpinter commented 2 months ago

Excellent, thank you so much Andras!

kirbyju commented 2 months ago

Works in latest preview, thanks.

Edit: I'm not seeing any option to let me close the issue.

fedorov commented 2 months ago

Thank you Andras and Justin! I have not tested, but I take Justin's word for it, and will close the issue!