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

ERROR while compiling ocaml-base-compiler.4.12.0 on OSX #19157

Closed
M4tsuri opened this issue Jul 29, 2021 · 2 comments
Closed

ERROR while compiling ocaml-base-compiler.4.12.0 on OSX #19157

M4tsuri opened this issue Jul 29, 2021 · 2 comments

Comments

@M4tsuri
Copy link

M4tsuri commented Jul 29, 2021

version infomation:

macOS Big Sur 11.5 (20G71)

$ cc -v
clang version 9.0.1
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm@9/bin

$ opam --version                                                           
2.0.8

error message:

[ERROR] The compilation of ocaml-base-compiler failed at
        "/Users/xxx/.opam/opam-init/hooks/sandbox.sh build make -j1".
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-options-vanilla.1

#=== ERROR while compiling ocaml-base-compiler.4.12.0 =========================#
# context     2.0.8 | macos/x86_64 |  | https://opam.ocaml.org#1fc79772
# path        ~/.opam/4.12.0/.opam-switch/build/ocaml-base-compiler.4.12.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j1
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-96279-e7966f.env
# output-file ~/.opam/log/ocaml-base-compiler-96279-e7966f.out
### output ###
# Undefined symbols for architecture x86_64:
# [...]
#   "_caml_weak_get_copy", referenced from:
#       _caml_builtin_cprim in prims.o
#   "_caml_weak_set", referenced from:
#       _caml_builtin_cprim in prims.o
#   "_main", referenced from:
#      implicit entry/start for main executable
# ld: symbol(s) not found for architecture x86_64
# cc: error: linker command failed with exit code 1 (use -v to see invocation)
# make[2]: *** [ocamlrun] Error 1
# make[1]: *** [coldstart] Error 2
# make: *** [world.opt] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions were aborted
│ ∗ install ocaml        4.12.0
│ ∗ install ocaml-config 2
└─
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.12.0
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray         base
│ ∗ install base-threads          base
│ ∗ install base-unix             base
│ ∗ install ocaml-options-vanilla 1
└─

Thank you.

@mseri
Copy link
Member

mseri commented Jul 29, 2021

I cannot reproduce it. Is it by any chance running on a M1 machine in rosetta mode?

@M4tsuri
Copy link
Author

M4tsuri commented Jul 29, 2021

Sorry, I found that it's caused by a conflict with binutils. brew unlink binutils and temporarily remove /usr/local/opt/binutils solved it. As mentioned here

@M4tsuri M4tsuri closed this as completed Jul 29, 2021
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

2 participants