MacOS Sierra (10.12.6) dynamic linker errors

Hey guys,

I’m running into some dynamic linker errors on startup with master built on 10.12.6:

dlopen(/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerCropVolumeModuleLogicPython.so, 2): no suitable image found.  Did find:
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./vtkSlicerCropVolumeModuleLogicPython.so: malformed mach-o: load commands size (32872) > 32768
/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerCropVolumeModuleLogicPython.so: malformed mach-o: load commands size (32872) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerCropVolumeModuleLogicPython.so: malformed mach-o: load commands size (32872) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerCropVolumeModuleLogicPython.so: malformed mach-o: load commands size (32872) > 32768
dlopen(/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerSegmentationsModuleLogicPython.so, 2): Library not loaded: /Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerSegmentationsModuleLogicPythonD.dylib
  Referenced from: /Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./vtkSlicerSegmentationsModuleLogicPython.so
  Reason: no suitable image found.  Did find:
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./libvtkSlicerSegmentationsModuleLogicPythonD.dylib: malformed mach-o: load commands size (33048) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerSegmentationsModuleLogicPythonD.dylib: malformed mach-o: load commands size (33048) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerSegmentationsModuleLogicPythonD.dylib: malformed mach-o: load commands size (33048) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerSegmentationsModuleLogicPythonD.dylib: malformed mach-o: load commands size (33048) > 32768
dlopen(/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerAnnotationsModuleMRMLDisplayableManagerPython.so, 2): Library not loaded: /Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerAnnotationsModuleMRMLDisplayableManagerPythonD.dylib
  Referenced from: /Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./vtkSlicerAnnotationsModuleMRMLDisplayableManagerPython.so
  Reason: no suitable image found.  Did find:
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./libvtkSlicerAnnotationsModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33080) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerAnnotationsModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33080) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerAnnotationsModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33080) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerAnnotationsModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33080) > 32768
dlopen(/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerMarkupsModuleMRMLDisplayableManagerPython.so, 2): no suitable image found.  Did find:
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./vtkSlicerMarkupsModuleMRMLDisplayableManagerPython.so: malformed mach-o: load commands size (32904) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerMarkupsModuleMRMLDisplayableManagerPython.so: malformed mach-o: load commands size (32904) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerMarkupsModuleMRMLDisplayableManagerPython.so: malformed mach-o: load commands size (32904) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerMarkupsModuleMRMLDisplayableManagerPython.so: malformed mach-o: load commands size (32904) > 32768
dlopen(/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/vtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPython.so, 2): Library not loaded: /Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPythonD.dylib
  Referenced from: /Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./vtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPython.so
  Reason: no suitable image found.  Did find:
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/./libvtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33024) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33024) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33024) > 32768
	/Users/hherhold/Development/slicer/build-qt5/Slicer-build/lib/Slicer-4.9/qt-loadable-modules/libvtkSlicerVolumeRenderingModuleMRMLDisplayableManagerPythonD.dylib: malformed mach-o: load commands size (33024) > 32768

A while back (May 2017)? I saw a post talking a bit about this, and it sounded like it had something to do with the behavior of the linker being different in 10.12 vs 10.11, and either the symbol table didn’t look right or the pathnames to libraries are too long. (Not sure on either of these.)

Has anybody else run into this? It’s become a bit of a problem with local builds - things like logical operators in the Segmentation Editor fail because it can’t get the segmentations module logic when checking if bypass masking is set. (My guess is because it can’t load the .so that contains the logic, but I’m totally guessinng here.)

Any ideas?

Thanks in advance!!!

-Hollister

This was the post that talked about it:

I’m doing a build right now with a shorter path - we will see if that fixes it?

OK, building in a directory tree with shorter initial pathnames seems to fix it. Annoying, but it works.

Don’t worry, it’s not just a Mac thing. Long base directory path breaks the build on all operating systems.

I just built Slicer for the first time, and I get the same errors when I run it. I built Slicer in the directory /Users/michaelschumaker/Packages. How short does the initial pathname need to be?

FWIW, I use /opt/bld/s5nj and /opt/bld/r/r5nj.

1 Like