camlzip: “This package relies on external (system)

2019-05-26 08:47发布

问题:

I'm trying to install camlzip (an OCaml package housed in opam), but when I run opam install camlzip I get this:

The following actions will be performed:
  ∗  install camlzip 1.05

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[camlzip] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of camlzip failed at "make all".
Processing  1/1: [camlzip: ocamlfind remove]
#=== ERROR while installing camlzip.1.05 ======================================#
# opam-version 1.2.2
# os           linux
# command      make all
# path         /home/mttjone/.opam/system/build/camlzip.1.05
# compiler     system (4.02.3)
# exit-code    2
# env-file     /home/mttjone/.opam/system/build/camlzip.1.05/camlzip-3552-d2d111.env
# stdout-file  /home/mttjone/.opam/system/build/camlzip.1.05/camlzip-3552-d2d111.out
# stderr-file  /home/mttjone/.opam/system/build/camlzip.1.05/camlzip-3552-d2d111.err
### stdout ###
# ocamlc -g -c -ccopt -g -ccopt -I/usr/local/include zlibstubs.c
### stderr ###
# [...]
# zlibstubs.c:151: warning: comparison between pointer and integer
# zlibstubs.c: In function ‘camlzip_inflateEnd’:
# zlibstubs.c:165: warning: implicit declaration of function ‘inflateEnd’
# zlibstubs.c:165: error: ‘z_stream’ undeclared (first use in this function)
# zlibstubs.c:165: error: expected expression before ‘)’ token
# zlibstubs.c:165: error: invalid operands to binary * (have ‘int *’ and ‘int *’)
# zlibstubs.c:165: error: called object ‘<erroneous-expression>’ is not a function
# zlibstubs.c: In function ‘camlzip_update_crc32’:
# zlibstubs.c:172: warning: implicit declaration of function ‘crc32’
# make: *** [zlibstubs.o] Error 2



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  ∗  install camlzip 1.05
No changes have been performed

=-=- camlzip.1.05 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing. `opam depext camlzip.1.05' may help you find the correct installation for your system.

Now I think it's clear the it isn't acctually missing dependencies, but I can the suggested command anyway and it said I wasn't missing any dependencies.

Presumably the problem is with the zlibstubs.c file, but I'm not exactly sure what's happening.

Can anyone hep me out?

回答1:

TL;DR

opam install depext
opam depext camlzip

Explanations

The opam install depext command will install an opam plugin that is capable of installing external dependencies. It will add a depext command to opam tool.

The opam depext camlzip will install external dependencies, using system package manager. If your package manager is not supported, then the command will fail. In that case you can use

opam list --external --required-by=camlzip

to get all external dependencies of camlzip for all distributions and package management systems known to a package maintainer. From this information you can infer the names of packages for your distribution. Once you succeed, it is also a good idea to contribute this information back to the maintainer.



标签: ocaml opam