Hi all,
Which OPAM package should I install to use ocamlmktop?
I wonder there is a generic way to find the corresponding package too.
Hi all,
Which OPAM package should I install to use ocamlmktop?
I wonder there is a generic way to find the corresponding package too.
Every opam switch I have seems to have it, so I’d assume it just comes along with the compiler.
Looking up installed binaries from packages might be an interesting thing though. I’m not aware of an existing way, but it could be something extra for sherlocode.
In fact, the OPAM switch that I have on my Ubuntu machine doesn’t seem to have it.
$ which ocaml
/home/opamtest/.opam/default/bin/ocaml
$ which ocamlmktop
/usr/bin/ocamlmktop
opam list
shows as follows:
...
ocaml 4.14.1 The OCaml compiler (virtual package)
...
ocaml-system 4.14.1 The OCaml compiler (system version, from outside of opam)
...
ocamlmktop
is part of the compiler, so depending on "ocaml"
is sufficient. Your switch is using the ocaml-system
implementation of ocaml
, which tells opam to use the version on your system which is why it’s not actually in your switch itself (if you did have ocaml installed, ocaml-system
wouldn’t be installed)
Thanks for the note.
Actually, I became to raise this question because Topfind was failing on a REPL binary created with ocamlmktop:
opamtest@SEA-1801623622:~$ ocamlmktop -o myocaml
opamtest@SEA-1801623622:~$ ./myocaml
OCaml version 4.14.1
Enter #help;; for help.
# #directory "+compiler-libs";;
# Topdirs.dir_use Format.std_formatter "topfind";;
- : unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
- : unit = ()
- : unit = ()
# Topfind.load_deeply ["camlp5"];;
Exception: Fl_package_base.No_such_package ("camlp5", "").
I was suspecting that this error was happening only when the path of ocamlmktop
does not match that of ocaml
. If I run the three above commands on ocaml
REPL, things run successfully.
Is this error message indicating that there is a bug in ocamlmktop
?
I think this might be an unfortunate interaction of ocamlfind in ocaml-system based switches, ocamlfind is presumably installed in your switch? I think which ocaml
will point to a shell script in your switch?
Yes, ocamlfind is installed in my switch and ocaml also points to a script in my switch:
opamtest@SEA-1801623622:~$ opam list
...
ocamlfind 1.9.8 A library manager for OCaml
...
opamtest@SEA-1801623622:~$ which ocaml
/home/opamtest/.opam/default/bin/ocaml
I think the issue will disappear if you do opam install ocaml-base-compiler.4.14.1
and try ocamlmktop
again