-
Notifications
You must be signed in to change notification settings - Fork 39
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
Question: Support for latest LLVM on Mac #59
Comments
Probably change the requested version to 8.0 in CMakeLists.txt. I haven't built LLVM 8 yet though, and some minor updates are usually needed with new major releases. |
Thanks. That got me past the cmake stage, but make gives this: Scanning dependencies of target c2ffi Should I drop back to LLVM 7? |
Probably if you need |
Dropping back worked, thanks. |
Finally got updated to 8.0. ;) |
I'll give it a try this week. |
Was able to build c2ffi on Mojave 10.14 just with these steps
Thanks :) |
I also had to set LIBRARY_PATH while running
Otherwise, I got the following error -
|
If someone would like to submit macos-specific instructions to include in the README, that might be the best fix here. Alternatively some slightly better detection of the proper clang in cmake, but I have no way to test on mac myself. |
I tried to get this to build on MacOS 10.14 by pinning to LLVM 11, as per the warning that 12 was not yet stable and 10 was deprecated, but couldn't get it to work. Would love some ideas! In my case, it looks like Clang is assuming that the linker has a This appears be a known issue with Homebrew: Homebrew/homebrew-core#52461. But I am mentioning it here because I'm probably not the only person to run into this problem! According to the issue (closed as "stale"? huh?) this might not actually be fixable as Mojave proceeds towards EOL. I've been avoiding upgrading to Big Sur out of fear of breaking my work computer, but I might be forced to do it after this. This is what I ran: brew update
brew install llvm@11
brew upgrade llvm@11
# Homebrew: For compilers to find llvm you may need to set:
# export LDFLAGS="-L/usr/local/opt/llvm/lib"
# export CPPFLAGS="-I/usr/local/opt/llvm/include"
export LDFLAGS="-L/usr/local/opt/llvm@11/lib"
export CPPFLAGS="-I/usr/local/opt/llvm@11/include"
# Do I need or want this?
# Homebrew: To use the bundled libc++ please add the following LDFLAGS:
# LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
#export LDFLAGS="${LDFLAGS} -L/usr/local/opt/llvm@11/lib -Wl,-rpath,/usr/local/opt/llvm@11/lib"
# https://github.com/rpav/c2ffi/issues/59#issuecomment-692696371
export LIBRARY_PATH=/usr/local/opt/llvm@11/Toolchains/LLVM11.1.0.xctoolchain/usr/lib
# These options are apparently necessary so that Cmake can find the right
# files.
cmake \
-DCMAKE_PREFIX_PATH="/usr/local/opt/llvm@11" \
-DCMAKE_CXX_COMPILER="/usr/local/opt/llvm@11/bin/clang++" \
-DCMAKE_C_COMPILER="/usr/local/opt/llvm@11/bin/clang" \
.. And the error output:
|
Update on the above: it might have been a PEBCAK issue (maybe the wrong Git branch was checked out?), or something wrong with my specific system. But I got it working on Big Sur, and did not need to set |
I'm trying to build on Mac OS 10.14.2 (Mojave). I installed LLVM with homebrew and set LLVM_DIR to /usr/local/opt/llvm. When I run "cmake .." in the build directory, I get this error:
CMake Error at CMakeLists.txt:7 (find_package):
Could not find a configuration file for package "LLVM" that is compatible
with requested version "7.0".
The following configuration files were considered but not accepted:
Do I need to install a different version?
The text was updated successfully, but these errors were encountered: