Hmmm .... the documentation seems at variance with the code? (can't get it to work (sigh))
Closed this issue · 3 comments
Hi, I wanted to try this out. So I did the following:
(0) on Ubuntu
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
(1) with opam
chet@twitter:~$ opam --version
2.0.4
(2) used opam to create a fresh install of your switch, viz.
opam repository add --set-default progman1 https://github.com/progman1/my-opam-repo.git
opam switch create 4.07.1+genprint
[This is in a fresh OPAM "sandbox" -- so no other ocaml switches, code, etc, are installed]
==============================
(3) First I tried to run the toplevel (ocaml
) and got an error that toplib was not installed. So I installed "ocamlfind". Is ocamlfind a prereq? That's a problem, but I figured I should report.
(4) Then I tried again:
chet@twitter:~/Hack/Ocaml/4.07.1-genprint$ ocaml
OCaml version 4.07.1
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
# open Genprint ;;
Error: Unbound module Genprint
#
chet@twitter:~/Hack/Ocaml/4.07.1-genprint$ which ocaml
/home/chet/Hack/Ocaml/4.07.1-genprint/4.07.1+genprint/bin/ocaml
chet@twitter:~/Hack/Ocaml/4.07.1-genprint$ opam switch help
[ERROR] No switch help is currently installed. Did you mean 'opam switch create
help'?
Installed switches are:
- 4.07.1+genprint
(5) I note that genprint is installed in the relevant lib directory:
chet@twitter:~/Hack/Ocaml/4.07.1-genprint$ ls `ocamlc -where`/genprint*
/home/chet/Hack/Ocaml/4.07.1-genprint/4.07.1+genprint/lib/ocaml/genprint.a
/home/chet/Hack/Ocaml/4.07.1-genprint/4.07.1+genprint/lib/ocaml/genprint.cma
/home/chet/Hack/Ocaml/4.07.1-genprint/4.07.1+genprint/lib/ocaml/genprint.cmx
/home/chet/Hack/Ocaml/4.07.1-genprint/4.07.1+genprint/lib/ocaml/genprint.cmxa
but the needed .cmi
files aren't there?
Is there something I did wrong?
thanks for the feedback. I just corrected a makefile for the missing cmi/mli as it happens.
as to ocamlfind - I think it may be your ~/.ocamlinit file demanding it.
Yeesh! I didn't even realize opam's "user-setup" was creating a ~/.ocamlinit ... after I went to all the trouble to put my various ocaml builds into completely different OPAM trees and all. Ugh. I'll try your switch again later today! Thank you for the fix, and for pointing out this ..... interesting behaviour of opam.
But also!....
your invocation would have worked with -I +compiler-libs
because there is a genprint module in the ocamltoplevel.cma library.
but because I have mixed that with a universal genprint module in the main common compiler code (works for both compiler and toplevel) for the purposes of evaluation, your invocation should have worked anyway - my bad for git pushing the wrong makefile!
The end of the git page explains the dichotomy :)