A preamble on Ocaml packaging and Mac OS X
Although OCaml is available as binary packages for Mac OS X, the problem is that this kind of distribution cannot easily be complemented by various packages available from the Caml Hump (an Ocaml equivalent of CPAN for Perl).
This is fine as long as one only wants to experiment with the language.
Beyond this, any work involving some pragmatic issues such as database persistence or internationalization, needs to be based one way or another on the functionality offered by the standard packages provided by the Ocaml community.
An example of this is the Camomile library, which is the de-facto standard to handle Unicode characters in Ocaml,
yet is not included in the standard Ocaml distribution.
As opposed to Java, there is no simple way to drop a library (such as a jar file) in some agreed directory.
The current Ocaml ecosystem relies on a source based package being built, compiled, tested, and installed into the Ocaml environment, in a fashion similar to Perl 5. Depending on the specifics of a package and on version considerations, this could lead to some serious headache(s).
Most of this package installation work is already automated through the GODI system, in essence a packaging system similar to Perl 5's CPAN shell on UNIX systems (or the Perl Package Manager on Windows).
My next post will cover some steps I went through on my Mac in order to complete the installation of GODI and of some packages required by my home project.
Suffice to say that GODI relies on more than just the default OS X functions. As highlighted in the high level view of my setup below,

a first prerequisite is that a version of the Xcode tools (including the gcc compiler) be installed on the OS X environment. This will allow GODI to compile the Ocaml distribution (e.g. 3.10) that it includes.
Another prerequisite is that GODI itself and some packages it installs, might rely on additional programs or tools not directly included into the Mac OS X environment or Xcode itself. This is where Fink can assist. Examples of such additional programs / tools provided through Fink:
- the PostgreSQL 8.0 database package
- the GNU Make utility
This overview was a needed preamble before diving into more technical matters in forthcoming posts.
Cheers
As a footnote: a more thorough coverage of possible options for Ocaml on Mac OS X, is available here.
This is fine as long as one only wants to experiment with the language.
Beyond this, any work involving some pragmatic issues such as database persistence or internationalization, needs to be based one way or another on the functionality offered by the standard packages provided by the Ocaml community.
An example of this is the Camomile library, which is the de-facto standard to handle Unicode characters in Ocaml,
yet is not included in the standard Ocaml distribution.
As opposed to Java, there is no simple way to drop a library (such as a jar file) in some agreed directory.
The current Ocaml ecosystem relies on a source based package being built, compiled, tested, and installed into the Ocaml environment, in a fashion similar to Perl 5. Depending on the specifics of a package and on version considerations, this could lead to some serious headache(s).
Most of this package installation work is already automated through the GODI system, in essence a packaging system similar to Perl 5's CPAN shell on UNIX systems (or the Perl Package Manager on Windows).
My next post will cover some steps I went through on my Mac in order to complete the installation of GODI and of some packages required by my home project.
Suffice to say that GODI relies on more than just the default OS X functions. As highlighted in the high level view of my setup below,

a first prerequisite is that a version of the Xcode tools (including the gcc compiler) be installed on the OS X environment. This will allow GODI to compile the Ocaml distribution (e.g. 3.10) that it includes.
Another prerequisite is that GODI itself and some packages it installs, might rely on additional programs or tools not directly included into the Mac OS X environment or Xcode itself. This is where Fink can assist. Examples of such additional programs / tools provided through Fink:
- the PostgreSQL 8.0 database package
- the GNU Make utility
This overview was a needed preamble before diving into more technical matters in forthcoming posts.
Cheers
As a footnote: a more thorough coverage of possible options for Ocaml on Mac OS X, is available here.
Comments
Post a Comment