Skip to content

Instantly share code, notes, and snippets.

@nicnilov
Last active October 7, 2020 14:50
Show Gist options
  • Save nicnilov/5cfa976bba5a90e287a1a1673b88dab9 to your computer and use it in GitHub Desktop.
Save nicnilov/5cfa976bba5a90e287a1a1673b88dab9 to your computer and use it in GitHub Desktop.
RawTherapee compile on macOS Mojave with llvm 10
# Install llvm 10
brew install llvm
# or brew install llvm@10 if it is not the last one anymore
# Clone the repo
cd <some directory>
git clone [email protected]:Beep6581/RawTherapee.git
cd RawTherapee
# If necessary, clean the build folder
cd build
make -j$(sysctl -n hw.ncpu) clean
# rm -rf ./*
# Run cmake per the template on http://rawpedia.rawtherapee.com/MacOS with the appropriate paths
cd <RawTherapee source root>
mkdir -p build && cd build
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig && \
export LDFLAGS="-L/usr/local/Cellar/llvm/10.0.1_1/lib" && \
export CPPFLAGS="-I/usr/local/Cellar/llvm/10.0.1_1/include" && \
cmake .. -DCMAKE_BUILD_TYPE="release" \
-DPROC_TARGET_NUMBER="2" \
-DCACHE_NAME_SUFFIX="5.8-dev" \
-DCMAKE_C_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang++" \
-DWITH_LTO="ON" \
-DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
-DCMAKE_BUILD_TYPE=Release \
-DOpenMP_C_FLAGS=-fopenmp=libomp \
-DOpenMP_CXX_FLAGS=-fopenmp=libomp \
-DOpenMP_C_LIB_NAMES="libomp" \
-DOpenMP_CXX_LIB_NAMES="libomp" \
-DOpenMP_libomp_LIBRARY="/usr/local/lib/libomp.dylib" \
-DOpenMP_CXX_FLAGS="-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
-DOpenMP_CXX_LIB_NAMES="libomp" \
-DOpenMP_C_FLAGS="-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/opt/libffi/lib -L/usr/local/lib" \
-DCMAKE_AR="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ar" \
-DCMAKE_RANLIB="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ranlib"
# Run make
make -j$(sysctl -n hw.ncpu) install
# At this point the build/Release folder should contain the built binaries.
# These should be placed under `/Applications/RawTherapee.app/Contents/MacOS/` in order for the app to find the resources.
# If the distributed app is there, its folder can be renamed so it still should work in parallel but it will use the mentioned folder
# for the resources, so there may be conflicts.
# As an alternative, build a macos package which can be installed as usual
sudo make macosx_bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment