diff --git a/INSTALL_MACOS.md b/INSTALL_MACOS.md index 2560f4da12..a02096a9e5 100644 --- a/INSTALL_MACOS.md +++ b/INSTALL_MACOS.md @@ -389,6 +389,9 @@ config.pri: ```Shell # copy and paste the following in a terminal + # Get the LLVM version corresponding to your Xcode version, from + # the table at https://en.wikipedia.org/wiki/Xcode#Toolchain_versions + # Here it is LLVM 11 for Xcode 12.5.1 cat > config.pri << EOF boost: INCLUDEPATH += /usr/local/include boost: LIBS += -L/usr/local/lib -lboost_serialization-mt -lboost_thread-mt -lboost_system-mt @@ -396,20 +399,20 @@ expat: PKGCONFIG -= expat expat: INCLUDEPATH += /usr/local/opt/expat/include expat: LIBS += -L/usr/local/opt/expat/lib -lexpat macx:openmp { - QMAKE_CC=/usr/local/opt/llvm/bin/clang - QMAKE_CXX=/usr/local/opt/llvm/bin/clang++ + QMAKE_CC=/usr/local/opt/llvm@11/bin/clang + QMAKE_CXX=/usr/local/opt/llvm@11/bin/clang++ QMAKE_OBJECTIVE_CC=\$\$QMAKE_CC -stdlib=libc++ QMAKE_LINK=\$\$QMAKE_CXX - LIBS += -L/usr/local/opt/llvm/lib -lomp + LIBS += -L/usr/local/opt/llvm@11/lib -lomp cc_setting.name = CC - cc_setting.value = /usr/local/opt/llvm/bin/clang + cc_setting.value = /usr/local/opt/llvm@11/bin/clang cxx_setting.name = CXX - cxx_setting.value = /usr/local/opt/llvm/bin/clang++ + cxx_setting.value = /usr/local/opt/llvm@11/bin/clang++ ld_setting.name = LD - ld_setting.value = /usr/local/opt/llvm/bin/clang + ld_setting.value = /usr/local/opt/llvm@11/bin/clang ldplusplus_setting.name = LDPLUSPLUS - ldplusplus_setting.value = /usr/local/opt/llvm/bin/clang++ + ldplusplus_setting.value = /usr/local/opt/llvm@11/bin/clang++ QMAKE_MAC_XCODE_SETTINGS += cc_setting cxx_setting ld_setting ldplusplus_setting QMAKE_FLAGS = "-B /usr/bin" @@ -481,7 +484,7 @@ Then, configure using the following qmake command on MacPorts: Or on Homebrew: ```Shell -env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig qmake -spec macx-xcode CONFIG+=debug CONFIG+=enable-cairo CONFIG+=enable-osmesa CONFIG+=openmp -r QMAKE_CXX='/usr/local/opt/llvm/bin/clang++ -stdlib=libc++' QMAKE_CC=/usr/local/opt/llvm/bin/clang QMAKE_OBJECTIVE_CXX='/usr/local/opt/llvm/bin/clang++ -stdlib=libc++' QMAKE_OBJECTIVE_CC='/usr/local/opt/llvm/bin/clang -stdlib=libc++' QMAKE_LD='/usr/local/opt/llvm/bin/clang++ -stdlib=libc++' +env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig qmake -spec macx-xcode CONFIG+=debug CONFIG+=enable-cairo CONFIG+=enable-osmesa CONFIG+=openmp -r QMAKE_CXX='/usr/local/opt/llvm@11/bin/clang++ -stdlib=libc++' QMAKE_CC=/usr/local/opt/llvm@11/bin/clang QMAKE_OBJECTIVE_CXX='/usr/local/opt/llvm@11/bin/clang++ -stdlib=libc++' QMAKE_OBJECTIVE_CC='/usr/local/opt/llvm@11/bin/clang -stdlib=libc++' QMAKE_LD='/usr/local/opt/llvm@11/bin/clang++ -stdlib=libc++' ``` To build the plugins, use the following command-line: diff --git a/Project.pro b/Project.pro index 4afccc7e89..8e078112fd 100644 --- a/Project.pro +++ b/Project.pro @@ -103,8 +103,8 @@ addresssanitizer { message(" qmake QMAKE_CC=clang-mp-5.0 QMAKE_CXX='clang++-mp-5.0 -stdlib=libc++' QMAKE_LINK='clang++-mp-5.0 -stdlib=libc++' QMAKE_OBJECTIVE_CC='clang-mp-5.0 -stdlib=libc++' QMAKE_OBJECTIVE_CXX='clang++-mp-5.0 -stdlib=libc++' CONFIG+=addresssanitizer ...") message("- with homebrew:") message(" brew install llvm") - message(" export ASAN_SYMBOLIZER_PATH=/usr/local/opt/llvm/bin/llvm-symbolizer") - message(" qmake QMAKE_CC=/usr/local/opt/llvm/bin/clang QMAKE_CXX='/usr/local/opt/llvm/bin/clang++ -stdlib=libc++' QMAKE_LINK='/usr/local/opt/llvm/bin/clang++ -stdlib=libc++' QMAKE_OBJECTIVE_CC='/usr/local/opt/llvm/bin/clang -stdlib=libc++' QMAKE_OBJECTIVE_CXX='/usr/local/opt/llvm/bin/clang++ -stdlib=libc++' CONFIG+=addresssanitizer ...") + message(" export ASAN_SYMBOLIZER_PATH=/usr/local/opt/llvm@11/bin/llvm-symbolizer") + message(" qmake QMAKE_CC=/usr/local/opt/llvm@11/bin/clang QMAKE_CXX='/usr/local/opt/llvm@11/bin/clang++ -stdlib=libc++' QMAKE_LINK='/usr/local/opt/llvm@11/bin/clang++ -stdlib=libc++' QMAKE_OBJECTIVE_CC='/usr/local/opt/llvm@11/bin/clang -stdlib=libc++' QMAKE_OBJECTIVE_CXX='/usr/local/opt/llvm@11/bin/clang++ -stdlib=libc++' CONFIG+=addresssanitizer ...") message("see http://clang.llvm.org/docs/AddressSanitizer.html") } } diff --git a/tools/buildmaster/compiler-common.sh b/tools/buildmaster/compiler-common.sh index 481fbef99e..c04cc411c4 100644 --- a/tools/buildmaster/compiler-common.sh +++ b/tools/buildmaster/compiler-common.sh @@ -22,7 +22,7 @@ if [ "$PKGOS" = "OSX" ]; then fi fi # clang path on homebrew (should always be the latest version) - if command -v /usr/local/opt/llvm/bin/clang >/dev/null 2>&1; then + if command -v /usr/local/opt/llvm@11/bin/clang >/dev/null 2>&1; then COMPILER=clang-omp fi #COMPILER=clang-omp @@ -67,9 +67,9 @@ if [ "$PKGOS" = "OSX" ]; then elif command -v clang-mp-4.0 >/dev/null 2>&1; then CC=clang-mp-4.0 CXX="clang++-mp-4.0 -stdlib=libc++ -std=c++11" - elif command -v /usr/local/opt/llvm/bin/clang >/dev/null 2>&1; then - CC=/usr/local/opt/llvm/bin/clang - CXX="/usr/local/opt/llvm/bin/clang++ -std=c++11" + elif command -v /usr/local/opt/llvm@11/bin/clang >/dev/null 2>&1; then + CC=/usr/local/opt/llvm@11/bin/clang + CXX="/usr/local/opt/llvm@11/bin/clang++ -std=c++11" fi # clang > 7.0 sometimes chokes on building Universal CImg.ofx, probably because of #pragma omp atomic #Undefined symbols for architecture i386: diff --git a/tools/jenkins/compiler-common.sh b/tools/jenkins/compiler-common.sh index 68af071cfe..c5d54717e8 100644 --- a/tools/jenkins/compiler-common.sh +++ b/tools/jenkins/compiler-common.sh @@ -23,7 +23,7 @@ if [ "$PKGOS" = "OSX" ]; then fi fi # clang path on homebrew (should always be the latest version) - if command -v /usr/local/opt/llvm/bin/clang >/dev/null 2>&1; then + if command -v /usr/local/opt/llvm@11/bin/clang >/dev/null 2>&1; then COMPILER=clang-omp fi #COMPILER=clang-omp @@ -68,9 +68,9 @@ if [ "$PKGOS" = "OSX" ]; then elif command -v clang-mp-4.0 >/dev/null 2>&1; then CC=clang-mp-4.0 CXX="clang++-mp-4.0 -stdlib=libc++ -std=c++11" - elif command -v /usr/local/opt/llvm/bin/clang >/dev/null 2>&1; then - CC=/usr/local/opt/llvm/bin/clang - CXX="/usr/local/opt/llvm/bin/clang++ -std=c++11" + elif command -v /usr/local/opt/llvm@11/bin/clang >/dev/null 2>&1; then + CC=/usr/local/opt/llvm@11/bin/clang + CXX="/usr/local/opt/llvm@11/bin/clang++ -std=c++11" fi # clang > 7.0 sometimes chokes on building Universal CImg.ofx, probably because of #pragma omp atomic #Undefined symbols for architecture i386: