1

I wanted to install the ocaml-compiler as well as required packages. I've already successfully ran those lines:

$ sh <(curl -sL \
https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)

$ opam init --bare

$ opam switch create 4.13.1

$ eval $(opam env)

And then I gave this command line:

opam install ocaml-lsp-server dune utop mparser \
ocamlformat ounit2 qcheck

And I became this error report:

[ERROR] The compilation of cmdliner.1.0.4 failed at "make all
        PREFIX=/Users/jasmin/.opam/4.13.1".
⬇ retrieved mew_vi.0.5.0  (cached)
⬇ retrieved lwt_react.1.1.4  (cached)
⬇ retrieved odoc-parser.0.9.0  (cached)
⬇ retrieved react.1.2.1  (cached)
⬇ retrieved ocp-indent.1.8.1  (cached)
⬇ retrieved utop.2.8.0  (cached)
⬇ retrieved topkg.1.0.4  (cached)
⬇ retrieved uutf.1.0.2  (cached)
⬇ retrieved uuseg.14.0.0  (cached)
⬇ retrieved zed.3.1.0  (cached)
⬇ retrieved uucp.14.0.0  (cached)
[ERROR] The compilation of topkg.1.0.4 failed at "ocaml pkg/pkg.ml build
        --pkg-name topkg --dev-pkg false".

#=== ERROR while compiling topkg.1.0.4 ========================================#
# context     2.1.0 | macos/x86_64 | ocaml-base-compiler.4.13.1 | git+https://github.com/ocaml/opam-repository.git
# path        ~/.opam/4.13.1/.opam-switch/build/topkg.1.0.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false
# exit-code   1
# env-file    ~/.opam/log/topkg-2340-8c41a0.env
# output-file ~/.opam/log/topkg-2340-8c41a0.out
### output ###
# [...]
# Command exited with code 2.
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
#      '-build-dir' '_build' 'CHANGES.md' 'LICENSE.md' 'README.md' 'pkg/META'
#      'topkg.opam' 'src/topkg.a' 'src/topkg.cmxs' 'src/topkg.cmxa'
#      'src/topkg.cma' 'src/topkg_vcs.cmx' 'src/topkg_test.cmx'
#      'src/topkg_string.cmx' 'src/topkg_result.cmx' 'src/topkg_publish.cmx'
#      'src/topkg_pkg.cmx' 'src/topkg_os.cmx' 'src/topkg_opam.cmx'
#      'src/topkg_main.cmx' 'src/topkg_log.cmx' 'src/topkg_ipc.cmx'
#      'src/topkg_install.cmx' 'src/topkg_fpath.cmx' 'src/topkg_fexts.cmx'
#      'src/topkg_distrib.cmx' 'src/topkg_conf.cmx' 'src/topkg_codec.cmx'
#      'src/topkg_cmd.cmx' 'src/topkg_build.cmx' 'src/topkg.cmx'
#      'src/topkg.cmi' 'src/topkg.mli']: exited with 10


#=== ERROR while compiling cmdliner.1.0.4 =====================================#
# context     2.1.0 | macos/x86_64 | ocaml-base-compiler.4.13.1 | git+https://github.com/ocaml/opam-repository.git
# path        ~/.opam/4.13.1/.opam-switch/build/cmdliner.1.0.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build make all PREFIX=/Users/jasmin/.opam/4.13.1
# exit-code   1
# env-file    ~/.opam/log/cmdliner-2340-7f9fe6.env
# output-file ~/.opam/log/cmdliner-2340-7f9fe6.out
### output ###
# xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>   
┌─ The following actions failed
│ λ build cmdliner 1.0.4
│ λ build topkg    1.0.4

My MacOS is already updated to the latest version. I don't know what can I do to solve it, please help me

diudiu
  • 11
  • 2
  • 1
    Seems like you might not have the xcode command line developer tools, so I'd try installing, or reinstalling, those. – glennsl Oct 29 '21 at 14:30
  • Since you updated your MacOS , then this solution might help https://stackoverflow.com/a/64619274/10621865 . – Faisal Afroz Nov 02 '21 at 22:37

1 Answers1

1

I think you could check out the macOS part of this version of the INSTALL file.

Please open your terminal and the command xcode-select --install. It seems like you haven't installed the Clang properly on your Macbook.

If this couldn't help, please let me know. I will help up to solve this issue. You could also visit OCaml Forum and look for helps there.

kirisky
  • 11
  • 6