Michael Dickens
Michael Dickens

Reputation: 1484

OCamlfind build fails

When I try to install ocamlfind using opam install ocamlfind, compilation fails and gives this message:

#=== ERROR while installing ocamlfind.1.5.5 ===================================#
# opam-version 1.2.0
# os           darwin
# command      make all
# path         /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5
# compiler     system (4.02.1)
# exit-code    2
# env-file     /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5/ocamlfind-21707-c61e7b.env
# stdout-file  /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5/ocamlfind-21707-c61e7b.out
# stderr-file  /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5/ocamlfind-21707-c61e7b.err
### stdout ###
# ...[truncated]
# ocamlc -I +compiler-libs -c fl_package_base.mli
# ocamlc -I +compiler-libs -g -c fl_package_base.ml
# ocamlc -I +compiler-libs -c findlib.mli
# ocamlc -I +compiler-libs -g -c findlib.ml
# ocamlc -I +compiler-libs -g -c fl_args.ml
# ocamlc -I +compiler-libs -a -o findlib.cma findlib_config.cmo fl_split.cmo fl_metatoken.cmo fl_meta.cmo fl_metascanner.cmo fl_topo.cmo fl_package_base.cmo findlib.cmo fl_args.cmo
# ocamlc -I +compiler-libs -g -c ocaml_args.ml
# ocamlc -I +compiler-libs -g -c frontend.ml
# ocamlc -I +compiler-libs -custom -o ocamlfind -g findlib.cma unix.cma \
#              ocaml_args.cmo frontend.cmo
### stderr ###
# ...[truncated]
# Undefined symbols for architecture x86_64:
#   "start", referenced from:
#      implicit entry/start for main executable
#      (maybe you meant: _caml_heap_start, _caml_young_start , _caml_start_code , _caml_startup_code )
# ld: symbol(s) not found for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# File "_none_", line 1:
# Error: Error while building custom runtime system
# make[1]: *** [ocamlfind] Error 2
     make: *** [all] Error 2

According to past Stack Overflow answers, this install fails sometimes if m4 is not installed, but I have m4 installed and in my path so that's not the problem.

Upvotes: 2

Views: 1173

Answers (1)

ivg
ivg

Reputation: 35210

Looks like a problem in your system or in a package manager. First, I would suggest not to use system compiler, but make a new compiler installation from scratch:

opam switch install 4.02.1
eval `opam config env`

If this doesn't work the try to look at your compiler toolkit, and ensure that linker is from the same toolkit as a compiler (at best, all tools, should link to the default OS X toolkit)

Upvotes: 1

Related Questions