Build instructions
==================

ReSCAL package includes a number of programs located in src directory.

It has a standard build procedure. From the ReSCAL directory, type 
the following commands:

./configure
make

Note: If your installed version of automake does not match, run the 
autoreconf command and try again, or jump to the alternative 
procedure described in §5.

To compile with AVX optimizations, use the following syntax:
./configure --enable-avx

Complete syntax is available when typing:
./configure --help

Needed development libraries are glib-2.0, gtk+-2.0, gdk-pixbuf, libpng 
and pthread.


1. Compiling on Linux
----------------------
Please make sure that the packages gcc, pkg-config and libgtk2.0-dev are 
installed.

Tested on Ubuntu 14.04 to 18.04


2. Compiling on MacOS X
-----------------------
Needed packages are automake and gtk+.  It can be installed with 
Homebrew. It may also help to initialize CFLAGS variable while 
running the configure script, as below:
CFLAGS='-I/usr/local/include -L/usr/local/lib' ./configure

Then type:
make

2.1 with GCC
------------
The default gcc command is merely a link to CLang. One has to
install it explicitly with Homebrew or MacPorts. Then make sure
to call gcc and not cc (i.e. CLang), before starting the standard
build procedure. The recommended solution is to edit the CC 
environment variable.

CC='/usr/local/bin/gcc-6' ./configure
make

2.2 with Clang
--------------
It is likely that your version of Clang does not support OpenMP,
in which case you'll have to install OpenMP libraries:
brew install clang-omp

Then (on Mac OS X 10.11):
export CFLAGS='-I/usr/local/include/libiomp -liomp5' 
./configure
make

Alternatively, one may discard OpenMP code by commenting out the 
OPENMP option in src/defs.h file.


3. Compiling with ICC (Intel C compiler)
----------------------------------------
To take advantage of Intel's compiler specifities, just type:
cd src
make -f makefile.icc

Note: ReSCAL seems to run faster with ICC than with GCC, at least on
Intel Xeon processors.

Tested with ICC 13.0 and 15.0 (64bits).


4. Compiling on Windows
-----------------------
The ReSCAL softwares may be compiled using Cygwin/X environment.
Web site: x.cygwin.com 

Note: Since OpenMP is not yet supported by the 32 bits version of gcc
in Cygwin, you should rather install Cygwin in 64 bits.


5. Alternative procedure
------------------------
There is a the customizable makefile located in src directory, that 
may work out of the box on most Unix-like systems.
cd src
make -f makefile.default

If errors still occur, please check the variables in makefile.default
and/or install missing libraries.


6. Contacts
-----------
Olivier Rozier - rozier@ipgpfr
Antoine Lucas - dralucas@geophysx.edu.eu.org (MacOS)

