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

Support llvm-17/16/15 on Macos #243

Open
msclock opened this issue Apr 10, 2024 · 10 comments
Open

Support llvm-17/16/15 on Macos #243

msclock opened this issue Apr 10, 2024 · 10 comments

Comments

@msclock
Copy link

msclock commented Apr 10, 2024

Brew has formulas about llvm-17/16/15/14, see https://github.com/Homebrew/homebrew-core/blob/master/Formula/l/llvm.rb

But in setup-cpp indicates llvm-17/16/15 are missing in

"15.0.4",
"15.0.5",
"15.0.6",
"16.0.0",
"16.0.1",
"16.0.2",
"16.0.3",
"16.0.4",
"16.0.5",
"16.0.6",
"17.0.1",
"17.0.2",
"17.0.3",
"17.0.4",
"17.0.5",
"17.0.6",
"18.1.0",
"18.1.1",
"18.1.2",

Upvote & Fund

@aminya is using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.

Thank you in advance for helping prioritize & fund our backlog!


Fund with Polar
@aminya
Copy link
Owner

aminya commented Apr 10, 2024

This has been on my TODO list. See #242.

Upvote & Fund

@aminya is using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.

Thank you in advance for helping prioritize & fund our backlog!


Fund with Polar

@msclock
Copy link
Author

msclock commented Apr 10, 2024

@aminya thanks for your rapid feedback. Excellent work👍

@ClausKlein
Copy link

I can not understand why it does not work on Darwin:

bash-5.2$ sudo ./setup-cpp-x64-macos --compiler llvm-18  
Invalid semver version 18 used for the compiler.
::group::Installing llvm 18
Coerced version '18' to '18.0.0'
Installing llvm 18 x64 via direct downloading
Error: Unsupported target! (platform='darwin', version='18'). Try one of the following: {}
::endgroup::
took 0 seconds
Failed to install the llvm-18
setup-cpp finished
Run `source ~/.cpprc` or restart your shell to update the environment.
bash-5.2$ sudo ./setup-cpp-x64-macos --compiler llvm-17
Invalid semver version 17 used for the compiler.
::group::Installing llvm 17
Coerced version '17' to '17.0.0'
Installing llvm 17 x64 via direct downloading
Error: Unsupported target! (platform='darwin', version='17'). Try one of the following: {}
::endgroup::
took 0 seconds
Failed to install the llvm-17
setup-cpp finished
Run `source ~/.cpprc` or restart your shell to update the environment.
bash-5.2$ 

@ClausKlein
Copy link

Today, setup-cpp install llvm-14 by default, that is not helpflully!

bash-5.2$ clang --version
Homebrew clang version 17.0.6
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
bash-5.2$ 

@msclock
Copy link
Author

msclock commented Apr 10, 2024

Today, setup-cpp install llvm-14 by default, that is not helpflully!

bash-5.2$ clang --version
Homebrew clang version 17.0.6
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
bash-5.2$ 

At least 15 should be installed.🧐

This is my 15.0.3 installed.

@ClausKlein
Copy link

No, I need at least 17 for C++ modules!

@aminya
Copy link
Owner

aminya commented Apr 10, 2024

There are no official LLVM binaries for x86 on Apple after LLVM 16. Brew builds LLVM from the source, which I consider impractical for day-to-day usage.

However, I am planning to add support for Apple ARM

@msclock
Copy link
Author

msclock commented Apr 11, 2024

There are no official LLVM binaries for x86 on Apple after LLVM 16. Brew builds LLVM from the source, which I consider impractical for day-to-day usage.

However, I am planning to add support for Apple ARM

And is it practical to consider to use brew to install llvm-17/16. 🫤 For example:

brew install llvm@17
# export CXX as /usr/local/opt/llvm@17/bin/clang++
# export CC as /usr/local/opt/llvm@17/bin/clang
# export PATH as PATH=/usr/local/opt/llvm/bin:$PATH
brew install llvm@16
# export CXX as /usr/local/opt/llvm@16/bin/clang++
# export CC as /usr/local/opt/llvm@16/bin/clang
# export PATH as PATH=/usr/local/opt/llvm/bin:$PATH

@msclock
Copy link
Author

msclock commented Apr 11, 2024

I have adopted the above workaround temporarily in macos-12 and it works here.

@aminya
Copy link
Owner

aminya commented Apr 11, 2024

The reason it works seems to be because some version is already cached/installed on the system:
https://github.com/serious-scaffold/ss-cpp/actions/runs/8645856705/job/23703966694#step:5:18

Otherwise, it would take hours to compile Z3 and LLVM from the source for x86 if you try this on some other runner or locally.

I think there are some things we can do to reuse the already cached installations and error out for other versions. For Arm, this is totally solvable by using the official binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants