alan-j-hu / llvm-dune

The official LLVM OCaml binding but built using dune
Other
26 stars 3 forks source link

llvm-config does not correctly detect shared libraries on macos #1

Open jberdine opened 3 years ago

jberdine commented 3 years ago

Irritatingly, it seems that llvm-config is broken on macos. It seems to be a commonly encountered problem, see e.g. https://github.com/Homebrew/homebrew-core/issues/47142 .

I don't know if it is feasible to do something other than llvm-config, or if it is better to just settle on only having static linking on macos.

jberdine commented 3 years ago

A filthy hack of a workaround is perhaps:

LLVMROOT=$(dirname $(dirname $(opam config var conf-llvm:config)))
ln -s $LLVMROOT/lib/libLLVM.dylib $LLVMROOT/lib/libLLVM-11.dylib
kit-ty-kate commented 3 years ago

the opam sandbox will prevent us from doing that automatically, however having the content of all of $(brew --prefix llvm)/lib symlinked in $(opam var lib)/conf-llvm, done by conf-llvm, similarly to https://github.com/ocaml/opam-repository/pull/18064, might be a solution.