# Question regarding which package to include

**URL:** <https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653>\
**Category:** Ecosystem\
**Tags:** opium, jbuilder\
**Created:** [August 1, 2017, 3:14pm UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653 "2017-08-01T15:14:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobbypriambodo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bobbypriambodo/32/179_2.png) [@bobbypriambodo](https://discuss.ocaml.org/u/bobbypriambodo)\
**Post date:** [August 1, 2017, 3:14pm UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653/1 "2017-08-01T15:14:32Z")

</div>

Hello, I’m having a weird error here. I made [a little project](https://github.com/bobbypriambodo/haversiner) using [Opium](https://github.com/rgrinberg/opium) and worked on it last week. I’m using jbuilder for the build system. I had the following on my jbuild file:

```auto
(jbuild_version 1)

(library (
  (name lib)
  (libraries (opium.unix))))

```

and all was fine and well. But today I tried to compile it again, and it complains about missing `opium.unix` library, eventhough I have `opium` installed:

```nohighlight
$ opam list --installed-root
# Installed packages for 4.04.2-opium:
base-bigarray base Bigarray library distributed with the OCaml compiler
base-threads base Threads library distributed with the OCaml compiler
base-unix base Unix library distributed with the OCaml compiler
core v0.9.1 Industrial strength alternative to OCaml's standard library
ocp-indent 1.6.0 A simple tool to indent OCaml programs
opium 0.16.0 Sinatra like web toolkit based on Lwt + Cohttp
ounit 2.0.0 Unit testing framework loosely based on HUnit. It is similar to JUnit, and other XUnit testing frameworks
utop 2.0.1 Universal toplevel for OCaml

$ make build
jbuilder build @install
Error: External library "opium.unix" not found.
-> required by "lib/jbuild (context default)"
Hint: try: jbuilder external-lib-deps --missing @install
make: *** [build] Error 1

$ jbuilder external-lib-deps --missing @install
Error: The following libraries are missing in the default context:
- opium.unix
Hint: try: opam install opium

```

For the sake of trying, I changed the definition in the previous `jbuild` to use `opium` instead of `opium.unix`, and the compilation succeeds! Which I find weird because in Opium’s readme, it tells me to use `opium.unix`.

One change that I remember making was upgrading versions of packages, notably jbuilder from `1.0+beta10` to `1.0+beta11`. What could possibly cause this error?

---

<div class="post-metadata">

**Author:** ![rgrinberg](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/rgrinberg/32/40_2.png) [@rgrinberg](https://discuss.ocaml.org/u/rgrinberg)\
**Post date:** [August 1, 2017, 3:49pm UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653/2 "2017-08-01T15:49:16Z")

</div>

If you’re using opium 0.16.0 (recently released), there has been a slight re-org of findlib/packages that will hopefully make the situation more consistent. There are now 2 opam packages: `opium` and `opium_kernel` with equivalent findlib names. In your project, you should use `opium` which is the new name for `opium.unix`.

---

<div class="post-metadata">

**Author:** ![bobbypriambodo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bobbypriambodo/32/179_2.png) [@bobbypriambodo](https://discuss.ocaml.org/u/bobbypriambodo)\
**Post date:** [August 2, 2017, 1:46am UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653/3 "2017-08-02T01:46:54Z")

</div>

Ah, yes, I do use opium 0.16.0, but I wasn’t sure which version I used before so I didn’t include that info.

Hmm, so in any given library, is there a way for me to determine what I should use for findlib packages?

---

<div class="post-metadata">

**Author:** ![rgrinberg](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/rgrinberg/32/40_2.png) [@rgrinberg](https://discuss.ocaml.org/u/rgrinberg)\
**Post date:** [August 2, 2017, 6:22am UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653/4 "2017-08-02T06:22:57Z")

</div>

There’s no way that works in general. You must inspect individual opam packages and see which findlib packages are provided through META, \_oasis files, etc. You can also just list all your findlib packages `$ ocamlfind list` and guess from there.

By the way, this issue is the motivation why I simply renamed the findlib packages in opium (and elsewhere) to simple match the opam package names. This is also what jbuilder pretty much focuses its users to do, so if you stick to well behaved packages you aren’t as likely to run into this problem.

---

<div class="post-metadata">

**Author:** ![bobbypriambodo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bobbypriambodo/32/179_2.png) [@bobbypriambodo](https://discuss.ocaml.org/u/bobbypriambodo)\
**Post date:** [August 2, 2017, 7:04am UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653/5 "2017-08-02T07:04:13Z")

</div>

I see. Looks like I still need to delve further into opam packaging 🙂

Thanks for the explanation, @rgrinberg!
