Re: Installing lablgtk failed; cannot find camlp4orf.
"Gabriel Scherer [email protected] [ocaml_beginners]" <[email protected]> Sat, 12 Dec 2015 17:49:11 +0100
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAPFanBEDPF_+gYjGZKacRsis6ESVdVM2=QLkuOGqcBep_Nbogg@mail.gmail.com> |
There is some (probably too short for its own good) documentation of the
"switch" command at
https://opam.ocaml.org/doc/Usage.html#opamswitch
It would help if you could collect the questions you have about this
mechanism, so that we can then update the documentation to be more helpful.
I should apologize for recommending a stateful command (that changes your
environment) without giving a way out. You can easily go back to your
previous switch by doing "opam switch system". You can remove the newly
installed switch with "opam switch remove 4.02.3".
The switch state is global to your opam root (~/.opam in your case). The
change in PATH is performed in .opam/opam-init/variables.sh, itself called
from .opam/opam-init/init.sh, which is probably sourced by one of your
profile files (~./profile, ~/.bash_profile, ~/.bashrc) -- you either set
this up yourself or let "opam init" do it automatically.
In any case, the experience shows that there is a bad interaction between
the "system switch" (which is a bit special compared to other switches, as
the OCaml compiler was installed by the system distribution and thus OPAM
has little control over it) and camlp4 under some OCaml versions. This is a
known problem with no really good solution, see
https://github.com/ocaml/opam/issues/2151
the recommend solution is to
- either use your system-packaged camlp4 ("apt-get install camlp4" or
something)
- or use another switch than the system switch
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
>
>
>
>