Re: Installing lablgtk failed; cannot find camlp4orf.
"Gabriel Scherer [email protected] [ocaml_beginners]" <[email protected]> Sat, 12 Dec 2015 19:14:04 +0100
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAPFanBGOm4vyTJQzEUWhTwjSsiYS2y-kzKDa-FZV=jOM68b7fg@mail.gmail.com> |
> > Let me continue to do that here. Questions get answers, and answers > generate new questions. > Indeed, your comments are very helpful, thanks. (Do you have a github handle/username? If/when I submit a change proposal to the documentation I'll mention it.) Is there an version of the eval `opam config env` command that gives > you a different switch for the current shell without affecting other > shells or the current normal switch? Say, if I want to check that my > code works with old versions of the compiler or libraries but not > affecting other current development? > This is a good question, but I don't think it is possible, because I suspect the switch command mutates not only the environment variables (if it was only this, it would be easy), but also some global .opam state (symbolic links or whatever). One thing I know that we should mention is how to run a single command atomically under another switch, without affecting the environment: opam config exec --switch=$SWITCH -- command I use this a lot, for example to easily test a compile command under several OCaml versions. Presumably there is some analogous advice for nonUnix environments, but > not being familiar with them, I can't advise. > > And, I gather, the only thing the switch state affects is which version > of the compiler you use, together, of course, with the corresponding > version of all the compiled code. > Different switches may not have the same set of package installed. It is possible to import and export a "switch state" (a list of installed packages) using the commands opam switch export FILE opam switch import FILE It's not clear to me what I'd have to do if I were to want a different > version of just some packages or libraries (perhaps I've modified them > to try and fix bugs) while keeping the same compiler. The switch > choices seem all to be compiler versions -- or is that an > oversimplification already? > A typical workflow to do this is to reproduce a switch under a different name. Suppose you have installed some packages in the switch 4.02.3, and you now want to test a different setting in a switch 4.02.3-experiment. opam export my_opam_state opam switch install 4.02.3-experiment --alias-of 4.02.3 # the alias argument is a compiler version, not a switch name # (but each compiler version has a switch of its name) eval $(opam config env) opam import my_opam_state opam pin ... # a possible way to setup your local modifications The problem is that the system switch is used for bootstrapping the > ocaml and opam environment. > Well, I am not sure why "ocaml" is marked as a dependency of the "opam" package. You can install the opam binary without installing ocaml first, and then there is no need for a system switch. You only need a working OCaml install (for example from your package manager) if you wish to compile OPAM from sources. (The usability problem is that once an ocaml compiler has been installed by the system, OPAM has no way to tell between "this was just a dependency for the user, they don't intend in developping with this packaged ocaml version" and "the user has a whole development environment setup using their package manager, let's support this as a system switch".) Maybe just displaying a proper message after opam's installation, telling users about the system switch but encouraging them to rather use a new switch for development, would help avoid confusions. (Not sure saving disk space by removing a system-wide OCaml install really matters these days.) > On Sat, Dec 12, 2015 at 4:16 PM, Hendrik Boom [email protected] > > [ocaml_beginners] <[email protected]> wrote: > > > > > On Thu, Dec 10, 2015 at 09:47:02PM +0100, Gabriel Scherer > > > [email protected] [ocaml_beginners] wrote: > > > > This seems to be an OPAM packaging bug that should be reported at > > > > https://github.com/ocaml/opam-repository/issues > > > > > > > > Could you tell which version of OCaml you have and which switch you > > > > are using? From the log it looks like this is 4.01 using the system > > > > switch (presumably you installed OCaml from your system distribution, > > > > and the packaged version is 4.01), but that might also be a bug. Have > > > > you tried using a more recent version (opam switch install 4.02.3)? > > > > > > Did that. Then did > > > > > > opam install lablgtk > > > > > > and this time it worked. > > > > > > I'm not really sure what the commend 'opam switch install 4.02.3' does. > > > Evidently it installs a new version of ocaml to my local environment. > > > ut what's the scope of this switch? Does it replace the system's > > > version of ocaml entirely? When I start a new shell and echo $PATH > it's > > > clear that the PATH now starts with > > > > > > /home/hendrik/.opam/4.02.3/bin:/home/hendrik/bin:/usr/local/bin: > > > > > > etc etc. > > > > > > So how global is this? > > > > > > -- hendrik > > > > > > > > > > > On Thu, Dec 10, 2015 at 6:12 PM, Hendrik Boom [email protected] > > > > [ocaml_beginners] <[email protected]> wrote: > > > > > Installing lablgtk failed. > > > > > It appears to be unable to find camlp4orf. > > > > > Any ideas? > > > > > > > > > > -- hendrik > > > > > > > > > > > > > > > hendrik@notlookedfor:~/dv/ocaml/learngtk$ opam install lablgtk > > > > > The following actions will be performed: > > > > > - install camlp4.4.01+system [required by > > > lablgtk] > > > > > - install lablgtk.2.18.3 > > > > > === 2 to install === > > > > > Do you want to continue ? [Y/n] y > > > > > > > > > > =-=- Synchronizing package archives > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > > > > > > > > > =-=- Installing packages > > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > > > > Copying > > > ~/.opam/repo/default/packages/camlp4/camlp4.4.01+system/files/install > to > > > ~/.opam/system/build/camlp4.4.01+system/ > > > > > Copying > > > > ~/.opam/repo/default/packages/camlp4/camlp4.4.01+system/files/check-camlp4.sh > > > to ~/.opam/system/build/camlp4.4.01+system/ > > > > > Building camlp4.4.01+system: > > > > > sh ./check-camlp4.sh > > > > > [ERROR] The compilation of camlp4.4.01+system failed. > > > > > Removing camlp4.4.01+system. > > > > > Nothing to do. > > > > > [WARNING] Directory /home/hendrik/.opam/system/lib/camlp4 is not > > > empty, not removing > > > > > > > > > > > > > > > #=== ERROR while installing camlp4.4.01+system > > > ================================# > > > > > # opam-version 1.2.0 > > > > > # os linux > > > > > # command sh ./check-camlp4.sh > > > > > # path /home/hendrik/.opam/system/build/camlp4.4.01+system > > > > > # compiler system (4.01.0) > > > > > # exit-code 1 > > > > > # env-file > > > > /home/hendrik/.opam/system/build/camlp4.4.01+system/camlp4-8311-c61e7b.env > > > > > # stdout-file > > > > /home/hendrik/.opam/system/build/camlp4.4.01+system/camlp4-8311-c61e7b.out > > > > > # stderr-file > > > > /home/hendrik/.opam/system/build/camlp4.4.01+system/camlp4-8311-c61e7b.err > > > > > ### stdout ### > > > > > # ...[truncated] > > > > > # `opam switch`. > > > > > # > > > > > # Here are some installation instructions for camlp4 if you > obtained > > > OCaml > > > > > # via the OPAM binary packages: > > > > > # > > > > > # > > > > http://software.opensuse.org/download.html?project=home%3Aocaml&package=ocaml > > > > > # > > > > > # * Debian/Ubuntu: sudo apt-get install camlp4-extra > > > > > # * RHEL/CentOS/Fedora: sudo yum install ocaml-camlp4 > > > > > # > > > > > ### stderr ### > > > > > # ./check-camlp4.sh: 3: ./check-camlp4.sh: camlp4orf: not found > > > > > > > > > > > > > > > =-=- Error report > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > > > > The following failed > > > > > - install camlp4.4.01+system > > > > > Due to the errors, the following have been cancelled > > > > > - install lablgtk.2.18.3 > > > > > hendrik@notlookedfor:~/dv/ocaml/learngtk$ > > > > > > > > > > > > > > > > > > > > ------------------------------------ > > > > > Posted by: Hendrik Boom <[email protected]> > > > > > ------------------------------------ > > > > > > > > > > Archives up to December 31, 2011 are also downloadable at > > > http://www.connettivo.net/cntprojects/ocaml_beginners > > > > > The archives of the very official ocaml list (the seniors' one) > can be > > > found at http://caml.inria.fr > > > > > Attachments are banned and you're asked to be polite, avoid flames > etc. > > > > > ------------------------------------ > > > > > > > > > > Yahoo Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------ > > > > Posted by: Gabriel Scherer <[email protected]> > > > > ------------------------------------ > > > > > > > > Archives up to December 31, 2011 are also downloadable at > > > http://www.connettivo.net/cntprojects/ocaml_beginners > > > > The archives of the very official ocaml list (the seniors' one) can > be > > > found at http://caml.inria.fr > > > > Attachments are banned and you're asked to be polite, avoid flames > etc. > > > > ------------------------------------ > > > > > > > > Yahoo Groups Links > > > > > > > > > > > > > > > > > > > > > ------------------------------------ > > > Posted by: Hendrik Boom <[email protected]> > > > ------------------------------------ > > > > > > Archives up to December 31, 2011 are also downloadable at > > > http://www.connettivo.net/cntprojects/ocaml_beginners > > > The archives of the very official ocaml list (the seniors' one) can be > > > found at http://caml.inria.fr > > > Attachments are banned and you're asked to be polite, avoid flames etc. > > > ------------------------------------ > > > > > > Yahoo Groups Links > > > > > > > > > > > > > > > ------------------------------------ > Posted by: Hendrik Boom <[email protected]> > ------------------------------------ > > Archives up to December 31, 2011 are also downloadable at > http://www.connettivo.net/cntprojects/ocaml_beginners > The archives of the very official ocaml list (the seniors' one) can be > found at http://caml.inria.fr > Attachments are banned and you're asked to be polite, avoid flames etc. > ------------------------------------ > > Yahoo Groups Links > > > >