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

ocamlfind 1.8.0 fails on macOS #13008

Closed
nkaretnikov opened this issue Nov 18, 2018 · 6 comments
Closed

ocamlfind 1.8.0 fails on macOS #13008

nkaretnikov opened this issue Nov 18, 2018 · 6 comments

Comments

@nkaretnikov
Copy link

macOS 10.14, ocaml and opam installed via brew. Could be a user error since it's the second time I use ocaml.

These commands succeeded:

% brew install ocaml opam
% opam install menhir core

Then tried to install ocamlfind:

% opam install ocamlfind
The following actions will be performed:
  ∗ install ocamlfind 1.8.0

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
[ocamlfind.1.8.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
[ERROR] The compilation of ocamlfind failed at "/Users/nikita/.opam/opam-init/hooks/sandbox.sh build make opt".

#=== ERROR while compiling ocamlfind.1.8.0 ====================================#
# context     2.0.1 | macos/x86_64 | ocaml-system.4.07.0 | https://opam.ocaml.org#7f6dd222
# path        ~/.opam/default/.opam-switch/build/ocamlfind.1.8.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make opt
# exit-code   2
# env-file    ~/.opam/log/ocamlfind-17295-c61e7b.env
# output-file ~/.opam/log/ocamlfind-17295-c61e7b.out
### output ###
# Undefined symbols for architecture x86_64:
# [...]
#       _caml_program in camlstartupa48c1c.o
#   "_camlFl_topo__frametable", referenced from:
#       _caml_frametable in camlstartupa48c1c.o
#   "_camlFl_topo__gc_roots", referenced from:
#       _caml_globals in camlstartupa48c1c.o
# ld: symbol(s) not found for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# File "caml_startup", line 1:
# Error: Error during linking
# make[1]: *** [ocamlfind_opt] Error 2
# make: *** [opt] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build ocamlfind 1.8.0
└─ 
╶─ No changes have been performed
% opam config report
# opam config report
# opam-version      2.0.1 
# self-upgrade      no
# system            arch=x86_64 os=macos os-distribution=homebrew os-version=10.14
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              3
# repositories      1 (http) (default repo at 7f6dd222)
# pinned            0
# current-switch    default
@pmetzger
Copy link
Member

You might not want to use the system switch (that is to say, a switch which uses the compiler and tools brew provides). Presuming opam is working well enough to create a fresh switch, that might work better for you.

@nkaretnikov
Copy link
Author

@pmetzger Thanks for getting back to me quickly!

I hope I correctly understood you, here's what I tried:

% opam switch 4.06.1
% eval $(opam env)
% opam install ocamlfind
The following actions will be performed:
  ∗ install ocaml-base-compiler 4.06.1 [required by ocaml]
  ∗ install ocaml-config        1      [required by ocaml]
  ∗ install ocaml               4.06.1 [required by ocamlfind]
  ∗ install ocamlfind           1.8.0
===== ∗ 4 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ocaml-base-compiler.4.06.1] found in cache
[ocamlfind.1.8.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ERROR] The compilation of ocaml-base-compiler failed at "/Users/nikita/.opam/opam-init/hooks/sandbox.sh build make world".

#=== ERROR while compiling ocaml-base-compiler.4.06.1 =========================#
# context     2.0.1 | macos/x86_64 |  | https://opam.ocaml.org#7f6dd222
# path        ~/.opam/4.06.1/.opam-switch/build/ocaml-base-compiler.4.06.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build make world
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-25096-c61e7b.env
# output-file ~/.opam/log/ocaml-base-compiler-25096-c61e7b.out
### output ###
# Undefined symbols for architecture x86_64:
# [...]
#       _caml_builtin_cprim in prims.o
#   "_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
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# make[1]: *** [ocamlrun] Error 1
# make: *** [coldstart] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.06.1
└─
╶─ No changes have been performed


% opam switch create 4.07.1

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ocaml-base-compiler.4.07.1] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
[ERROR] The compilation of ocaml-base-compiler failed at "/Users/nikita/.opam/opam-init/hooks/sandbox.sh build make world".

#=== ERROR while compiling ocaml-base-compiler.4.07.1 =========================#
# context     2.0.1 | macos/x86_64 |  | https://opam.ocaml.org#7f6dd222
# path        ~/.opam/4.07.1/.opam-switch/build/ocaml-base-compiler.4.07.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build make world
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-27319-ad8886.env
# output-file ~/.opam/log/ocaml-base-compiler-27319-ad8886.out
### output ###
# Undefined symbols for architecture x86_64:
# [...]
#       _caml_builtin_cprim in prims.o
#   "_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
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# make[1]: *** [ocamlrun] Error 1
# make: *** [coldstart] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.07.1
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray base
│ ∗ install base-threads  base
│ ∗ install base-unix     base
└─
# Run eval $(opam env) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y

@pmetzger
Copy link
Member

Hrm. This looks bad. On the other hand, I'm not entirely clear on what the cause is. I also run on a mac, but I bootstrap off of MacPorts, and haven't had this problem, but I couldn't tell you offhand what is different. Maybe someone else will have some ideas.

@vogler
Copy link
Contributor

vogler commented Nov 26, 2018

I have the same problem since some update.

@vogler
Copy link
Contributor

vogler commented Nov 26, 2018

Temporarily fixed via brew unlink binutils
ocaml/opam#3650

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove the stale label, or comment, or this will be closed in 15 days.

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

3 participants