PhyloCSF icon indicating copy to clipboard operation
PhyloCSF copied to clipboard

failed to compile

Open freedog8 opened this issue 7 years ago • 3 comments

[jliu@login01 PhyloCSF]$ make make -C lib/CamlPaml reinstall make[1]: Entering directory /data/gpfs02/jliu/ding/tools/PhyloCSF/lib/CamlPaml' make uninstall make[2]: Entering directory /data/gpfs02/jliu/ding/tools/PhyloCSF/lib/CamlPaml' ocamlfind remove CamlPaml ocamlfind: [WARNING] No such file: /data/gpfs01/jliu/.opam/default/lib/CamlPaml/META make[2]: Leaving directory /data/gpfs02/jliu/ding/tools/PhyloCSF/lib/CamlPaml' make install make[2]: Entering directory /data/gpfs02/jliu/ding/tools/PhyloCSF/lib/CamlPaml' ocamlbuild -use-ocamlfind CamlPaml.cma CamlPaml.cmxa

  • ocamlfind ocamlc -c -g -package gsl -pp ocaml+twt -o Code.cmo Code.ml File "Code.ml", line 55, characters 11-24: Warning 3: deprecated: Stdlib.String.create Use Bytes.create instead. File "Code.ml", line 57, characters 3-27: Warning 3: deprecated: Stdlib.String.set Use Bytes.set instead. File "Code.ml", line 193, characters 32-46: Warning 3: deprecated: Stdlib.Char.uppercase Use Char.uppercase_ascii instead. File "Code.ml", line 193, characters 50-64: Warning 3: deprecated: Stdlib.Char.uppercase Use Char.uppercase_ascii instead. File "Code.ml", line 193, characters 68-82: Warning 3: deprecated: Stdlib.Char.uppercase Use Char.uppercase_ascii instead. File "Code.ml", line 1: Error: The implementation Code.ml does not match the interface Code.cmi: ... In module DNA: Values do not match: val revcomp : string -> bytes is not included in val revcomp : string -> string File "Code.mli", line 29, characters 1-31: Expected declaration File "Code.ml", line 53, characters 5-12: Actual declaration Command exited with code 2. Compilation unsuccessful after building 53 targets (52 cached) in 00:00:00. make[2]: *** [lib] Error 10 make[2]: Leaving directory /data/gpfs02/jliu/ding/tools/PhyloCSF/lib/CamlPaml' make[1]: *** [reinstall] Error 2 make[1]: Leaving directory /data/gpfs02/jliu/ding/tools/PhyloCSF/lib/CamlPaml' make: *** [CamlPaml] Error 2

freedog8 avatar Dec 04 '18 10:12 freedog8

As the offical site tells, this problem may results by the difference between String and Bytes of the recent compiler. To solve it, you can edit two Makefile in ./lib/CamlPaml and ./src/ and add -cflag '-unsafe-string' after each ocamlbuild as below:

  • Before: ocamlbuild -use-ocamlfind ${LIBNAME}.cma ${LIBNAME}.cmxa
  • After: ocamlbuild -cflag '-unsafe-string' -use-ocamlfind ${LIBNAME}.cma ${LIBNAME}.cmxa

BioWu avatar Jan 03 '19 11:01 BioWu

Just had the same issue - if any one else is struggling I reverted to older version of ocaml (4.02.3) and opam (2.0.0). With the current versions (ocaml 4.10.0 / opam 2.0.6) the above changes to the Makefiles was still resulting in errors as '-unsafe-string' is no longer compatible (at least with default configuration)

rorycraig337 avatar Mar 12 '20 13:03 rorycraig337

For me too, reverting to ocaml 4.02.3 did the trick, without having to do any changes to the Makefiles . After downloading opam, I just run :

opam init --switch==4.02.3 opam switch create 4.02.3

Not sure if the first command is necessary really. Making PhyloCSF then worked without a problem.

Nikos22 avatar Jul 14 '21 06:07 Nikos22