Biocaml compilation.

13 views
Skip to first unread message

Philippe Veber

unread,
Feb 22, 2016, 10:07:25 PM2/22/16
to Biocaml
Hi everyone,

  I've just pushed a branch that replaces omake by the solvuu_build ocamlbuild plugin for compilation. This build system features:

- declarative description of the libraries, apps and their dependencies
- compilation unit discovery (no need to list modules in each library)
- conditional compilation (a library/app can be omitted if it depends on an ocamlfind package that is not installed, or a library that is omitted)
- C code compilation (automated discovery of compilation units)
- generation of project files (META, .ocamlinit, .merlin)
- a Utop-friendly ocamlfind installation of sublibraries

The last item is a reference to the problem described by Sébastien last Friday. If we have sublibraries foo.bar and foo.baz, requiring foo.bar under the toplevel makes modules of foo.baz visible, while they are not even loaded. One solution we proposed (and used in ketrew) was to define several independent libraries (foo_bar and foo_baz). This solves the issue but didn't feel totally right to me with respect to OPAM, although I acknowledge there are OPAM packages that behave this way, like oasis, ocamlnet and ... ketrew ;o). There is no major constraint that an OPAM package should correspond to exactly one ocamlfind package (could even correspond to 0, for all that matters) but still... Anyway, I found a simple approach to install our libraries as biocaml.async, biocaml.lwt and biocaml.unix *and* make it so that requiring one doesn't show the other. Actually this is a feature of the META file, I didn't have to do much.

There are still some minor issues (related to lack of configuration in solvuu_build, Ashish and I should be taking care of that), but I think this is enough to get started and add new libraries in biocaml. I refrained from pushing to master yet, because I depend on the master branch of solvuu_build and I'd rather wait for a new release of solvuu_build. I'll keep you informed as soon as it's ready. If you want to test it, just pin solvuu_build to #master and biocaml to #solvuu_build.

Any comments welcome, don't hesitate if you have questions.

ph.


Ashish Agarwal

unread,
Feb 24, 2016, 12:17:46 PM2/24/16
to Biocaml
Thanks Philippe. I've tested this, and everything seems to work. A new version of solvuu_build has been released, so that biocaml will compile with the version in opam.

--
You received this message because you are subscribed to the Google Groups "biocaml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biocaml+u...@googlegroups.com.
To post to this group, send email to bio...@googlegroups.com.
Visit this group at https://groups.google.com/group/biocaml.
To view this discussion on the web visit https://groups.google.com/d/msgid/biocaml/CAOOOohTjOgsVNPXMOm0%2BGFP0e7GtLGMgzenTY4y6hF-9KhiMOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Philippe Veber

unread,
Feb 24, 2016, 3:02:42 PM2/24/16
to Biocaml
I've just merged the solvuu_build branch to master. I think the repo is now ready to receive new (sub)libraries, please send issues if it's unclear what to do for this or if it doesn't work the way it should. Note that as we add more libraries and applications, compilation time will increase and it thus could be easier and more efficient to invoke

make lib/biocaml_foo.cma

or

make app/foo.byte

than "make" when you're developing foo. My proposal is then: let's give this system a try and see after some time if it's enough for biocaml's needs, and practical enough for everyone.

Cheers,
  ph.





Reply all
Reply to author
Forward
0 new messages