Issue building Slicer with Qt installed using Homebrew: Symbol not found: __cg_jpeg_resync_to_restart

Hi all,

I’m trying to build Slicer on my macOS Sierra 10.12.6 with this configuration:

cmake -DCMAKE_BUILD_TYPE:STRING=Release -DQT_QMAKE_EXECUTABLE:FILEPATH=/usr/local/Cellar/qt@4/4.8.7_2/bin/qmake -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.12 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer
make -j8

But I get a build error (last 10 lines):

[100%] Built target SimpleITK
[ 96%] Performing install step for 'SimpleITK'
-- SimpleITK: Removing 'install' log files
-- SimpleITK: SimpleITK_WORKING_DIR: /Users/fernando/git/Slicer-SuperBuild-Release/SimpleITK-build/SimpleITK-build/Wrapping/Python
-- SimpleITK: /Users/fernando/git/Slicer-SuperBuild-Release/python-install/bin/SlicerPython;Packaging/setup.py;install
-- SimpleITK: 'install' step successfully completed.
[ 97%] Completed 'SimpleITK'
[ 97%] Built target SimpleITK
make: *** [all] Error 2

Here’s the complete output: https://www.dropbox.com/s/ankxbk4fx9n513w/build_log.txt.gz?dl=0

Do you know what can be wrong? Please let me know if you need any other details about my system or the build.

Thanks,
Fernando

Hi,

Thanks for the report.

Would it be possible to re-upload the complete log ? The provided link ends up with a 404 error.

Jc

Hi @jcfr,

Excuse me, I’ve edited my link. Can you try again?

Looking at the log, we can see the following errors:

-- Looking for decorator header ctkVisualizationVTKWidgetsPythonQtDecorators.h
-- Looking for decorator header ctkVisualizationVTKWidgetsPythonQtDecorators.h - Found
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
-- Looking for decorator header ctkQtTestingPythonQtDecorators.h
-- Looking for decorator header ctkQtTestingPythonQtDecorators.h - Not found
-- Found PythonLibs: /Users/fernando/git/Slicer-SuperBuild-Release/python-install/lib/libpython2.7.dylib (found version "2.7.13")
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
CMake Warning at /usr/local/Cellar/cmake/3.9.6/share/cmake/Modules/FindDoxygen.cmake:396 (message):
  Unable to determine doxygen version: Child aborted
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.6/share/cmake/Modules/FindDoxygen.cmake:551 (_Doxygen_find_doxygen)
  Documentation/CMakeLists.txt:1 (find_package)


dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
CMake Error at /usr/local/Cellar/cmake/3.9.6/share/cmake/Modules/FindDoxygen.cmake:630 (message):
  Unable to generate Doxyfile template: Child aborted
Call Stack (most recent call first):
  Documentation/CMakeLists.txt:1 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/fernando/git/Slicer-SuperBuild-Release/CTK-build/CTK-build/CMakeFiles/CMakeOutput.log".
See also "/Users/fernando/git/Slicer-SuperBuild-Release/CTK-build/CTK-build/CMakeFiles/CMakeError.log".

There are two issues:

  • (1) Doxygen: Unable to generate Doxyfile template: Child aborted
  • (2) Symbol not found: __cg_jpeg_resync_to_restart

The issue (1) should be easy to address by fixing the install of Doxygen.

For the issue (2), it is discussed in https://issues.slicer.org/view.php?id=3574 and was fixed.

The known workaround was to specify -DSlicer_USE_SYSTEM_QT:BOOL=1, then a fix was implemented in r26193.

The problem is that the fix didn’t account for path starting with /usr/local/Cellar, this is now fixed in master.

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26646

Thanks @jcfr for looking into this.

I did:

git -C ../Slicer pull
brew uninstall doxygen
brew install doxygen
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DQT_QMAKE_EXECUTABLE:FILEPATH=/usr/local/Cellar/qt@4/4.8.7_2/bin/qmake -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.12 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer
make -j8

But the build was unsuccessful again. I couldn’t find “doxygen” or “__cg_jpeg_resync_to_restart” in log: Dropbox link to log

Hi Fernando,

Look like you didn’t do a clean build. I suggest you first delete the build
tree.

Hth
Jc

Do you mean removing everything from my Slicer-SuperBuild-Release dir before configuring and building? I just tried that with no luck.

Hi,

Look like there is no errors in the last log. What make you think it failed ? Is the log complete ?

Jc

I think the export of my log was somehow wrong (I tried using tee). This time I just copied and pasted it: https://www.dropbox.com/s/o0teidq8nvckanf/build_log.txt.gz?dl=0

The doxygen and __cg_jpeg_resync_to_restart errors are still present.

What can I do? Maybe install Doxygen and Qt4 in a different way?

It would be helpful if could narrow down which project is failing.

Only typing make will now stop to the first project having issue.

It looks like there is still some clash between system and brew libraries.

Could you also:

  • check what is the content of python-install/bin/SlicerPythonLauncherSettings.ini ?

  • comment out CMake code trying to find and use Doxygen. Look like there is issues with the one shipped by brew.

What do you mean? Can I narrow the search if I run make again in from the same folder?

I wouldn’t know where to start commenting CMake code, I don’t know almost anything about it. Would it help if I install Doxygen in a different way?

 Slicer-SuperBuild-Release  cat python-install/bin/SlicerPythonLauncherSettings.ini
