Am Montag, den 31.10.2011, 15:27 +0000 schrieb David Allsopp: > Andreea Costea wrote: > > For some days now, I was searching to see if there is any way you can build > > an executable from an OCaml project, that can later be run from another > > machine that doesn't have OCaml installed on (not even the runtime system). > > Same type of Unix based OS, though. > > Compile it with ocamlopt instead of ocamlc - Chapter 11 of the manual (which > it's a little surprising you hadn't got to, if you've been looking for a few > days)... http://caml.inria.fr/pub/docs/manual-ocaml/manual025.html > > "This chapter describes the OCaml high-performance native-code compiler > ocamlopt, which compiles Caml source files to native code object files and > link these object files to produce standalone executables."
If you need to stay with ocamlc, you can also set the -custom option. In this case, the whole runtime system is included into the link, and the resulting executable only depends on the C libraries pulled in. Gerd > > > David > > > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany [email protected] Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
