Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.68k stars 307 forks source link

m1 compilation fails following brew upgrade #6270

Closed nomar500 closed 3 years ago

nomar500 commented 3 years ago

I can't manage to build RT, and I figure it's related to a recently package upgraded through brew.

#!/bin/bash

mkdir -p build 
cd build
pwd
#sudo rm -r *

which brew || exit 2

eval $(/opt/homebrew/bin/brew shellenv)

cmake --log-level=VERBOSE --log-context -DCMAKE_BUILD_TYPE="Release" \
      -DLOCAL_PREFIX="$(brew --prefix)" \
      -DOSX_DEV_BUILD="ON" \
      -DPROC_TARGET_NUMBER="2" \
      -DCACHE_NAME_SUFFIX="5.8-dev" \
      -DWITH_LTO="ON" \
      -DCMAKE_C_COMPILER="clang" \
      -DCMAKE_CXX_COMPILER="clang++" \
      -DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
      -DCMAKE_OSX_DEPLOYMENT_TARGET="11.3" \
      -S .. --trace-source=../CMakeLists.txt --trace-expand

make -j$(sysctl -n hw.ncpu) install
#sudo make macosx_bundle
Version: 5.8-2980-g2e6e52f33
Branch: dev
Commit: 2e6e52f33
Commit date: 2021-05-31
Compiler: 
Processor: 
System: 
Bit depth: 
Gtkmm: V
Lensfun: V
Build type: 
Build flags: 
Link flags: 
OpenMP support: 
MMAP support: 
Build OS: Darwin 20.5.0 arm64
Build date: Thu, 03 Jun 2021 06:19:20 +0000 UTC
Build epoch: 1622701160
Build UUID: 4b2b0b73-e7d7-4e27-a6fe-477db3080703
Unfold console output here ``` /Users/cynamon/programs/code-rawtherapee/build /opt/homebrew/bin/brew Running with expanded trace output on. -- CMAKE_BUILD_TYPE: Release CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.20.3/share/cmake/Modules/FindJPEG.cmake:142 (mark_as_advanced): Policy CMP0102 is not set: The variable named "JPEG_LIBRARY" is not in the cache. This results in an empty cache entry which is no longer created when policy CMP0102 is set to NEW. Run "cmake --help-policy CMP0102" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): CMakeLists.txt:491 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Configuring done -- Generating done -- Build files have been written to: /Users/cynamon/programs/code-rawtherapee/build [ 0%] Creating AboutThisBuild.txt and other version-dependent files -- git command found: /opt/homebrew/bin/git -- Git checkout information: -- Commit description: 5.8-2980-g2e6e52f33 -- Branch: dev -- Commit: 2e6e52f33 -- Commit date: 2021-05-31 -- Commits since tag: 2899 -- Commits since branch: 2899 -- Version (unreliable): 5.8.2899 -- Build information: -- Build OS: Darwin 20.5.0 arm64 -- Build date: Thu, 03 Jun 2021 06:19:20 +0000 UTC -- Epoch: 1622701160 -- UUID: 4b2b0b73-e7d7-4e27-a6fe-477db3080703 -- CACHE_NAME_SUFFIX is "5.8-dev" [ 0%] Built target UpdateInfo Consolidate compiler generated dependencies of target rtexif [ 0%] Building CXX object rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o [ 1%] Building CXX object rtexif/CMakeFiles/rtexif.dir/nikonattribs.cc.o [ 2%] Building CXX object rtexif/CMakeFiles/rtexif.dir/kodakattribs.cc.o [ 2%] Building CXX object rtexif/CMakeFiles/rtexif.dir/canonattribs.cc.o [ 2%] Building CXX object rtexif/CMakeFiles/rtexif.dir/olympusattribs.cc.o [ 2%] Building CXX object rtexif/CMakeFiles/rtexif.dir/rtexif.cc.o [ 3%] Building CXX object rtexif/CMakeFiles/rtexif.dir/panasonicattribs.cc.o [ 3%] Building CXX object rtexif/CMakeFiles/rtexif.dir/pentaxattribs.cc.o objc[978]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1163b82b8). One of the two will be used. Which one is undefined. objc[978]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1163b8308). One of the two will be used. Which one is undefined. objc[981]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1142b82b8). One of the two will be used. Which one is undefined. objc[981]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1142b8308). One of the two will be used. Which one is undefined. objc[979]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1294902b8). One of the two will be used. Which one is undefined. objc[979]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x129490308). One of the two will be used. Which one is undefined. objc[976]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1164b82b8). One of the two will be used. Which one is undefined. objc[983]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1305802b8). One of the two will be used. Which one is undefined. objc[976]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1164b8308). One of the two will be used. Which one is undefined. objc[983]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x130580308). One of the two will be used. Which one is undefined. objc[980]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x114c102b8). One of the two will be used. Which one is undefined. objc[980]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x114c10308). One of the two will be used. Which one is undefined. objc[977]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1189082b8). One of the two will be used. Which one is undefined. objc[977]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x118908308). One of the two will be used. Which one is undefined. objc[982]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x116bb82b8). One of the two will be used. Which one is undefined. objc[982]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fcb2ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x116bb8308). One of the two will be used. Which one is undefined. /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.cc:30:10: fatal error: 'glib/gstdio.h' file not found #include ^~~~~~~~~~~~~~~ In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/nikonattribs.cc:24: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/nikonattribs.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/canonattribs.cc:23: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/canonattribs.cc.o] Error 1 In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/kodakattribs.cc:6: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/olympusattribs.cc:25: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/kodakattribs.cc.o] Error 1 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/olympusattribs.cc.o] Error 1 In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/pentaxattribs.cc:26: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/panasonicattribs.cc:6: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ make[2]: *** [rtexif/CMakeFiles/rtexif.dir/pentaxattribs.cc.o] Error 1 In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/fujiattribs.cc:20: /Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found #include ^~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/panasonicattribs.cc.o] Error 1 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o] Error 1 1 error generated. make[2]: *** [rtexif/CMakeFiles/rtexif.dir/rtexif.cc.o] Error 1 make[1]: *** [rtexif/CMakeFiles/rtexif.dir/all] Error 2 make: *** [all] Error 2 ```

