Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
This repository was 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

@qwy16

Description

@qwy16

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.~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions