Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./bootstrap-vcpkg.sh on mac selects wrong compiler #19332

Closed
autoantwort opened this issue Aug 3, 2021 · 4 comments · Fixed by #19622
Closed

./bootstrap-vcpkg.sh on mac selects wrong compiler #19332

autoantwort opened this issue Aug 3, 2021 · 4 comments · Fixed by #19622
Assignees
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed depends:upstream-changes Waiting on a change to the upstream project

Comments

@autoantwort
Copy link
Contributor

Describe the bug
When I run ./bootstrap-vcpkg.sh I get the following error:

➜  vcpkg git:(fix-meson) ✗ ./bootstrap-vcpkg.sh                                                         
Downloading vcpkg tool sources
Building vcpkg-tool...
-- The CXX compiler identification is GNU 11.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/local/bin/g++-11
-- Check for working CXX compiler: /usr/local/bin/g++-11 - broken
CMake Error at /Users/leanderSchulten/git_projekte/Lichtsteuerung/vcpkg/downloads/tools/cmake-3.20.2-osx/cmake-3.20.2-macos-universal/CMake.app/Contents/share/cmake-3.20/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/usr/local/bin/g++-11"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/leanderSchulten/git_projekte/Lichtsteuerung/vcpkg/buildtrees/_vcpkg/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/Users/leanderSchulten/git_projekte/Lichtsteuerung/vcpkg/downloads/tools/ninja-1.10.2-osx/ninja cmTC_3da22 && [1/2] Building CXX object CMakeFiles/cmTC_3da22.dir/testCXXCompiler.cxx.o
    FAILED: CMakeFiles/cmTC_3da22.dir/testCXXCompiler.cxx.o 
    /usr/local/bin/g++-11   -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -o CMakeFiles/cmTC_3da22.dir/testCXXCompiler.cxx.o -c testCXXCompiler.cxx
    g++-11: error: this compiler does not support arm64
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:33 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/leanderSchulten/git_projekte/Lichtsteuerung/vcpkg/buildtrees/_vcpkg/build/CMakeFiles/CMakeOutput.log".
See also "/Users/leanderSchulten/git_projekte/Lichtsteuerung/vcpkg/buildtrees/_vcpkg/build/CMakeFiles/CMakeError.log".

I can workaround this by passing the option -allowAppleClang to the script, but it should autoselect clang on arm macs or on macOS >= 10.15(?)

Environment

  • OS: macOS 11 with Apple M1

Expected behavior
It should simply compile vcpkg

@NancyLi1013 NancyLi1013 added the category:question This issue is a question label Aug 4, 2021
@NancyLi1013
Copy link
Contributor

Hi @autoantwort

Thanks for posting this issue.

vcpkg will choose gcc as the default compiler to build on Unix platform. So if you want to use clang compiler, you need to pass the option -allowAppleClang to build.

@autoantwort
Copy link
Contributor Author

So if you want to use clang compiler, you need to pass the option -allowAppleClang to build.

Yeah I know, but that must be the default on arm macs. Or do you think that getting this error as default behavior is a good thing?

Btw this is not a question, it is a vcpkg-bug ;)

@JackBoosY JackBoosY added depends:upstream-changes Waiting on a change to the upstream project and removed category:question This issue is a question labels Aug 6, 2021
@JackBoosY
Copy link
Contributor

gcc bug, see iains/gcc-darwin-arm64#35.

@autoantwort
Copy link
Contributor Author

Yeah, but until then vcpkg bootstrap fails

@NancyLi1013 NancyLi1013 added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed depends:upstream-changes Waiting on a change to the upstream project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants