OCaml Forge

Detail: [#850] Provide way to set default ocamlbuild flags

Feature Requests: Browse | Download .csv | Monitor

[#850] Provide way to set default ocamlbuild flags

2010-12-29 22:29
Submitted by:
Török Edwin (edwin)
Assigned to:
Sylvain Le Gall (gildor-admin)
Due in version:
Plugin OCamlbuild
Operating System:
Provide way to set default ocamlbuild flags

Detailed description
I like parallel builds by default, but there is no easy way to specify "-j N" to the oasis generated build system.
One way is 'ocaml setup.ml -configure --override ocamlbuildflags "-j 6"', but that is cumbersome.

It'd be nice if there was a way to specify this in _oasis, or if the build system would automatically use at least -j N, where N is nr of cores.


Date: 2012-03-13 14:38
Sender: Gabriel Scherer

I come at this bug again for a different reason, not (-j N) related. I want to add an _oasis to a project with an existing _tags file, and not have to change it. My problem is that it uses the new and handy package(foo) ocamlfind-related syntax, which only works if ocamlbuild is invoked with the option -use-ocamlfind. I would like to be able to tell oasis to add the option -use-ocamlfind when invoking ocamlbuild.

PS: I understand there is a different way to do this, by using "pkg_foo" in the _tags and letting oasis generate an appropriate myocamlbuild.ml. But first, I think oasis should be as easy as possible to insert gradually in an existing build system (I really do not want to start messing with the _tags file), and first I think that a generic solution to pass ocamlbuild flags is needed: it's not realistic that you would come up with surface syntax for every possible use cases (which could keep growing when ocamlbuild gets more features).
Date: 2010-12-30 08:04
Sender: Török Edwin

Sure setup-dev is fine, that is where I care about speed.
Ocaml build are otherwise fast enough for a release build (compared to C or C++ builds at least).
Date: 2010-12-29 23:45
Sender: Sylvain Le Gall

The determination of the number of cores is not that simple and would imply non portable code, which I would like to avoid.

However, it can be something guessed in setup-dev mode. It means that you will benefit of the speedup "automatically" when you are in developper mode and you will fallback to dump option for package you distribute (there will always be the override you talk about).

Does this solution match your need ?

Attached Files:


Field Old Value Date By
assigned_tonone2010-12-29 23:50gildor-admin