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:

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/;install
-- SimpleITK: 'install' step successfully completed.
[ 97%] Completed 'SimpleITK'
[ 97%] Built target SimpleITK
make: *** [all] Error 2

Here’s the complete output:

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



Thanks for the report.

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


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


Thanks @jcfr for looking into this.

I did:

git -C ../Slicer pull
brew uninstall doxygen
brew install doxygen
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


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


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


I think the export of my log was somehow wrong (I tried using tee). This time I just copied and pasted it:

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







I just ran make -j8, here’s the output:

Launcher settings


Everything looks fine, there is no system paths listed.


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

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/', needed by `lib/python2.7/lib-dynload/'.  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:

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 ?