[General]
launcherNoSplashScreen=true
launcherSplashImagePath=
launcherSplashScreenHideDelayMs=
additionalLauncherHelpShortArgument=
additionalLauncherHelpLongArgument=
additionalLauncherNoSplashArguments=
additionalPathVariables=PYTHONPATH



[Application]
path=<APPLAUNCHER_DIR>//python
arguments=
name=SlicerPython
revision=
organizationDomain=
organizationName=

[ExtraApplicationToLaunch]


[LibraryPaths]
1\path=/Users/fernando/git/Slicer-SuperBuild-Release/python-install/lib
2\path=/Users/fernando/git/Slicer-SuperBuild-Release/OpenSSL
size=2

[Paths]
1\path=<APPLAUNCHER_DIR>
size=1

[EnvironmentVariables]
PYTHONHOME=/Users/fernando/git/Slicer-SuperBuild-Release/python-install
PYTHONNOUSERSITE=1
SSL_CERT_FILE=<APPLAUNCHER_DIR>/../../Slicer-build/share/Slicer-4.9/Slicer.crt



[PYTHONPATH]
1\path=/Users/fernando/git/Slicer-SuperBuild-Release/python-install/lib/python2.7
2\path=/Users/fernando/git/Slicer-SuperBuild-Release/python-install/lib/python2.7/lib-dynload
3\path=/Users/fernando/git/Slicer-SuperBuild-Release/python-install/lib/python2.7/site-packages
size=3

I just ran make -j8, here’s the output: https://gist.github.com/fepegar/a6a2e7b4395fb081b5ac24c3a94e7619

Launcher settings

python-install/bin/SlicerPythonLauncherSettings.ini

Everything looks fine, there is no system paths listed.

Doxygen

I have no idea, I am not familiar with brew.

Slicer r26653 introduces the option Slicer_BUILD_DOCUMENTATION, consider updating your source checkout and configuring with -DSlicer_BUILD_DOCUMENTATION:BOOL=OFF

Single process make to find out cause of failure

By simply running make I meant that you should run a single process make.

From the top level directory, try:

cd Slicer-SuperBuild
make

instead of

cd Slicer-SuperBuild
make -j<number>

Doing so ensure the build process fails at the first error.

When you know which target is faulty, it is useful to do:

make NameOfTarget/fast VERBOSE=1

this will give a lot more details

When I run make, the last lines of the output are:

[ 13%] Performing build step for 'python'
[  0%] Built target extension_array
[  1%] Built target extension_audioop
[  1%] Built target extension_bisect
[  2%] Built target extension_cmath
[  2%] Built target extension_codecs_cn
[  3%] Built target extension_codecs_hk
[  4%] Built target extension_codecs_iso2022
[  5%] Built target extension_codecs_jp
[  5%] Built target extension_codecs_kr
[  6%] Built target extension_codecs_tw
[  7%] Built target extension_cPickle
[  8%] Built target extension_cStringIO
[  9%] Built target extension_csv
[  9%] Built target extension_ctypes_test
[  9%] Built target extension_functools
[ 10%] Built target extension_future_builtins
[ 10%] Built target extension_heapq
[ 11%] Built target extension_hotshot
[ 12%] Built target extension_itertools
[ 13%] Built target extension_json
[ 13%] Built target extension_locale
[ 14%] Built target extension_lsprof
[ 15%] Built target extension_math
[ 16%] Built target extension_mmap
[ 17%] Built target extension_multibytecodec
[ 18%] Built target extension_operator
[ 19%] Built target extension_parser
[ 19%] Built target extension_random
[ 20%] Built target extension_strop
[ 20%] Built target extension_struct
[ 21%] Built target extension_testcapi
[ 21%] Built target extension_unicodedata
[ 22%] Built target extension_fcntl
[ 23%] Built target extension_grp
[ 24%] Built target extension_resource
[ 25%] Built target extension_syslog
[ 26%] Built target extension_termios
make[5]: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/SystemConfiguration.framework', needed by `lib/python2.7/lib-dynload/_scproxy.so'.  Stop.
make[4]: *** [CMakeBuild/extensions/extension_scproxy/CMakeFiles/extension_scproxy.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [python-prefix/src/python-stamp/python-build] Error 2
make[1]: *** [CMakeFiles/python.dir/all] Error 2
make: *** [all] Error 2

So I ran make python/fast VERBOSE=1 and got this: https://gist.github.com/fepegar/a6a2e7b4395fb081b5ac24c3a94e7619

Thanks for the details.

Since I am travelling until Sunday, unless someone else help you out. I
will have a look next week.

Does this path exist? Note that the SDK and the OS version can be different, and Apple updater may have automatically moved you up to 10.13 SDK (this happened to me, things broke, and I manually rolled back – haven’t dared to try again yet).

Hi @ihnorton,

I think that has happened to me as well. How did you roll back?

I think the issue I hit has been fixed because I know some other Mac users
have upgraded — I didn’t want the hours of rebuilding. So try setting the
sdk target to 10.13 first. I don’t have the rollback steps I used at hand,
but will try to find again.

@ihnorton Thanks for your input

@Fernando Was the issue finally resolved ?