Note: #6220 was related to a libomp problem. Workaround: downgrade libomp to version 11. And pin it in homebrew so it does not get upgraded.

Am I missing something obvious here? What do you think I should downgrade?

Thanatomanic commented 3 years ago

Well I'm not familiar with Homebrew, but all errors point to missing essential components for GTK3. Are you sure all dependencies are installed/present?

nomar500 commented 3 years ago
[  3%] Building CXX object rtexif/CMakeFiles/rtexif.dir/panasonicattribs.cc.o
In file included from /Users/cynamon/programs/code-rawtherapee/rtexif/olympusattribs.cc:25:
/Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.h:32:10: fatal error: 'glibmm/ustring.h' file not found
#include <glibmm/ustring.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [rtexif/CMakeFiles/rtexif.dir/olympusattribs.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/Users/cynamon/programs/code-rawtherapee/rtexif/rtexif.cc:30:10: fatal error: 'glib/gstdio.h' file not found
#include <glib/gstdio.h>
         ^~~~~~~~~~~~~~~
$ locate glibmm/ustring.h

/opt/homebrew/Cellar/glibmm/2.68.1/include/glibmm-2.68/glibmm/ustring.h
/opt/homebrew/Cellar/glibmm@2.66/2.66.1/include/glibmm-2.4/glibmm/ustring.h
$ locate glib/gstdio.h
/opt/homebrew/Cellar/glib/2.68.2/include/glib-2.0/glib/gstdio.h

Does that help?

nomar500 commented 3 years ago

atkmm@2.28: glibmm@2.66 gtkmm: glibmm@2.66 gtkmm3: glibmm@2.66 pangomm@2.46: glibmm@2.66



shrug shrug shrug, head is scratched, too
rom9 commented 3 years ago

I remember seeing a similar error on Linux after an upgrade. In my case, the problem was that a header file was moved to a different path. Did you try deleting the build directory altogether before running the cmake script ? Turns out that (at least on linux) cmake uses some tools to inspect what libraries are installed on the system, in which paths, and at which versions. All this information is then cached under the build subtree, so by deleting it, cmake is forced to re-inspect the system from scratch. This fixed the problem for me, although i'm not sure it also applies to MacOS / Homebrew ...

nomar500 commented 3 years ago

@rom9, thanks ! indeed, that worked. I had to reinstall glibmm@2.66 though.