**** PREPARATION ****

For compiling Normaliz the following libraries are needed:
* gmp with gmpxx
* boost (headers only)
* openmp enabled compiler (to use parallelization)

On Ubuntu the following packages should be installed:
apt-get install g++ libgmp-dev libboost-dev cmake cmake-curses-gui

We offer two ways of compilation, eighter use the supplied makefile or use cmake to create a more powerfull makefile. cmake is also capable of generating compile instructions for other systems, like MS VS projects, etc.



**** MAKE ****

A1) Go to the source directory
A2) Check the configurations in Makefile.configuration
A3) Say "make"
It should work without changing the Makefile on many systems that have a system installation of the needed librarys.



**** CMAKE ****

This has better capabilities to find libraries and allow to change settings with a nice interface. Furthermore it supports the compilation of the library as static and dynamic version, installation of the library.


We assume you start in the normaliz root dir (with subdirs source, examples, ...).

B1) Create a build directory where normaliz will be build and cd into it, e.g.
  mkdir BUILD; cd BUILD

B2) Initial configuration, have a look at the end of the file for further config infos.
(can be skipped if step B3 is done, but it shows some information about what compiler, libraries, etc. it uses)
  cmake ../source

B3) (Optional) Check configuration and maybe edit something
  ccmake ../source
In the ccmake interface you can use this workflow:
* c  (for configure)
* change entries if you like, then press c again
* g  (generate and exit)

B4) compile
  make
This make has dependency checking included and other nice features.
If you want to see what happens behind the scenes use
  make VERBOSE=1

B5) install it
  make install
This will install the produced libnormaliz and the normaliz executable.
The path can be changed with ccmake (CMAKE_INSTALL_PREFIX).


**** ADDITIONALLY CMAKE CONFIGURATION ****

If you want to overide system defaults you can change values with ccmake or set enviroment variables.
IMPORTANT NOTE: Be aware that some of these only work with the first call of cmake. If you want to change it later clean your build directory first, or use another fresh build directory.
Some examples:
Different compiler:
  CC=gcc-4 CXX=g++-4  cmake  ../source/

To specify search paths for gmp you can add before the cmake
GMP_INC_DIR=/path/to/include  (for headers)
GMP_LIB_DIR=/path/to/lib     (for libs)
GMP_DIR=/path/to/gmp        (for both)

e.g. on my linux laptop I can do
GMP_DIR=~/usr/local/   cmake   ../source/
to use my locally installed gmp version

Change architecture:
For MacOS you can set CMAKE_OSX_ARCHITECTURES eigther with the cmake command-line option
-DCMAKE_OSX_ARCHITECTURES=x86_64
or by setting it in ccmake to x86_64.
See also: http://stackoverflow.com/questions/5334095/cmake-multiarchitecture-compilation


Specify Boost dirs
BOOST_ROOT                 - Preferred installation prefix
BOOST_INCLUDEDIR           - Preferred include directory e.g. <prefix>/include
BOOST_LIBRARYDIR           - Preferred library directory e.g. <prefix>/lib
Boost_NO_SYSTEM_PATHS      - Set to ON to disable searching in locations not
                             specified by these hint variables. Default is OFF.
Boost_ADDITIONAL_VERSIONS  - List of Boost versions not known to this module
                             (Boost install locations may contain the version)
See http://www.cmake.org/cmake/help/git-master/module/FindBoost.html
