ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.18k forks source link

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

Open qwy16 opened 3 years ago

qwy16 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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