doomeer / factorio

Factorio Planner
MIT License
137 stars 40 forks source link

E: Unable to locate package js-of-ocaml #59

Closed sevillaarvin closed 5 years ago

sevillaarvin commented 5 years ago

Hi, I'm a beginner so I apologize in advance if this question doesn't make sense.

When I try to execute sudo apt-get install ocaml ocaml-findlib camlp4 js-of-ocaml I get E: Unable to locate package js-of-ocamlon my Ubuntu 18.04.

I tried:

sudo apt-get install opam
opam init
opam switch 4.02.3
opam install js_of_ocaml

But when I execute make I get:

ocamlbuild -no-links -use-ocamlfind -tag annot factoriojs.byte make: ocamlbuild: Command not found Makefile:36: recipe for target '_build/factoriojs.byte' failed make: *** [_build/factoriojs.byte] Error 127 EDIT: Fixed above by sudo apt install ocamlbuild

ocamlbuild -no-links -use-ocamlfind -tag annot factoriojs.byte + ocamlfind ocamldep -package js_of_ocaml.syntax -syntax camlp4o -package js_of_ocaml -modules factoriojs.ml > factoriojs.ml.depends ocamlfind: Package `js_of_ocaml.syntax' not found Command exited with code 2. Compilation unsuccessful after building 1 target (0 cached) in 00:00:00. Makefile:36: recipe for target '_build/factoriojs.byte' failed make: *** [_build/factoriojs.byte] Error 10

When I rerun opam install js_of_ocaml I get [NOTE] Package js_of_ocaml is already installed (current version is 3.2.0). EDIT: Fixed above using opam install js_of_ocaml-camlp4

When I run make I get:

ocamlbuild -no-links -use-ocamlfind -tag annot factoriojs.byte
+ ocamlfind ocamlc -c -g -annot -package js_of_ocaml.syntax -syntax camlp4o -package js_of_ocaml -o factoriojs.cmo factoriojs.ml
File "factoriojs.ml", line 115, characters 33-53:
Error: Unbound value Char.lowercase_ascii
Command exited with code 2.
Compilation unsuccessful after building 8 targets (0 cached) in 00:00:01.
Makefile:36: recipe for target '_build/factoriojs.byte' failed
make: *** [_build/factoriojs.byte] Error 10

Any help would be appreciated. Thanks!

doomeer commented 5 years ago

Hello! Sorry for the late answer, for some reason I missed the notification.

I'm not sure why js-of-ocaml is not available on Ubuntu, but you figured that using opam solved the problem, so that's good.

Regarding the Char.lowercase_ascii issue, see: https://github.com/doomeer/factorio/issues/60

Basically, please upgrade to OCaml 4.03 at least (but the latest 4.07 should be fine as well I think).