Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22304

Issues with setting compiler as g++-11 at CLion at macos. "Test Cmake run finished with error "

$
0
0

I want my Clion in MacOS compile with the g++-11 instead of Clang. When I set up the toolchain, it did not pass the test. Clion gives "Test Cmake run finished with error". This is the screen shotscreen shot

And I can click "more" to check the errors.

-- The C compiler identification is unknown-- The CXX compiler identification is unknown-- Detecting C compiler ABI info-- Detecting C compiler ABI info - failed-- Check for working C compiler: /usr/local/bin/gcc-11-- Check for working C compiler: /usr/local/bin/gcc-11 - brokenCMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/x64/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):  The C compiler"/usr/local/bin/gcc-11"  is not able to compile a simple test program.  It fails with the following output:    Change Dir: '/private/var/folders/lf/x7t4ln495yx9rlng8jr8yk580000gn/T/cmake_check_environment1/_build7996487480848918631/CMakeFiles/CMakeScratch/TryCompile-Fl9cKx'    Run Build Command(s): /Applications/CLion.app/Contents/bin/ninja/mac/x64/ninja -v cmTC_8f62f    [1/2] /usr/local/bin/gcc-11    -o CMakeFiles/cmTC_8f62f.dir/testCCompiler.c.o -c /private/var/folders/lf/x7t4ln495yx9rlng8jr8yk580000gn/T/cmake_check_environment1/_build7996487480848918631/CMakeFiles/CMakeScratch/TryCompile-Fl9cKx/testCCompiler.c    FAILED: CMakeFiles/cmTC_8f62f.dir/testCCompiler.c.o     /usr/local/bin/gcc-11    -o CMakeFiles/cmTC_8f62f.dir/testCCompiler.c.o -c /private/var/folders/lf/x7t4ln495yx9rlng8jr8yk580000gn/T/cmake_check_environment1/_build7996487480848918631/CMakeFiles/CMakeScratch/TryCompile-Fl9cKx/testCCompiler.c    clang (LLVM option parsing): Unknown command line argument '-x86-pad-for-align=false'.  Try: 'clang (LLVM option parsing) --help'    clang (LLVM option parsing): Did you mean '--x86-slh-loads=false'?    ninja: build stopped: subcommand failed.  CMake will not be able to correctly generate this project.Call Stack (most recent call first):  CMakeLists.txt:2 (project)-- Configuring incomplete, errors occurred!Error code: 1

It looks like the test ran with some clang parameters?

ChatGPT suggested that it might be the problem with environment variable path, but it looks fine to me. Here is the output from command lines about PATH:

(base) myname@mynames-MacBook-Pro bin % which gcc/usr/bin/gcc(base) myname@mynames-MacBook-Pro bin % which gcc-11/usr/local/bin/gcc-11(base) myname@mynames-MacBook-Pro bin % which gcc-14/usr/local/bin/gcc-14(base) myname@mynames-MacBook-Pro bin % echo $PATH/Users/myname/anaconda3/bin:/Users/myname/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myname/Library/Python/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin

Does anyone know how to fix this problem.

Here is the gcc version info at my mac

(base) myname@myname-MacBook-Pro bin % gcc --versionConfigured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1Apple clang version 12.0.0 (clang-1200.0.32.21)Target: x86_64-apple-darwin23.4.0Thread model: posixInstalledDir: /Library/Developer/CommandLineTools/usr/bin(base) myname@myname-MacBook-Pro bin % gcc-11 --versiongcc-11 (Homebrew GCC 11.4.0) 11.4.0Copyright (C) 2021 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.(base) myname@myname-MacBook-Pro bin % gcc-14 --versiongcc-14 (Homebrew GCC 14.2.0) 14.2.0Copyright (C) 2024 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Viewing all articles
Browse latest Browse all 22304

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>