rpav / c2ffi

Clang-based FFI wrapper generator
GNU Lesser General Public License v2.1
234 stars 38 forks source link

build successfully on macOS monterey but can't find old llvm@12 dylib #107

Open Inc0n opened 2 years ago

Inc0n commented 2 years ago

Build was successful using the script copied from https://github.com/rpav/c2ffi/issues/104#issuecomment-1038468510, with the only difference that llvm@13 is installed, and all environmental variables are changed accordingly.

However, when running c2ffi, it produced the following error:

dyld[11622]: Library not loaded: /opt/homebrew/opt/llvm@12/lib/libclang-cpp.dylib
  Referenced from: /Users/xception/.local/bin/c2ffi
  Reason: tried: '/opt/homebrew/opt/llvm@12/lib/libclang-cpp.dylib' (no such file), '/usr/local/lib/libclang-cpp.dylib' (no such file), '/usr/lib/libclang-cpp.dylib' (no such file)
zsh: abort      c2ffi

It's trying to find llvm@12, whilst the configured llvm is versioned 13.

The actual build script used ``` mkdir -p build cd build export CPPFLAGS="-I/opt/homebrew/opt/llvm@13/include" export LDFLAGS="-L/opt/homebrew/opt/llvm@13/lib" export PATH="/opt/homebrew/opt/llvm@13/bin:$PATH" LLVM_DIR=/opt/homebrew/opt/llvm@13/ CC="clang" CXX="clang++" cmake --install-prefix ~/.local/bin .. make make install ```
eliascotto commented 2 years ago

On my macOS Monterey 12.4 with M1 I get the following error with your script

➜  build git:(llvm-13.0.0) export CPPFLAGS="-I/opt/homebrew/opt/llvm@13/include"
➜  build git:(llvm-13.0.0) export LDFLAGS="-L/opt/homebrew/opt/llvm@13/lib"
➜  build git:(llvm-13.0.0) export PATH="/opt/homebrew/opt/llvm@13/bin:$PATH"
➜  build git:(llvm-13.0.0) LLVM_DIR=/opt/homebrew/opt/llvm@13/ CC="clang" CXX="clang++" cmake --install-prefix ~/.local/bin ..
-- Config: -Release
-- CXX Compiler: AppleClang
-- Building for Linux-x64
-- Found LLVM 13.0.1
-- LLVM installed in /opt/homebrew/opt/llvm@13
-- Using LLVMConfig.cmake in: /opt/homebrew/opt/llvm@13/lib/cmake/llvm
CMake Error at CMake/cxx_features.cmake:102 (__cxx_std_process):
  Unknown CMake command "__cxx_std_process".
Call Stack (most recent call first):
  CMakeLists.txt:62 (target_cxx_std)

-- Configuring incomplete, errors occurred!
See also "/Users/elia/c2ffi/build/CMakeFiles/CMakeOutput.log".
See also "/Users/elia/c2ffi/build/CMakeFiles/CMakeError.log".
jcguu95 commented 1 year ago

Related: https://github.com/rpav/c2ffi/issues/104