Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

dependency boost build from hunter failed --> clang: error: unknown argument: '-fcoalesce-templates' #5924

Open
qwy16 opened this issue Jun 2, 2021 · 2 comments

Comments

@qwy16
Copy link

qwy16 commented Jun 2, 2021

it's MacOS development environment, gcc info:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

=======================================================================

...patience...
...found 1056 targets...
...updating 43 targets...
darwin.compile.c++ bin.v2/libs/program_options/build/darwin-12.0.5/debug/link-static/threading-multi/visibility-hidden/cmdline.o
clang: error: unknown argument: '-fcoalesce-templates'

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk" "-std=c++14" "-fPIC" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk"   -fvisibility-inlines-hidden -fcoalesce-templates -O0 -fno-inline -Wall -g -fvisibility=hidden -gdwarf-2 -fexceptions -Wno-long-double  -DBOOST_ALL_NO_LIB=1  -I"." -c -o "bin.v2/libs/program_options/build/darwin-12.0.5/debug/link-static/threading-multi/visibility-hidden/cmdline.o" "libs/program_options/src/cmdline.cpp"

========================================================================
in CMakeLists.txt from the project, i found following:

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
hunter_add_package(Boost COMPONENTS program_options filesystem system thread context fiber log)
find_package(Boost CONFIG REQUIRED program_options filesystem system thread context fiber log)

hunter download Boost from
-- Using src='https://github.com/hunter-packages/boost/archive/v1.70.0-p0.tar.gz'

and found '-fcoalesce-templates' was set in: ~/.Hunter/_Base/Download/Boost/1.70.0-p0/e6bb97b/boost-1.70.0-p0/tools/build/src/tools/darwin.jam

140 # - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
141 # if $(real-version) < "4.0.0"
142 # {
143 # flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
144 # }

commented out the flags, doesn't work.

I think it's the root from hunter boost package using the older clang/gcc option that new version of compile on Mac doesn't recognize.

Will working on the work around such as trying to use local boost.

Thanks for any format of help and advice.~

@Wei-Jianan
Copy link

I have the same problem, and I am working on changing the cmakelist to use preinstalled Boost.
I guess this is a usual problem that mac users may encounter.
Hope the maintainer will pay attention to this.

@mcmara
Copy link

mcmara commented Oct 16, 2021

Same here. Boost is already installed on my system via macports. Not sure why a simple find_package was not used?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants