Re: Which build tool to use?

"Ashish Agarwal [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <CAMu2m2JcE6A5AHKMD_KCmrXn-C4BOxv2X_vsg8GuUktUQJOV6g@mail.gmail.com>
Unfortunately, there is no great answer to this question. Everyone in the
OCaml community is continuously frustrated by our choices for a build tool.
It turns out making a good build tool is pretty hard and people's needs are
very different. With that caveat, here's some advice:

- Oasis. Use if your build is fairly simple. Try it. If it works, no need
to waste time on other tools. You'll be a little frustrated by the fact
that it modifies checked-in files, but eventually you'll find this can be
avoided. If you need to do lots of custom things, like pre-process a file
or auto-generate some code, you'll start feeling that oasis isn't right for
you.

- OMake. Use if you want something like make, but that is just a bit
better. The semantics and syntax of omake are rather frustrating, but
eventually you can accomplish anything you want. The authors were sensible
enough to provide a long manual, but numerous important concepts are still
not covered.

- OCamlbuild. Instead of omake, you might try ocamlbuild. For very simple
projects, it is very simple, even simpler than oasis. However, as soon as
you need to customize anything, you'll need to learn about its particular
build model, and start writing plugins. Historically this was not easy to
learn because the so-called manual was ridiculously brief. Thankfully a new
manual was just announced [1]. I'm not convinced that its model of a build
is intuitive, but I've heard others say it is good.

- Jenga. It mostly takes the right approach. The tool is an OCaml library,
so you have the full power of OCaml to write your build system. High level
functions are provided to make easy things easy. Unfortunately, it's not
quite there yet, and I recommend you don't spend any time on it yet.
There's essentially no documentation. The supposedly simple functions are
not so simple; I could never figure out the semantics of some of them.

- Assemblage. It's promising but not ready yet.

- OCamlMakefile. A pre-written Makefile. I haven't used it myself, but
supposedly it is good enough for many projects.


[1] https://sympa.inria.fr/sympa/arc/caml-list/2015-09/msg00089.html




On Thu, Sep 17, 2015 at 4:09 AM, Magnus Therning [email protected]
[ocaml_beginners] <[email protected]> wrote:

>
>
> Hello,
>
> I'm dipping my toes into the OCaml waters again. I'm working on a
> project implemented in C/C++, it's lacking tests in many areas, some of
> which require having a server process running. I thought I'd start with
> using OCaml to implement a mock server so I can test the client libs.
>
> The C/C++ project uses CMake to build and now I'd like to plug my OCaml
> build into it, but what to use?
>
> So far I've simply run `corebuild` (a simple wrapper around
> `ocamlbuild`), but that leaves some build stuff in the source folder
> (that sort of breaks with CMake's tradition of building out-of-source).
>
> I've found at least two OCaml build tools, `omake` and `oasis` (besides
> `ocamlbuild`). Is anyone preferred over the other for new projects?
>
> /M
>
> --
> Magnus Therning OpenPGP: 0xAB4DFBA4
> email: [email protected] jabber: [email protected]
> twitter: magthe http://therning.org/magnus
>
> For every problem there is a solution which is clear, simple, and
> wrong.
> -- HL Mencken
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.