O2 build failed at boost due to unknown argument


I am building O2 following this tutorial:

But building boost fails. Inside the log the error is related to some unknown argument:

darwin.compile.c++ build-boost/boost/bin.v2/libs/filesystem/build/darwin-11.0.3/release/cxxstd-17-iso/threading-multi/visibility-hidden/codecvt_error_category.o

    "g++"   -std=c++17 -fvisibility-inlines-hidden -fcoalesce-templates -fPIC -O3 -Wall -fvisibility=hidden -dynamic -gdwarf-2 -fexceptions -Wno-long-double -Wno-inline  -DBOOST_ALL_NO_LIB=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DNDEBUG  -I"." -c -o "build-boost/boost/bin.v2/libs/filesystem/build/darwin-11.0.3/release/cxxstd-17-iso/threading-multi/visibility-hidden/codecvt_error_category.o" "libs/filesystem/src/codecvt_error_category.cpp"

clang: error: unknown argument: '-fcoalesce-templates'
...failed darwin.compile.c++ build-boost/boost/bin.v2/libs/filesystem/build/darwin-11.0.3/release/cxxstd-17-iso/threading-multi/visibility-hidden/codecvt_error_category.o...

I have tried to build O2 with and without boost from homebrew, but I am still receiving the same error. I have no idea what to do from here.
I am running on macOS Catalina 10.15.4 with alidist and O2 up to date.

Best Regards,

Hi @zsaldic,
I’ve got the same issue when I installed the Xcode upgrades yesterday.
For the moment I solved by commenting these lines in SOURCES/boost/v1.70.0/v1.70.0/tools/build/src/tools/darwin.jam:

# - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
#if $(real-version) < "4.0.0"
#    flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
# - GCC 4.2 and higher in Darwin does not have -Wno-long-double.
#if $(real-version) < "4.2.0"
#    flags darwin.compile OPTIONS $(condition) : -Wno-long-double ;
# - GCC on Darwin with -pedantic, suppress unsupported long long warning 

and recompiling.
Of course, this is just a dirty patch. Waiting for the real solution from the experts…


Hi @dstocco,

Good to hear that I wasn’t alone. However, commenting out those lines still resulted in an error when rebuilding. According to the log it cannot file a certain file:

++ [[ osx_x86-64 != osx* ]]
++ [[ ! -n '' ]]
++ [[ -n 17 ]]
++ [[ 17 -ge 17 ]]
++ CXXSTD=17
++ TMPB2=/Users/zsaldic/alice/sw/BUILD/9b821fd955e38745040c981ae9ec6f1ad9c4af3c/boost/tmp-boost-build
++ case $ARCHITECTURE in
++ TOOLSET=darwin
++ rsync -a /Users/zsaldic/alice/sw/SOURCES/boost/v1.70.0/v1.70.0/ /Users/zsaldic/alice/sw/BUILD/9b821fd955e38745040c981ae9ec6f1ad9c4af3c/boost/
++ cd /Users/zsaldic/alice/sw/BUILD/9b821fd955e38745040c981ae9ec6f1ad9c4af3c/boost/tools/build
++ case $ARCHITECTURE in
++ bash bootstrap.sh darwin
bash: bootstrap.sh: No such file or directory

The file is certainly there, but cannot be found. Do you have any other suggestions to work arounds?


Hi @zsaldic,
mmh, unfortunately I do not have further suggestions: I didn’t have this problem.
Just a question: when you modified the darwin.jam file, did you re-run alibuild or just run ninja or make in the build directory?
I re run aliBuild…and it compiled just fine.

Hi @dstocco,

Alright, thanks anyway. I modified darwin.jam and just re-ran alibuild. Maybe there are multiple places things has to be commented out in my case.


I confirm the problem. Here is the ticket : https://alice.its.cern.ch/jira/browse/O2-1286

The (simple) fix in https://github.com/alisw/alidist/pull/2159/files should solve this one.

1 Like