Ocsigen's bundle
The Ocsigen bundle is currently the easiest way to compile the whole platform and the Ocaml libraries it depends on. If asked to the bundle may even compile the OCaml compiler (e.g. on linux distribution without the 3.12 release of ocaml).
Main features
- Build and install the whole Ocsigen platform in only one make invocation
- May compile the required OCaml libraries or use a previous installation
- May compile OCaml and Findlib or use a previous installation
- Allow parallel compilation with make -j
- Allow the compilation of latest releases or development versions
- Allow the compilation of yet unreleased projects (OClosure, Ocsimore, Ocsforge)
- Allow the compilation of Oasis (required to build the development version of Lwt)
Download
Latest releases (see CHANGES, small letters in a version number means that only the build system has been updated):
- Ocsigen bundle 2.0.2c (2012-01-05) (signature)
- Ocsigen bundle 2.0.2b (2012-01-03) (signature)
- Ocsigen bundle 2.0.2 (2011-12-16) (signature)
- Ocsigen bundle 2.0.1 (2011-11-18) (signature)
The sources of the bundle are available in its Darcs repository. Browse sources using darcsweb or download them using the command:
darcs get http://ocsigen.org/darcs/bundle/
Howto compile the latest stable release of Ocsigen
In order to compile Ocsigen you will need a working installation of the OCaml compiler and the findlib package manager. See section Building Ocaml, findlib and all the required external OCaml libraries, if your linux distribution doesn't provide an up-to-date OCaml compiler.
On Debian based system, just run:
sudo aptitude install ocaml ocaml-compiler-libs \
camlp4 camlp4-extra \
ocaml-findlib libfindlib-ocaml-dev
You will also need the following OCaml libraries, see section Building external dependencies, if your linux distribution doesn't provide them.
- calendar: http://forge.ocamlcore.org/projects/calendar/
- cryptokit: http://pauillac.inria.fr/~xleroy/software.html#cryptokit
- ocamlnet: http://projects.camlcity.org/projects/ocamlnet.html
- pcre-ocaml: http://www.ocaml.info/home/ocaml_sources.html#pcre-ocaml
- react: http://erratique.ch/software/react
- ocamlssl: http://sourceforge.net/projects/savonet/files/ocaml-ssl/
- ocamlsqlite3: http://www.ocaml.info/home/ocaml_sources.html#ocaml-sqlite3
- ocaml-text: http://forge.ocamlcore.org/projects/ocaml-text/
- camlzip (optionnal): http://pauillac.inria.fr/~xleroy/software.html#camlzip
- ocamlduce (optionnal): http://forge.ocamlcore.org/projects/ocamlduce/
- type-conv (optionnal): http://ocaml.janestreet.com/?q=node/13
and the following C library:
- libev (recommanded): http://software.schmorp.de/pkg/libev.html
On Debian based system:
sudo aptitude install libcalendar-ocaml-dev libcryptokit-ocaml-dev \ libocamlnet-ocaml-dev libpcre-ocaml-dev \ libreact-ocaml-dev libsqlite3-ocaml-dev \ libssl-ocaml-dev libtext-ocaml-dev \ libev-dev ## Optionally sudo aptitude install ocamlduce libzip-ocaml-dev libtype-conv-camlp4-dev
Then configure, build and install the bundle (deriving-ocsigen, lwt, tyxml, js_of_ocaml, ocsigenserver and eliom) with the following commands:
./configure make build sudo make install
By default this will build everything and install them into /usr/local. If you want to use another installation directory, you may pass the --prefix to the ./configure script. If you want to make a local installation, you may also want to change the default ocsigenserver user and group with OCSIGEN_USER and OCSIGEN_GROUP.
./configure --prefix ${HOME}/ocsigen OCSIGEN_USER=${USER} OCSIGEN_GROUP=${USER}
make build install
If you don't use a standard prefix (/usr, /usr/local), you will have to set up some environment variables in order to use the newly installed software: see the end of the installation log or run make printvar to redisplay them.
Howto follow the development version of Ocsigen
To compile the development version of Ocsigen, the darcs and git source managers and the oasis tool are required in complement of the classical external dependencies (see section Compiling the latest stable release of Ocsigen).
sudo aptitude install darcs git oasis
Then, just pass the --enable-dev option to the ./configure script.
./configure --enable-dev make pull make build sudo make install
To update your sources to the latest version, just re-run:
make pull
See also the specific page on using the bundle when developing Ocsigen.
Howto compile unreleased projects
The bundle allows to compile the following projects:
OClosure
To compile the development version of the OClosure library, the darcs version manager and the ocamldsort tool are required.
sudo aptitude install darcs ocamldsort
Then, just pass the --enable-oclosure option to the ./configure script.
./configure --enable-oclosure make pull make build sudo make install
Ocsimore
To compile the development version of Ocsimore, a Postgresql database is required, see the INSTALL file in the Ocsimore source directory for more information.
It also requires the darcs version manager, the oasis tool (>= 0.2.1-alpha1, see section Building external dependencies), and the following external OCaml libraries:
- extlib: http://code.google.com/p/ocaml-extlib/
- csv: http://forge.ocamlcore.org/projects/csv/
- pgocaml: http://pgocaml.berlios.de/
- ocamlpam: http://sharvil.nanavati.net/projects/ocamlpam/
On Debian based system:
sudo aptitude install libextlib-ocaml-dev libcsv-ocaml-dev \
libpgocaml-ocaml-dev libpam-ocaml-dev
Then, just pass the --enable-ocsimore option to the ./configure script.
./configure --enable-dev --enable-ocsimore make pull make build sudo make install
Ocsimore need access to the PostgreSQL database while compiling. If your database isn't automatically detected by the configuration script you may add the following line in a file named Makefile.local at the root of the bundle directory.
OCSIMORE_OPTS := --pghost your_db_host --pguser your_user
Others available options are --pgport --pgpassword. If you prefer those settings not to be memorized you may also set up the environment variables PGHOST, PGUSER, PGPORT or PGPASSWORD.
Ocsforge
To compile the development version of Ocsforge, you also need to compile Ocsimore and to extend its Postgresql database as explained in the INSTALL file of Ocsforge source directory.
It also requires the following C library:
- subversion: http://subversion.apache.org/
On Debian based system:
sudo aptitude install libsvn-dev
Then, just pass the --enable-ocsforge option to the ./configure script.
./configure --enable-dev --enable-ocsimore --enable-ocsforge make pull make build sudo make install
Like Ocsimore, Ocsforge need access to the PostgreSQL database while compiling. If your database isn't automatically detected by the configuration script you may add the following line in a file named Makefile.local at the root of the bundle directory.
OCSFORGE_OPTS := --pghost your_db_host --pguser your_user
Others available options are --pgport --pgpassword. If you prefer those settings not to be memorized you may also set up the environment variables PGHOST, PGUSER, PGPORT or PGPASSWORD.
Macaque
To compile the development version of Macaque, the following external OCaml libraries are required:
- extlib: http://code.google.com/p/ocaml-extlib/
- csv: http://forge.ocamlcore.org/projects/csv/
- pgocaml: http://pgocaml.berlios.de/
On Debian based system:
sudo aptitude install libextlib-ocaml-dev libcsv-ocaml-dev \
libpgocaml-ocaml-dev
Then, just pass the --enable-macaque option to the ./configure script.
./configure --enable-macaque make pull make build sudo make install
Howto build external dependencies
Building missing OCaml libraries
If your linux distribution provides a working Ocaml and findlind installation but not all the required libraries, the bundle is able to detect the missing library and to compile them.
Depending on the missing library, it may require the following external C libraries:
- pcre3: http://www.pcre.org/
- openssl: http://www.openssl.org/
- sqlite3: http://www.sqlite.org/
- linux-pam (ocsimore only): http://www.kernel.org/pub/linux/libs/pam/
On debian based system:
sudo aptitude install libpcre3-dev libsqlite3-dev \
libssl-dev libpam0g-dev
Then, just add the --missing-libs option to your ./configure invocation to detect the missing libraries:
./configure --with-missing-libs ...
Then, build and install the missing libraries with:
make -C others sudo make -C others install
If you use --with-missing-libs in conjonction with --prefix, you may have to set up some environment variables to use the newly installed libraries: see the end of the installation log or run make printvar. You may re-run the script ./configure without the --with-missing-libs option to test your settings.
Building Ocaml, findlib and all the required external OCaml libraries
If your linux distribution does not provides a working Ocaml and findlind installation, the bundle is able to compile OCaml findlib and all the required external OCaml libraries.
The following external C libraries are required:
- ncurses: http://invisible-island.net/ncurses/
- pcre3: http://www.pcre.org/
- openssl: http://www.openssl.org/
- sqlite3: http://www.sqlite.org/
- GNU binutils (optionnal): http://www.gnu.org/software/binutils/
- gdbm (optionnal): http://directory.fsf.org/project/gdbm/
- linux-pam (ocsimore only): http://www.kernel.org/pub/linux/libs/pam/
On Debian based system:
sudo aptitude install libncurses5-dev libpcre3-dev \
libssl-dev libsqlite3-dev \
libgdbm-dev binutils-dev \
libpam0g-dev
Then, just add the --with-ocaml option to your ./configure invocation:
./configure --with-ocaml ...
And finally build and install OCaml and all the required libraries with:
make -C others sudo make -C others install
If you use --with-ocaml in conjonction with --prefix, you may have to set up the PATH environment variable to use the newly installed softwares. You may re-run the script ./configure without the --with-ocaml option to test your settings.
Building Ocamlduce
If your linux distribution does not provides a working Ocamlduce compile, the bundle is able to compile OCamlduce.
just add the --with-ocamlduce option to your ./configure invocation:
./configure --with-ocamlduce ...
And finally build and install OCaml and all the required libraries with:
make -C others sudo make -C others install
If you use --with-ocamlduce in conjonction with --prefix, you may have to set up the PATH environment variable to use the newly installed softwares. You may re-run the script ./configure without the --with-ocamlduce option to test your settings.
Warnings: By default, the options --with-ocaml and --with-ocamlduce are incompatible. See below for workarounds.
Building Ocaml and Ocamlduce
If you want the bundle to compile OCaml and OCamlduce, there is two workarounds:
- if your installation directory is writable without specific rights (i.e. sudo), you may add the --disable-inplacedeps options to your ./configure options (See bundle.dev for more information on this option)
./configure --prefix ${HOME}/ocsigen --disable-inplacedeps \
--with-ocaml --with-ocamlduce
- otherwise, you need to:
- configure the bundle for compiling OCaml only,
- compile and install OCaml,
- reset the bundle,
- reconfigure the bundle for compiling ocamlduce.
./configure --with-ocaml make -C others build sudo make -C others install make -C others distclean ./configure --with-ocamlduce make -C others build sudo make -C others install # Then proceed as usual ./configure ...
Building Oasis
If your linux distribution does not provide the latest version of oasis, the bundle is able to compile it.
The following external OCaml library are required:
- expect: http://forge.ocamlcore.org/projects/ocaml-expect/
- fileutils: http://forge.ocamlcore.org/projects/ocaml-fileutils
- odn: http://forge.ocamlcore.org/projects/odn
- oUnit: http://ounit.forge.ocamlcore.org/
- ocamlgraph: http://ocamlgraph.lri.fr/
- ocamlify: http://forge.ocamlcore.org/projects/ocamlify
- ocamlmod: http://forge.ocamlcore.org/projects/ocamlmod/
On Debian based system:
sudo aptitude install libexpect-ocaml-dev libfileutils-ocaml-dev \
libodn-ocaml-dev libounit-ocaml-dev \
libocamlgraph-ocaml-dev ocamlify
Then, just add the --with-oasis --with-ocamlmod option to your ./configure invocation:
./configure --with-oasis --with-ocamlmod
And finally build and install Oasis with:
make -C others sudo make -C others install
If you use --with-oasis in conjonction with --prefix, you may have to set up the PATH environment variable to use the newly installed software. You may re-run the script ./configure without the --with-oasis option to test your settings.
CHANGES
2.0.2c
- Reallow Ocamlduce compilation.
2.0.2b
- Add –disable-inplacedeps to ./configure options
- Fix bug with findlib installation
2.0.2
- Update pacakges' version:
- deriving-ocsigen-0.3c
- lwt-2.3.2
- js_of_ocaml-1.0.9b
- tyxml-2.0.1c
- ocsigenserver-2.0.2b
- eliom-2.0.2b
- Introduce ./configure
- Allow installation in /usr/local without compiling as root.
2.0.1
- Initial release
