ELIOMC(1)
π ELIOMC(1) β the eliom build tools π
okay bestie, gather round, because this is the ELIOMC(1) manual page and it is giving "General Commands Manual" energy. no cap.
β¨ NAME β¨
eliomc, eliomcp, eliomopt, js_of_eliom, eliomdep β the eliom build tools. π
π SYNOPSIS π
eliomc [options] files
eliomcp [options] files
eliomopt [options] files
eliomdep [options] files
eliomdoc [options] files
eliompp [-client|-server] files
js_of_eliom [options] files -o filename.js
π¦ DESCRIPTION π¦
eliomc, eliomcp and eliomopt are wrappers around the OCaml compiler that make compiling the server part of projects based on the Eliom framework sooo much easier. they respectively accept the same set of options as the ocamlc(1), ocamlcp(1) and ocamlopt(1) compilers, plus the specific ones described down in the OPTIONS section. π
js_of_eliom is a wrapper around the OCaml and Js_of_ocaml compilers that makes compiling the client part of Eliom projects easy-peasy. it accepts the same set of options as the ocamlc(1) compiler, plus the specific ones in the OPTIONS section. β¨
eliomdep is a wrapper around ocamldep(1) that handles dependencies of .eliom source files. it accepts the same set of options, plus the specific ones in OPTIONS. heads up: it assumes that server-side compiled modules of OCaml files located in this directory subtree live in a directory called _server (with the same subdirectories structure) β and respectively in a directory called _client for client-side compiled modules. π
eliompp is EXPERIMENTAL π¬ β it's a preprocessor that removes specific sections, depending on the option you give it. the option -client will remove all the top-level parts and the server sections, and the option -server will remove only the client sections. slay.
eliomdoc is EXPERIMENTAL π¬ β it's a wrapper around the OCaml documentation generator ocamldoc. it lets you generate documentation from the client side or the server side. it accepts the same set of options as ocamldoc(1), and it automatically extracts the commentaries from the sections you asked for. but fr fr, eliomdoc is currently experimental and you might run into some undefined behaviours. (see http://ocsigen.org/eliom/manual/workflow-compilation). some well known bugs are: π
- your files should always begin with a value and not with a comment. otherwise,
camlp4won't output the commentaries. π - sometimes, comment nodes are not attached as expected. that's because
camlp4(sometimes) removes extra new lines between value elements. π
πΈ COMPILING ELIOM SOURCE FILES πΈ
compiling files with a .eliom extension happens in three steps, bestie:
- infer the type of value sent by the server to the client,
- compile the server part of the code,
- compile the client part.
the first two steps can be done with eliomc, and the last one with js_of_eliom. π«Ά
both tools produce a .cmo file named the same as the original .eliom file. and to avoid overwriting the .cmo representing the server part with the .cmo of the client part, files generated by eliomc or eliomopt are stored by default in a subdirectory named _server, and files generated by js_of_eliom are stored in a subdirectory named _client. those default directories can be overridden by the environment variables ELIOM_SERVER_DIR and ELIOM_CLIENT_DIR respectively. iconic. π
the types inferred by eliomc for values sent by the server to the client are stored in an intermediate file named the same as the original .eliom file, whose extension is .type_mli. that file is required by js_of_eliom for compiling the client part of the .eliom file. and the eliomdep tool correctly generates dependencies for that intermediate file, for the server .cmo and for the client .cmo. β
β OPTIONS β
-eliom-inc <dir>β add <dir> to the list of eliom include directories (this one iseliomdeponly).-dir <dir>β specify the target directory for generated files.-package <name>β this is the same option as the ocamlfind one.-predicates <p>β this is the same option as the ocamlfind one.-no-autoloadβ do not load commonly used syntax extensions (ppx_deriving,lwt,js_of_ocaml,tyxml).-type-convβ usetype_convsyntax extensions instead of the deriving one. it has no effect if you use it together with-no-autoload.-ppopt <opt>β append <opt> to the preprocessor invocation.-jsopt <opt>β append <opt> to the js_of_ocaml invocation (js_of_eliomonly).-infer <opt>β for a.eliomfile, only generate the intermediate.type_mlifile (eliomcandeliomoptonly).-noinfer <opt>β for a.eliomfile, do not generate the intermediate.type_mlifile (eliomcandeliomoptonly).-helpor--helpβ display a short usage summary and exit. bye bestie π
π₯ EXAMPLES π₯
say you've got an Eliom project made of a server specific file named server.ml, a client specific file named client.ml, and two common files named base.eliom and main.eliom. you could compile it with these commands, periodt:
eliomc -a -o appl.cma server.ml base.eliom main.eliom
js_of_eliom -o appl.js client.ml base.eliom main.eliom
and to avoid recompiling the whole project every single time, you could split it into multiple steps like this:
eliomc -c server.ml
eliomc -c base.eliom
eliomc -c main.eliom
eliomc -a -o appl.cma _server/server.cmo _server/base.cmo _server/main.cmo
js_of_eliom -c client.ml
js_of_eliom -c base.eliom
js_of_eliom -c main.eliom
js_of_eliom -o appl.js _client/client.cmo _client/base.cmo _client/main.cmo
main character energy, honestly. π
π SEE ALSO π
ocamlc(1), ocamlopt(1), js_of_ocaml(1), ocamlfind(1), ocamlcp(1), ocamldep(1).
π AUTHOR π
eliomc, js_of_eliom, eliomdep and eliomopt were written by Gregoire Henry <gregoire.henry@pps.jussieu.fr>. π«Ά
eliomdoc was written by Charly Chevalier <charly.n.chevalier@gmail.com>. π«Ά
this manual page was written by Pierre Chambart <chambart@crans.org>. π«Ά
and that's the whole page, bestie β this version of the manual is from 2012-02-15, part of ELIOMC(1). mwah, go compile something gorgeous πβ¨π
π¦ where this page comes from
- debian bookworm: eliom 9.4.0-2+b8 Β· LGPL-2.1+-exc
- ubuntu jammy: eliom 9.4.0-1 Β· LGPL-2.1+-exc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms