docs icon indicating copy to clipboard operation
docs copied to clipboard

Can't build with a compiler in a non-standard location

Open ChrisKing4 opened this issue 1 year ago • 0 comments

I am building c++ code on centos7. The way are machines are set up in our facility is that /usr/bin/c++ is installed when the machine is first imaged. Newer compilers and standard libraries are put in a different location. We often have several versions of compilers installed.

I am trying to use the profile configuration: [settings] compiler.cppstd=17 tools.build:compiler_executables={'cpp': '/local/my_selected_toolset/gcc/9.3.1/bin/g++'}

Rather than using the compiler that I specified to check if they support the standard, conan uses /usr/bin/c++.

  • Conan toolchain: C++ Standard 17 with extensions OFF -- The CXX compiler identification is GNU 4.8.5 -- Check for working CXX compiler: /usr/bin/c++ CMake Error in /home/c/chrisk/dev/curl_test/build/CMakeFiles/CMakeScratch/TryCompile-f3L1Mv/CMakeLists.txt: Target "cmTC_f7037" requires the language dialect "CXX17" . But the current compiler "GNU" does not support this, or CMake does not know the flags to enable it.

CMake Error at /net/ent-prod.nfs.laika.com/ifs/laika/depts/prod_tech/dev-tools/linux/cmake-3.28.0-linux-x86_64/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:49 (try_compile): Failed to generate test project build system. Call Stack (most recent call first): CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!

ChrisKing4 avatar Apr 08 '24 20:04 ChrisKing4