mmottl / gsl-ocaml

OCaml bindings to the GSL (GNU Scientific Library).
Other
36 stars 10 forks source link

camlp4 shouldn't be required in META #5

Closed hcarty closed 9 years ago

hcarty commented 9 years ago

The findlib META file for gsl-ocaml lists camlp4 as a requirement. Having this requirement unfortunately breaks use of utop + gsl + ppx extensions. Removing camlp4 from the requires field in META fixes the issue as far as I can tell.

Could this be removed?

mmottl commented 9 years ago

It seems a contributor added the dependency to the library instead of just the example application where it was needed. I have fixed the issue.

hcarty commented 9 years ago

Thank you for the quick fix!

nilsbecker commented 9 years ago

This seems to be not fixed: for me, on OS X 10.10, camp4 is listed as an optional dependency, but installing gsl on a fresh opam switch of 4.02.1 without campl4 fails.

W: Field 'pkg_camlp4' is not set: When looking for findlib package camlp4, directory <HOME>/.opam/lala/lib/ocaml/camlp4 return doesn't exist

in another switch with camlp4 on the same machine, gsl is installed successfully and works.

mmottl commented 9 years ago

@nilsbecker This is actually a new problem. The initial problem was about a redundant and harmful camlp4 dependency when using the library with ocamlfind. The missing OPAM dependency on camlp4 caused problems, because one of the examples depended on it and is built by default.

As a solution I have added another flag to the _oasis file that builds the example in question only if the camlp4-flag is specifically enabled. The oasis2opam tool treats such a flag in a special way by adding it as a configuration variable to the generated opam file. It will only be set there if the camlp4 package is available in OPAM.

I have also changed the OPAM file for version 1.18.3 to always depend on camlp4. 1.18.4, which should also appear in OPAM soon, will use the more sophisticated solution above.