Installing OCaml and Camlp5 to compile GeneWeb
Installing OCaml and Camlp5 through OPAM (OCaml preferred package manager) allows the installation of the two versions of OCaml needed for GeneWeb:
- Old GeneWeb versions (lower than 7.00) should be compiled with OCaml version 3.12.1.
- Starting at version 7.00, GeneWeb must be compiled with OCaml >4.02.
Camlp5 must be installed for each version of the compiler.
When Ocaml and camlp5 are installed, you can clone repository to compile GeneWeb.
Under Windows using Cygwin
This has been tested on Windows 7 x64 and x86 in September 2016:
If you have Windows Powershell (embedded in Windows since XP SP2), this batch script will download/compile/install Cygwin/Opam/OCaml/Camlp5/Ocamfind/GeneWeb for you. You can download the script copying this line on a Windows prompt (command line) with administrator rights:
powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('https://gist.github.com/a2line/f134c88c80eafcf0411b38e32a0a7128/raw/','opamwin.bat')
Then just launch the script typing
opamwin in the same console to install everything.
A temporary fix for issue #58 to fix native executable problem on Windows : the part of the script that compile GeneWeb itself contains a switch to the commit of the 8 may 2016 (
git checkout -b win8mai 6a87ebef17af1d28ae6c1a3c6e4e1116dc737f28). Without it, since that date, you will compile smaller exe that work only in Cygwin.
This has been tested on a Debian in november 2015 (debian-8.2.0-i386-netinst.iso).
To install Opam/OCaml (4.02.3)/Camlp5 (6.14)/ocamlfind (1.6.2):
apt-get install opam opam init opam update opam switch 4.02.3 opam install -y camlp5 ocamlfind eval 'opam config env'
If ocamfind install fails with opam, try installing pkg-config before with
apt-get install pkg-config, then retry.
To build previous versions of GeneWeb you need to switch to OCaml 3.12.1 with Opam:
opam switch 3.12.1 opam install -y camlp5 ocamlfind eval 'opam config env'
When using Opam on old sources, we need to replace the path to Camlp5
tools/Makefile.inc with a sed command after configuring Makefile:
./configure sed -i 's|CAMLP5D=+camlp5|CAMLP5D=~/.opam/3.12.1/lib/camlp5|' tools/Makefile.inc make make distrib
You can check the path to Camlp5 with
ocamlfind query camlp5, for this exemple camlp5 lib is in
Under OS X
This has been tested on OSX El Capitan 10.11.6 in september 2016.
To install Opam/OCaml the best way is to install the corresponding packages with Homebrew, a package management software. You have to install first homebrew in Terminal application as explained by pasting this command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once homebrew is installed you can easily install Opam in Terminal application with these commands:
brew install opam opam init opam update opam switch 4.02.3
and then OCaml:
opam install -y camlp5 ocamlfind eval `opam config env`
Before compiling GeneWeb you need to update bash with homebrew in Terminal application:
brew install bash
Do not take into account the caveats about bash path. You can now download and compile GeneWeb.
Clone repository and compile GeneWeb
git clone https://github.com/geneweb/geneweb git pull ./configure && make && make distrib
If GeneWeb compilation fails, look at continuous integration tools to see if lastest build is passing on your plateform.