2

I am trying to install lablgtk via the following:

opam install lablgtk

It gives me following error:

┌─ The following actions failed
│ λ build lablgtk 2.18.11
└─ 
╶─ No changes have been performed

<><> lablgtk.2.18.11 troubleshooting ><><><><><><><><><><><><><><><><><><><><><>
=> This package requires gtk+ 2.0 development packages installed on your system

The packages you requested declare the following system dependencies. Please
make sure they are installed before retrying:
    libexpat1-dev libgtk2.0-dev

I tried this: sudo apt-get install -y libgtk2.0-dev but it says that libgtk2.0-dev is already the newest version (2.24.32-1ubuntu1).

Also similar thing happens for: sudo apt-get install -y libexpat1-dev where I get libexpat1-dev is already the newest version (2.2.5-3ubuntu0.2).

I tried both on Ubuntu 18.04LTS and 20.04LTS. Any suggestion what could be the solution?

Complete output:

  ∗ install lablgtk 2.18.11

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[lablgtk.2.18.11] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of lablgtk failed at
        "/home/user/.opam/opam-init/hooks/sandbox.sh build ./configure
        --prefix /home/user/.opam/default
        LABLGLDIR=/home/user/.opam/default/lib/lablgl".

#=== ERROR while compiling lablgtk.2.18.11 ====================================#
# context     2.0.7 | linux/x86_64 |  | https://opam.ocaml.org#87778c51
# path        ~/.opam/default/.opam-switch/build/lablgtk.2.18.11
# command     ~/.opam/opam-init/hooks/sandbox.sh build ./configure --prefix /home/user/.opam/default LABLGLDIR=/home/user/.opam/default/lib/lablgl
# exit-code   1
# env-file    ~/.opam/log/lablgtk-32104-d0f245.env
# output-file ~/.opam/log/lablgtk-32104-d0f245.out
### output ###
# [...]
# checking whether C compiler accepts -fno-unwind-tables... yes
# checking platform... Unix
# checking native dynlink... checking for pkg-config... /home/linuxbrew/.linuxbrew/bin/pkg-config
# checking for GTK+ - version >= 2.0.0... Package gtk+-2.0 was not found in the pkg-config search path.
# Perhaps you should add the directory containing `gtk+-2.0.pc'
# to the PKG_CONFIG_PATH environment variable
# No package 'gtk+-2.0' found
# no
# *** Could not run GTK+ test program, checking why...
# *** The test program failed to compile or link. See the file config.log for the
# *** exact error that occured. This usually means GTK+ is incorrectly installed.
# configure: error: GTK+ is required



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build lablgtk 2.18.11
└─ 
╶─ No changes have been performed

<><> lablgtk.2.18.11 troubleshooting ><><><><><><><><><><><><><><><><><><><><><>
=> This package requires gtk+ 2.0 development packages installed on your system

The packages you requested declare the following system dependencies. Please
make sure they are installed before retrying:
    libexpat1-dev libgtk2.0-dev

which opam gives /usr/local/bin/opam and which ocaml gives /home/linuxbrew/.linuxbrew/bin/ocaml

5
  • What was wrong with installing deb-packaged version by sudo apt-get install liblablgtk2-ocaml-dev ?
    – N0rbert
    Dec 30, 2020 at 16:58
  • That finishes successfully but still I get the same error when I run opam install proverif where lablgtk is one of the dependencies. Actually I am installing ProVerif (Section 1.4.1 in prosecco.gforge.inria.fr/personal/bblanche/proverif/manual.pdf) Maybe I need to somehow set the path where opam should look for, but I don't know how to do it.
    – Curious
    Dec 30, 2020 at 17:18
  • Please add output of which opam and which ocaml to the question body. Why do you have mentions of linuxbrew in output above?
    – N0rbert
    Dec 30, 2020 at 20:03
  • which opam gives /usr/local/bin/opam and which ocaml gives /home/linuxbrew/.linuxbrew/bin/ocaml
    – Curious
    Dec 30, 2020 at 20:56
  • I would recommend to remove ocaml, which was installed by linuxbrew. And then retry method from my answer.
    – N0rbert
    Dec 30, 2020 at 21:18

1 Answer 1

1

I'm seeing that you are using LinuxBrew to install stuff on Ubuntu. It may be good for other stuff, but in the current case it leads to unpredictable and non-reproducible results.

So I would recommend to remove OPAM and OCaML which where installed using LinuxBrew and then install all the stuff using deb-packages from official repositories.

brew uninstall ocaml-findlib
brew uninstall ocaml
brew uninstall opam
brew uninstall gcc
brew uninstall gcc@5

rm -rf ~/.opam
sudo rm -v /usr/local/bin/opam

Then to install ProVerif we can follow PKGBUILD from ArchLinux.

sudo apt install -y graphviz ocaml-nox liblablgtk2-ocaml-dev

cd ~/Downloads
wget http://prosecco.gforge.inria.fr/personal/bblanche/proverif/proverif2.02pl1.tar.gz
tar -xf proverif2.02pl1.tar.gz
cd proverif2.02pl1/
./build

# optionally run tests
#./test all
#./test-type all

# and install binaries
sudo install -Dm755 proverif /usr/local/bin/proverif
sudo install -Dm755 proveriftotex /usr/local/bin/proveriftotex
sudo install -Dm755 proverif_interact /usr/local/bin/proverif_interact

And then call the executables from anywhere as proverif, proveriftotex or proverif_interact.

7
  • ./build gives this now: ocamlfind: Package lablgtk2 not found
    – Curious
    Dec 30, 2020 at 18:45
  • You have to restore default ocaml configuration. The answer above uses only deb-packages.
    – N0rbert
    Dec 30, 2020 at 18:53
  • I am new to ocaml. Can you update the answer with that?
    – Curious
    Dec 30, 2020 at 18:58
  • Start with rm -rf ~/.opam
    – N0rbert
    Dec 30, 2020 at 18:58
  • Still it gives the following error File "display_interact.ml", line 1: Error: /usr/lib/ocaml/lablgtk2/gMain.cmi is not a compiled interface for this version of OCaml. It seems to be for an older version of OCaml.
    – Curious
    Dec 30, 2020 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.