0

As this post suggests, ocaml 4.03.0 compiler or greater defaults warning 31 as an error. This makes me unable to install the camlidl package with the command opam install camidl because it contains a module with conflicting name as in stdlib.cma. How should I configure ocaml so I can run the command?

This is the error message:

#=== ERROR while installing camlidl.1.05     ======================================#
# opam-version 1.2.2
# os           darwin
# command      make all
# path         /Users/xxx/.opam/system/build/camlidl.1.05
# compiler     system (4.05.0)
# exit-code    2
# env-file     /Users/xxx/.opam/system/build/camlidl.1.05/camlidl-58074-a71bb4.env
# stdout-file  /Users/xxx/.opam/system/build/camlidl.1.05/camlidl-58074-a71bb4.out
# stderr-file  /Users/xxx/.opam/system/build/camlidl.1.05/camlidl-58074-a71bb4.err
### stdout ###
# [...]
# ocamlc -g -c lexer_midl.mli
# ocamlc -g -c lexer_midl.ml
# ocamlc -g -c parse.mli
# ocamlc -g -c parse.ml
# ocamlc -g -c fixlabels.mli
# ocamlc -g -c fixlabels.ml
# ocamlc -g -c normalize.mli
# ocamlc -g -c normalize.ml
# ocamlc -g -c main.ml
# ocamlc -g -o camlidl config.cmo utils.cmo clflags.cmo prefix.cmo lexpr.cmo cvttyp.cmo variables.cmo array.cmo struct.cmo enum.cmo union.cmo cvtval.cmo structdecl.cmo enumdecl.cmo uniondecl.cmo typedef.cmo funct.cmo constdecl.cmo intf.cmo file.cmo predef.cmo linenum.cmo parse_aux.cmo parser_midl.cmo lexer_midl.cmo parse.cmo fixlabels.cmo normalize.cmo main.cmo
### stderr ###
# [...]
# File "parse_aux.ml", line 459, characters 10-26:
# Warning 3: deprecated: String.lowercase
# Use String.lowercase_ascii instead.
# 12 shift/reduce conflicts.
# File "array.cmo", line 1:
# Warning 31: files array.cmo and /usr/local/lib/ocaml/stdlib.cma(Array) both define a module named Array
# File "_none_", line 1:
# Error: Some fatal warnings were triggered (1 occurrences)
# make[1]: *** [camlidl] Error 2
# make: *** [all] Error 2
Seves
  • 135
  • 2
  • 12
  • `opam install camlidl` works fine in my environment. Actually the official OPAM repository has the patch for your warning issue for already one year: `opam-repository/packages/camlidl/camlidl.1.05/files/disable-fatal-warn-31.diff`. Are you using non official OPAM repo? – camlspotter Oct 31 '17 at 00:51
  • 1
    If you haven't updated your OPAM sources recently, it might be helpful to run `opam update` before `opam install camlidl` and see if you get the same issue. – typesanitizer Nov 02 '17 at 11:22

0 Answers0