service_template icon indicating copy to clipboard operation
service_template copied to clipboard

Doesn't work on macOS with CLang compiler

Open alfishe opened this issue 2 years ago • 2 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)

alfishe avatar Jan 16 '23 19:01 alfishe

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

apolukhin avatar Mar 06 '23 11:03 apolukhin

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)

alfishe avatar May 04 '23 18:05 alfishe

You should use the fallowing pre building deps: https://github.com/userver-framework/userver/blob/develop/scripts/docs/en/deps/macos.md

alexiprof avatar Mar 27 '24 15:03 alexiprof