userver-framework / service_template

Template of a C++ service that uses userver framework. Build, test and CI scripts ready

Home Page:https://userver.tech/da/d16/md_en_2userver_2tutorial_2hello__service.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work on macOS with CLang compiler

alfishe opened this issue · comments

Doesn't work on macOS with CLang compiler, produces following CMake error (CMakeError.log) attached as well:

cmake ..
-- C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- C++ compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Forcing warnings as errors!
-- Custom linker isn't available, using the default system linker.
-- LTO: on
-- LTO_CACHE enabled, cache folder is /Users/dev/Projects/GitHub/service_template/build/.ltocache
-- Looking for C++ include string
-- Looking for C++ include string - not found
CMake Error at third_party/userver/cmake/RequireLTO.cmake:31 (message):
LTO fails to compile a trivial program. See error logs for info. Try
specifying another linker via USERVER_USE_LD or changing the CMAKE_AR,
CMAKE_RANLIB, CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
Call Stack (most recent call first):
CMakeError.log

third_party/userver/cmake/SetupLTO.cmake:22 (include)
third_party/userver/cmake/SetupEnvironment.cmake:44 (include)
CMakeLists.txt:4 (include)

What is the problem with LTO? What's in the logs?

Updated error - now Boost is not found. if something needs to be installed - pre-requisites should be documented

cmake ..
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- C compiler:
-- C++ compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- C++ standard 17
-- LTO: on
-- LTO_CACHE disabled
-- Looking for C++ include string
-- Looking for C++ include string - found
-- ccache: enabled, but not found
-- Looking for C++ include variant
-- Looking for C++ include variant - found
-- variant: 1
CMake Error at /opt/homebrew/Cellar/cmake/3.26.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.26.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/Cellar/cmake/3.26.3/share/cmake/Modules/FindBoost.cmake:2377 (find_package_handle_standard_args)
third_party/userver/cmake/SetupEnvironment.cmake:99 (find_package)
CMakeLists.txt:4 (include)