2
votes

Error while installing camlbz2

%opam install camlbz2

...
...
. checking bzlib.h usability... no
. checking bzlib.h presence... no
. checking for bzlib.h... no

awk: line 1: regular expression compile failed (syntax error ^* or ^+) ^+ configure: error: not found 'opam install camlbz2' failed. I can not find anything for opam to install something like "libbz2" or whatever, any suggestions?

2

2 Answers

5
votes

OPAM only deals (currently) with OCaml source packages.

Here, your problem comes from the ./configure script of the OCaml package detecting that a system package is missing, not an OCaml package (you can see that it has searched for files with a .h extension, i.e. a C include file).

To fix your problem, you need to install this system package. As Ontologiae said, the missing package is related to the libbz2 library, and include files are usually provided in development packages, so you should probably try to install libbz2-dev using the system installer of your OS. This package is not in OCaml, so there is no risk of messing up with OPAM installation.

Note that, since you use opam config -env to set your OCaml environment, even if you install OCaml packages with your system installer, there should be no bad interaction with packages installed in your homedir by OPAM.

4
votes

You need to install the libbz2 C library. So, check your package system and install it.

In Debian, it's the package "libbz2-dev" (so sudo apt-get install libbz2-dev)