View Issue Details

IDProjectCategoryView StatusLast Update
0004041Slicer4Core: Base Codepublic2018-03-02 11:07
Reporterfbudin Assigned Tojcfr  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in VersionSlicer 4.6.0 
Summary0004041: packaging issues on MacOS version (at least on r24523)
Description

When Slicer starts, I get the following error messages in the log:

Message 1:

Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSDemonWarpLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSDemonWarpLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSDemonWarpLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSDWICleanupLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSDWICleanupLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKCommon-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSDWICleanupLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSFitLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSFitLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKCommon-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSFitLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSLabelStatsLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSLabelStatsLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSLabelStatsLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSResampleLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSResampleLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSResampleLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSResizeLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSResizeLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSResizeLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSROIAutoLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSROIAutoLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSROIAutoLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSStripRotationLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSStripRotationLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSStripRotationLib.dylib
Reason: image not found)
Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSTransformConvertLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSTransformConvertLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libBRAINSTransformConvertLib.dylib
Reason: image not found)

Message 2:

Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libPerformMetricTestLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libPerformMetricTestLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKCommon-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libPerformMetricTestLib.dylib
Reason: image not found)

Message 3:

Error(s):
Cannot load library /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libVBRAINSDemonWarpLib.dylib: (dlopen(/Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libVBRAINSDemonWarpLib.dylib, 5): Library not loaded: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib
Referenced from: /Users/fbudin/Desktop/Slicer.app/Contents/lib/Slicer-4.4/cli-modules/libVBRAINSDemonWarpLib.dylib
Reason: image not found)

This concerns mostly the BRAINSTool libraries. To fix it, I had to manually fix the rpath in the libraries using the following script:

#!/bin/tcsh
set searchFor="Dashboards"
foreach myfile ($*)
echo "File: $myfile"
set myline=otool -l $myfile |grep $searchFor
foreach line ($myline)
if(echo $line |grep -c $searchFor > 0 ) then
set libname=$line:t
install_name_tool -change "$line" "@rpath/lib/Slicer-4.4/$libname" $myfile
endif
end
end

TagsNo tags attached.

Activities

fbudin

fbudin

2015-10-06 07:30

developer   ~0013339

I just realized that the libraries from BRAINS are packaged twice in Slicer for the MacOS package: once in ./Contents/lib/Slicer-4.4/cli-modules, and once in ./Contents/lib/Slicer-4.4.
I am not sure why this is the case, but the ones that are in ./Contents/lib/Slicer-4.4 are correctly patched to point to the libraries packaged in Slicer (eg: @rpath/lib/Slicer-4.4/libITKIOBMP-4.8.1.dylib), when the ones in ./Contents/lib/Slicer-4.4/cli-modules are not (eg: /Users/kitware/Dashboards/Nightly/Slicer-0-build/ITKv4-build/lib/libITKIOBMP-4.8.1.dylib)

jcfr

jcfr

2016-07-19 18:33

administrator   ~0014044

Fixed in r25241
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25241

Related Changesets

Import 2017-06-07 23:51:09: master 3fb107bc

2016-07-19 18:27:10

jcfr

Details Diff
COMP: BRAINSTools: Address MacOSX packaging issue. Fix 0004041

$ git shortlog 7859819..47dc8e6 --no-merges
Isaiah Norton (1):
COMP: Address MacOSX packaging issue.

The BRAINS CMAKE_OSX_RPATH default no longer matched the Slicer default [1].

Due to this setting, the RPATH for BRAINS libraries was not being
detected and replaced correctly by the Slicer fixup_bundle procedure.

Specifically, as far as I can tell, having a pre-set `@rpath` in the
installed libraries caused the fixup_bundle procedure to copy the
(fixed) libraries into the `Slicer-4.5` base directory, rather than
fixing in-place the libraries in `Slicer-4.5/cli-modules`. This caused
two copies of the libraries to be included in the distribution bundle
[2], one of which was un-patched. This un-patched version is referred
to by all *other* libraries, causing dlopen failures. The end result
is that BRAINS could not be used in shared-library mode on Mac [3].

See:
[1] https://github.com/Slicer/ITK/commit/8ac0d6013b76238f9d84de906c14b493addf8ac8
[2] http://www.na-mic.org/Bug/view.php?id=4041
[3] http://massmail.spl.harvard.edu/public-archives/slicer-users/2016/010782.html

From: Isaiah Norton <isaiah.norton@gmail.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25241 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild.cmake Diff File

Issue History

Date Modified Username Field Change
2015-09-09 07:15 fbudin New Issue
2015-09-09 07:15 fbudin Status new => assigned
2015-09-09 07:15 fbudin Assigned To => jcfr
2015-10-06 07:30 fbudin Note Added: 0013339
2016-07-19 18:33 jcfr Note Added: 0014044
2016-07-19 18:33 jcfr Status assigned => resolved
2016-07-19 18:33 jcfr Fixed in Version => Slicer 4.6.0
2016-07-19 18:33 jcfr Resolution open => fixed
2017-06-10 08:51 jcfr Changeset attached => Slicer master 3fb107bc
2018-03-02 11:07 jcfr Status resolved => closed