[opam-devel] Parallel builds

Markus Mottl markus.mottl at gmail.com
Mon Jul 8 14:53:22 BST 2013

I agree that hard-coding does not seem like a good idea.  It should be
possible for users to specify the level of parallelism in a
configuration file or environment variable.  I think this should
actually be supported by OPAM, because different packages may use
different build systems.  Maybe OPAM, which is pretty much already the
de-facto standard OCaml package manager, can pass a standardized
environment variable to the build process so that package maintainers
can query it for the level of parallelism?


On Mon, Jul 8, 2013 at 5:25 AM, Thomas Gazagnaire <thomas at ocamlpro.com> wrote:
>> Many packages seem to use Oasis for building, but I couldn't find any
>> package specification that calls the build process in a way that
>> allows for parallel builds.
>> E.g. I might want to specify this in an OPAM package (i.e. use up to 4 CPUs):
>>  ["ocaml" "setup.ml" "-build" "-j 4"]
>> Does anybody have objections to parallel builds?  Any suggestions
>> concerning their number?  I think it should generally work fine and
>> give a typical speedup of maybe around 20%.
> Is there any way to specify that "j" argument on the command-line ? That would be quite handy if the is the case, as you could simply do: `OASISJOBS=4 opam install foo`
> I feel not very satisfactory to hard-code the number of jobs in the OPAM file, though.
> --
> Thomas

Markus Mottl        http://www.ocaml.info        markus.mottl at gmail.com

More information about the opam-devel mailing list