opam-repository icon indicating copy to clipboard operation
opam-repository copied to clipboard

Installing llvm on macOS Sonoma 14.2.1 with M3 processor fails

Open jordydickinson opened this issue 1 year ago • 0 comments

Installation fails with this message:

#=== ERROR while compiling llvm.16.0.6+nnp ====================================#
# context     2.1.5 | macos/arm64 | ocaml.5.1.1 | https://opam.ocaml.org#0286027b
# path        ~/.opam/default/.opam-switch/build/llvm.16.0.6+nnp
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build --release -j 7
# exit-code   1
# env-file    ~/.opam/log/llvm-45149-9aa0eb.env
# output-file ~/.opam/log/llvm-45149-9aa0eb.out
### output ###
# File "src/llvm/static/dune", line 2, characters 0-589:
# [...]
#  5 |  (implements llvm)
#  6 |  (foreign_stubs
#  7 |   (language c)
#  8 |   (names llvm_ocaml)
#  9 |   (extra_deps llvm_ocaml.h)
# 10 |   (flags (-I/opt/homebrew/Cellar/llvm@16/16.0.6/include  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS)))
# 11 |  (c_library_flags (-L/opt/homebrew/Cellar/llvm@16/16.0.6/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lstdc++ -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle
# 12 | -lm /opt/homebrew/lib/libz3.dylib -lz -lzstd -lcurses -lxml2)))
# (cd _build/default && /Users/jordydickinson/.opam/default/bin/ocamlmklib -g -o src/llvm/static/llvm_static_stubs src/llvm/static/llvm_ocaml.o -ldopt -L/opt/homebrew/Cellar/llvm@16/16.0.6/lib -ldopt -Wl,-search_paths_first -ldopt -Wl,-headerpad_max_install_names -ldopt -lstdc++ -ldopt -lLLVMCore -ldopt -lLLVMRemarks -ldopt -lLLVMBitstreamReader -ldopt -lLLVMBinaryFormat -ldopt -lLLVMTargetPars[...]
# ld: library 'zstd' not found
# clang: error: linker command failed with exit code 1 (use -v to see invocation)

Note that zstd is indeed installed via Homebrew.

A second attempt at installing this package fails with a different error:

#=== ERROR while compiling llvm.16.0.6+nnp ====================================#
# context     2.1.5 | macos/arm64 | ocaml.5.1.1 | https://opam.ocaml.org#0286027b
# path        ~/.opam/default/.opam-switch/build/llvm.16.0.6+nnp
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build --release -j 7
# exit-code   1
# env-file    ~/.opam/log/llvm-55986-61f633.env
# output-file ~/.opam/log/llvm-55986-61f633.out
### output ###
# 234 |   dibuild_create_debug_location_helper llctx line column scope inlined_at
# [...]
# Warning 6 [labels-omitted]: labels line, column, scope, inlined_at were omitted in the application of this function.
# (cd _build/default && /Users/jordydickinson/.opam/default/bin/ocamlopt.opt -w -40 -g -I src/debuginfo/static/.llvm_debuginfo_static.objs/byte -I src/debuginfo/static/.llvm_debuginfo_static.objs/native -I src/debuginfo/common/.llvm_debuginfo.objs/byte -I src/debuginfo/common/.llvm_debuginfo.objs/native -I src/llvm/common/.llvm.objs/byte -I src/llvm/common/.llvm.objs/native -intf-suffix .ml -no[...]
# File "src/debuginfo/static/llvm_debuginfo.ml", line 234, characters 2-38:
# 234 |   dibuild_create_debug_location_helper llctx line column scope inlined_at
#         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Warning 6 [labels-omitted]: labels line, column, scope, inlined_at were omitted in the application of this function.
# (cd _build/default && /Users/jordydickinson/.opam/default/bin/ocamlopt.opt -w -40 -g -I src/debuginfo/shared/.llvm_debuginfo_shared.objs/byte -I src/debuginfo/shared/.llvm_debuginfo_shared.objs/native -I src/debuginfo/common/.llvm_debuginfo.objs/byte -I src/debuginfo/common/.llvm_debuginfo.objs/native -I src/llvm/common/.llvm.objs/byte -I src/llvm/common/.llvm.objs/native -intf-suffix .ml -no[...]
# File "src/debuginfo/shared/llvm_debuginfo.ml", line 234, characters 2-38:
# 234 |   dibuild_create_debug_location_helper llctx line column scope inlined_at
#         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Warning 6 [labels-omitted]: labels line, column, scope, inlined_at were omitted in the application of this function.

jordydickinson avatar Dec 25 '23 19:12 jordydickinson