These instructions show how to build ProbABEL.

* Dependencies
  ProbABEL can be compiled without depending on other
  libraries. However, when the Eigen library is present
  (http://eigen.tuxfamily.org) matrix manipulation is much more
  efficient and fast. On Debian/Ubuntu systems the Eigen library can
  be installed in the following way:
apt-get install libeigen3-dev

  If you install the eigen library by hand (e.g. after downloading the
  files from the aforementioned website) you have to specify the
  location of the header files when running ./configure (see below):
./configure --with-eigen-include-path=/your/path/to/eigen
  The default for this option is /usr/include/eigen3. This is the
  directory in which files like Eigen/Dense and Eigen/Cholesky can be
  found.

  If ./configure cannot find the Eigen library it will say so. To
  disable the use of Eigen (even if the library is present) use:
./configure --without-eigen


* Compiling for Linux
  If you downloaded the source from SVN (this is not necessary when
  installing from the distributed .tar.gz file), run:
autoreconf -i
  to generate the ./configure script and some other files.

  Now, you are ready to compile and install the package. Run the
  following commands:
./configure
make
make check
make install

  This will install the binaries (palinear etc.) in /usr/local/bin/,
  the documentation in /usr/local/share/doc/probabel/, the
  probabel_config.cfg file in /usr/local/etc/, and the examples in
  /usr/local/share/ProbABEL/examples/. The ./configure script tests
  for the presence of the pdflatex program. If it is not present the
  PDF version of the documentation will not be built.

  NOTE: make install will OVERWRITE any file with the same name if it
  already exists. By default the name of the probabel config file is
  probabel_config.cfg.example. For probabel to work please rename
  this file to probabel_config.cfg.

  To see options, run
./configure --help

  The most notable option is
./configure --prefix=/some/subdirectory
  to install ProbABEL in that subdirectory. Instead of using
  /usr/local/ as install root directory, it installs in /some/subdirectory.

  ProbABEL consists of three main programs: palinear, palogist and
  pacoxph. Building of each of these programs can be disabled by
  adding a --disable- option to configure, for example:
./configure --disable-palinear


* Options for developers
  To generate a .tar.gz package for distribution run:
./configure
make dist

  To test if all your changes to the source files will be packaged
  into the tar.gz file correctly (as well as several other basic
  checks) run
./configure
make distcheck
  This will try to build the project in a different (temporary)
  directory. Since it also runs ./configure in this build directory
  you may want to specify options to that configure run as well (the
  ones you specified when running ./configure earlier won't be
  "transmitted" to this run). This can be done as in the following
  example:
DISTCHECK_CONFIGURE_FLAGS="--without-eigen" make distcheck

  To clean up all files generated by ./configure and make, run
make distclean

  Running
make uninstall
  will uninstall the files previously installed by 'make install'.


* Making packages for Linux distributions
  Instructions for creating a package for your favourite Linux
  distribution can be found in doc/packaging.txt


* Cross-compiling for Windows on Linux
  The following steps show how to compile 32bit windows binaries on a
  Linux machine.
  First, install the necessary MINGW32 packages. On Debian/Ubuntu this
  can be done in the following way:
apt-get install mingw32{-binutils,-runtime} gcc-mingw32
  For 64 bit windows install these packages:
apt-get install binutils-mingw-w64-i686 gcc-mingw-w64-base gcc-mingw-w64-i686 \
  mingw-w64-dev g++-mingw-w64 binutils-mingw-w64-x86-64 g++-mingw-w64-i686 \
  g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64

  Now the binaries can be compiled (I've added a prefix so that when
  running 'make install' the whole directory structure can be zipped
  easily):
./configure --host=i686-w64-mingw32 --build=i686-linux-gnu \
            --prefix=/tmp/PA --sysconfdir=/tmp/PA/ \
            --datarootdir=/tmp/PA --docdir=/tmp/PA/doc

  The --host option sets the type of the host the programs will be run
  on, the --build option sets the type of machine you are building the
  package on (cf. the Autoconf manual:
  http://www.gnu.org/software/hello/manual/autoconf/Specifying-Target-Triplets.html). In
  this example I was using a 32bit Ubuntu install. For a 64 bit linux
  system this will be x86_64-linux-gnu. Note that the values for both
  these options can be derived from the names of the compiler
  executables, e.g. the gcc-mingw-w64 Debian package installs the
  following C++ compilers: /usr/bin/i686-w64-mingw32-c++ and
  /usr/bin/x86_64-w64-mingw32-c++.
  The --[somedir] options are used to make the directory structure as
  flat as possible so that we don't bother Windows users with
  subdirectories like 'share/' and 'etc/'.

  Now you can run
make CFLAGS+="-O2 -static-libgcc -static-libstdc++ -D_NOT_R_FILEVECTOR" \
     CXXFLAGS+="-O2 -static-libgcc -static-libstdc++ -D_NOT_R_FILEVECTOR"
make install

  This creates the binaries pacoxph.exe, palinear.exe and
  palogist.exe (as well as the examples and documentation). The
  contents of /tmp/PA can then be zipped and distributed.
