Hi, I’m installing ocaml using the https://ocaml.org/docs/installing-ocaml guide on a Open SUSE machine and I am getting some errors when using the command opam install ocaml-lsp-server odoc ocamlformat utop
saying that the file /usr/lib64/ocaml/compiler-libs/ocamlcommon.cmxa
is unavailable while compiling base.v0.16.3
. It also fails while compiling odoc. The full command output is at the bottom of this post.
I tried installing opam using the package manager as well as the binary distribution, and both gave me the same result. I also tried using opam update
opam upgrade
command. Any help would be appreciated.
Below is the full output of the opam install
command. It already installed some dependencies as well as utop before, but always fails for the remaining packages.
[NOTE] Package utop is already installed (current version is 2.14.0).
The following actions will be performed:
=== install 6 packages
∗ base v0.16.3 [required by ocaml-lsp-server]
∗ ocaml-lsp-server 1.18.0
∗ ocamlformat 0.26.2
∗ ocamlformat-lib 0.26.2 [required by ocamlformat]
∗ odoc 2.4.2
∗ stdio v0.16.0 [required by ocamlformat-lib]
Proceed with ∗ 6 installations? [y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved base.v0.16.3 (cached)
⬇ retrieved ocaml-lsp-server.1.18.0 (cached)
⬇ retrieved ocamlformat.0.26.2, ocamlformat-lib.0.26.2 (cached)
⬇ retrieved odoc.2.4.2 (cached)
⬇ retrieved stdio.v0.16.0 (cached)
[ERROR] The compilation of base.v0.16.3 failed at "dune build -p base -j 3".
[ERROR] The compilation of odoc.2.4.2 failed at "dune build -p odoc -j 3 @install".
#=== ERROR while compiling odoc.2.4.2 =========================================#
# context 2.2.0 | linux/x86_64 | ocaml.4.14.2 | https://opam.ocaml.org#471f15306c0f2b1845912395b8ae9b978d3d05ac
# path ~/.opam/default/.opam-switch/build/odoc.2.4.2
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p odoc -j 3 @install
# exit-code 1
# env-file ~/.opam/log/odoc-216244-6c7ef9.env
# output-file ~/.opam/log/odoc-216244-6c7ef9.out
### output ###
# [...]
# (cd _build/default && /usr/bin/ocamlopt.opt -w -40 -g -w -18-53 -g -I src/loader/.odoc_loader.objs/byte -I src/loader/.odoc_loader.objs/native -I /home/wagner/.opam/default/lib/astring -I /home/wagner/.opam/default/lib/camlp-streams -I /home/wagner/.opam/default/lib/fpath -I /home/wagner/.opam/default/lib/odoc-parser -I /home/wagner/.opam/default/lib/result -I /usr/lib64/ocaml/compiler-libs -[...]
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Cmi_format, and its interface was not compiled with -opaque
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Cmt_format, and its interface was not compiled with -opaque
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Misc, and its interface was not compiled with -opaque
# (cd _build/default && /usr/bin/ocamlopt.opt -w -40 -g -w -18-53 -g -I src/odoc/.odoc_odoc.objs/byte -I src/odoc/.odoc_odoc.objs/native -I /home/wagner/.opam/default/lib/astring -I /home/wagner/.opam/default/lib/bytes -I /home/wagner/.opam/default/lib/camlp-streams -I /home/wagner/.opam/default/lib/fmt -I /home/wagner/.opam/default/lib/fpath -I /home/wagner/.opam/default/lib/odoc-parser -I /ho[...]
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Cmi_format, and its interface was not compiled with -opaque
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Cmt_format, and its interface was not compiled with -opaque
#=== ERROR while compiling base.v0.16.3 =======================================#
# context 2.2.0 | linux/x86_64 | ocaml.4.14.2 | https://opam.ocaml.org#471f15306c0f2b1845912395b8ae9b978d3d05ac
# path ~/.opam/default/.opam-switch/build/base.v0.16.3
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p base -j 3
# exit-code 1
# env-file ~/.opam/log/base-216244-cd3666.env
# output-file ~/.opam/log/base-216244-cd3666.out
### output ###
# File "shadow-stdlib/gen/dune", line 1, characters 20-23:
# 1 | (executables (names gen) (libraries str compiler-libs.common)
# ^^^
# Error: File unavailable: /usr/lib64/ocaml/compiler-libs/ocamlcommon.cmxa
# (cd _build/default && /usr/bin/ocamlopt.opt -w -40 -g -I shadow-stdlib/gen/.gen.eobjs/byte -I shadow-stdlib/gen/.gen.eobjs/native -I /usr/lib64/ocaml/compiler-libs -intf-suffix .ml -no-alias-deps -o shadow-stdlib/gen/.gen.eobjs/native/gen.cmx -c -impl shadow-stdlib/gen/gen.ml)
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Cmi_format, and its interface was not compiled with -opaque
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Location, and its interface was not compiled with -opaque
# File "_none_", line 1:
# Warning 58 [no-cmx-file]: no cmx file was found in path for module Printtyp, and its interface was not compiled with -opaque
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build base v0.16.3
│ λ build odoc 2.4.2
└─
╶─ No changes have been performed