pveber / ocaml-r

Objective Caml binding embedding the R interpreter
GNU General Public License v3.0
35 stars 4 forks source link

wrong file name #10

Closed nilsbecker closed 6 years ago

nilsbecker commented 6 years ago

i get these weird loading problems on mac os x with homebrew-installed r:

In [2]: #require "ocaml-r.interpreter";;
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml/unix.cma: loaded
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r: added to search path
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/OCamlR.cma: loaded
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/interpreter: added to search path
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/interpreter/OCamlR_interpreter.cma: loaded

In [3]: open OcamlR;;
Error: Wrong file naming: /Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/ocamlR.cmi
contains the compiled interface for
OCamlR when OcamlR was expected

In [4]: #require "ocaml-r.stats";;
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/base: added to search path
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/base/OCamlR_base.cma: loaded
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/stats: added to search path
/Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/stats/OCamlR_stats.cma: loaded

In [5]: OcamlR_stat.rnorm 2;;
File "[5]", line 1, characters 0-17:
Error: Unbound module OcamlR_stat
   1: OcamlR_stat.rnorm 2;;

In [6]: OcamlR_stats.rnorm 2;;
Error: Wrong file naming: /Users/nbecker/.opam/4.07.1+flambda/lib/ocaml-r/stats/ocamlR_stats.cmi
contains the compiled interface for
pveber commented 6 years ago

No idea what's happening here. Looks like an ocaml packaging problem. How did you install ocaml-r?

nilsbecker commented 6 years ago

opam install ocaml-r

pveber commented 6 years ago

Looks right :). I've just built the library from a clean 4.07.1+flambda switch, and it works well. Unfortunately I have no mac at hand at the moment. Which version of opam do you use?

nilsbecker commented 6 years ago

i use opam 2.0.1. i'm also confused but i think i once saw a similar error message discussed somewhere online. not sure how to search for it though.

nilsbecker commented 6 years ago

this seems somewhat related https://caml.inria.fr/mantis/view.php?id=5832 . but in our case, the names are exactly the same?!

nilsbecker commented 6 years ago

ah no! the capitalization is indeed different!!

pveber commented 6 years ago

Indeed! What happens if you type open OCamlR?

nilsbecker commented 6 years ago

also, the cut-off error message for ocamlr_stats was

contains the compiled interface for
OCamlR_stats when OcamlR_stats was expected

which also has different capitalization

nilsbecker commented 6 years ago

OCamlR opens!

nilsbecker commented 6 years ago

and stats opens as well with the correct spelling. so i guess it's user error. although the error message could have been more helpful -- i would have expected something like no module OcamlR found etc\

nilsbecker commented 6 years ago

i also checked: i can successfully generate random numbers as in the readme

pveber commented 6 years ago

I agree, this is confusing. I found another issue on mantis describing a similar problem on Windows XP. Thanks for testing!