=========== Compilation =========== .. highlight:: console The Refractor Framework use `CMake `_ as it's build system. Building ======== First create a new directory where compilation will occur. If the :doc:`required dependencies ` are installed in standard locations, then at minimum the configuration of the system can be performed with the following command:: $ cmake /path/to/refractor But to run unit and full tests the ABSCO and MERRA input's location path need to be specified. In that case supply options as follows to CMake:: $ cmake /path/to/refractor -DABSCO_DIR=/path/to/absco -DMERRA_DIR=/path/to/merra Once the build directory has been configured using CMake compilation is done using the standard ``make`` software. With out any arguments the ``all`` target will be use used:: $ make If parallel make will be used it is recommended to run the ``thirdparty`` build target first without the ``-j`` option, for example, build ``all`` from scratch as follows:: $ make thirdparty $ make -j 10 all The following table shows the most meaningful build targets available: ============ =========== Target Description ============ =========== all Builds the thirdparty, full_physics, l2_fp and python targets thirdparty Builds third party software that is packaged with the source full_physics Builds the full_physics library l2_fp Builds the l2_fp binary that uses the full_physics library python Builds the SWIG Python bindings install Installs the built system into the configured prefix, by default /install doc Creates Doxygen API documentation unit_test Runs all unit tests full_test Runs all full tests nose_test Runs all Python Nose tests ============ =========== Using Other Compilers ===================== To use alternative paths to compilers supply the following environmental variables before running ``cmake``. **Note**: These must be defined before the first run of ``cmake``. You will have to use a clean build directory when changing them: ======== =========== Variable Description ======== =========== CC Defines the C compiler, defaults to gcc CXX Defines the C++ compiler, defaults to g++ FC Defines the Fortran compiler, defaults to gfortran ======== =========== The values supplied in these variables must be full paths. For example to use a different version of C++ you could do something like this:: CC=$(which gcc-5) CXX=$(which g++-5) cmake /path/to/refractor If you use these variables in a script they will need to be exported to the shell environment first, the following is equivalent of the above::: export CC=$(which gcc-5) export CXX=$(which g++-5) cmake /path/to/refractor Build Options ============= There are many build options given to CMake that can be used to specify alternative locations of dependencies or to change the way the software is compiled. They are documented below. These are all supplied using the ``-D