ocaml / graphics

The Graphics library from OCaml, in a standalone repository
Other
56 stars 29 forks source link

Cannot install graphics in ubuntu 20.04 on Windows laptop #40

Closed dh928 closed 2 years ago

dh928 commented 2 years ago

I have been trying to install graphics using "opam install graphics" in ubuntu. But I kept running into this error:

[NOTE] It seems you have not updated your repositories for a while. Consider updating them with:
       opam update

The following actions will be performed:
  ∗ install   conf-libX11       1      [required by graphics]
  ∗ install   graphics          5.1.2
  ↻ recompile ocamlfind         1.9.1  [uses graphics]
  ↻ recompile dot-merlin-reader 4.1    [uses ocamlfind]
  ↻ recompile base-bytes        base   [uses ocamlfind]
  ↻ recompile ocaml-lsp-server  1.8.2  [uses dot-merlin-reader]
  ↻ recompile zed               3.1.0  [uses base-bytes]
  ↻ recompile qcheck-core       0.18   [uses base-bytes]
  ↻ recompile ounit2            2.2.4  [uses base-bytes]
  ↻ recompile ocplib-endian     1.1    [uses base-bytes]
  ↻ recompile ocp-indent        1.8.1  [uses ocamlfind]
  ↻ recompile ANSITerminal      0.8.2  [uses base-bytes]
  ↻ recompile qcheck-ounit      0.18   [uses base-bytes]
  ↻ recompile lwt               5.4.2  [uses ocplib-endian]
  ↻ recompile ocamlformat-rpc   0.19.0 [uses ocp-indent]
  ↻ recompile ocamlformat       0.19.0 [uses ocp-indent]
  ↻ recompile qcheck            0.18   [uses base-bytes]
  ↻ recompile lwt_react         1.1.4  [uses lwt]
  ↻ recompile lwt_log           1.1.1  [uses lwt]
  ↻ recompile lambda-term       3.1.0  [uses zed]
  ↻ recompile utop              2.8.0  [uses ocamlfind]
===== ∗ 2   ↻ 19 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ANSITerminal.0.8.2] found in cache
[dot-merlin-reader.4.1] found in cache
[graphics.5.1.2] found in cache
[lambda-term.3.1.0] found in cache
[lwt.5.4.2] found in cache
[lwt_log.1.1.1] found in cache
[lwt_react.1.1.4] found in cache
[ocaml-lsp-server.1.8.2] found in cache
[ocamlfind.1.9.1] found in cache
[ocamlformat.0.19.0] found in cache
[ocamlformat-rpc.0.19.0] found in cache
[ocp-indent.1.8.1] found in cache
[ocplib-endian.1.1] found in cache
[ounit2.2.2.4] found in cache
[qcheck.0.18] found in cache
[qcheck-core.0.18] found in cache
[qcheck-ounit.0.18] found in cache
[utop.2.8.0] found in cache
[zed.3.1.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of conf-libX11 failed at "/home/danju666/.opam/opam-init/hooks/sandbox.sh build pkg-config
        x11".

#=== ERROR while compiling conf-libX11.1 ======================================#
# context     2.0.5 | linux/x86_64 | ocaml-base-compiler.4.12.0 | https://opam.ocaml.org#ef82e5bc
# path        ~/.opam/cs3110-2021fa/.opam-switch/build/conf-libX11.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build pkg-config x11
# exit-code   1
# env-file    ~/.opam/log/conf-libX11-42-626d32.env
# output-file ~/.opam/log/conf-libX11-42-626d32.out
### output ###
# bwrap: execvp pkg-config: No such file or directory
# bwrap: execvp pkg-config: No such file or directory

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build conf-libX11 1
└─
╶─ No changes have been performed

The packages you requested declare the following system dependencies. Please make sure they are installed before
retrying:
    libx11-dev
xavierleroy commented 2 years ago

You need to install the pkg-config utility, e.g. sudo apt install pkg-config.

Normally there's an OPAM dependency on conf-pkg-config in conf-libX11 that should take care of this. Not sure why conf-pkg-config doesn't appear in the trace above.

At any rate, this is not a problem with the Graphics library nor with its OPAM package; at most a problem with the conf-libX11 OPAM package.

dh928 commented 2 years ago

You need to install the pkg-config utility, e.g. sudo apt install pkg-config.

Normally there's an OPAM dependency on conf-pkg-config in conf-libX11 that should take care of this. Not sure why conf-pkg-config doesn't appear in the trace above.

At any rate, this is not a problem with the Graphics library nor with its OPAM package; at most a problem with the conf-libX11 OPAM package.

Thank you! That solved the problem, was able to install graphics after that.