2018-03-22 18:11:39 +01:00
.. highlight :: bash
.. _install:
2021-08-18 22:00:28 +02:00
Install app4triqs
***** ***** ***** *** *
2019-04-24 21:19:25 +02:00
Compiling app4triqs from source
2019-04-25 20:26:36 +02:00
===============================
2018-03-22 18:11:39 +01:00
2021-08-18 22:00:28 +02:00
.. note :: To guarantee reproducibility in scientific calculations we strongly recommend the use of a stable `release <https://github.com/TRIQS/triqs/releases> `_ of both TRIQS and its applications.
2018-03-22 18:11:39 +01:00
2019-04-24 21:19:25 +02:00
Prerequisites
-------------
2018-03-22 18:11:39 +01:00
2019-04-16 21:04:04 +02:00
#. The :ref: `TRIQS <triqslibs:welcome>` library, see :ref: `TRIQS installation instruction <triqslibs:installation>` .
2019-04-24 21:19:25 +02:00
In the following, we assume that TRIQS is installed in the directory `` path_to_triqs `` .
2018-03-22 18:11:39 +01:00
Installation steps
------------------
2019-04-16 21:04:04 +02:00
#. Download the source code of the latest stable version by cloning the `` TRIQS/app4triqs `` repository from GitHub::
2018-03-22 18:11:39 +01:00
2019-04-16 21:04:04 +02:00
$ git clone https://github.com/TRIQS/app4triqs app4triqs.src
2018-03-22 18:11:39 +01:00
2019-04-16 21:04:04 +02:00
#. Create and move to a new directory where you will compile the code::
2018-03-22 18:11:39 +01:00
$ mkdir app4triqs.build && cd app4triqs.build
2019-04-16 21:04:04 +02:00
#. Ensure that your shell contains the TRIQS environment variables by sourcing the `` triqsvars.sh `` file from your TRIQS installation::
2018-03-22 18:11:39 +01:00
2020-09-23 18:10:27 +02:00
$ source path_to_triqs/share/triqs/triqsvars.sh
2018-03-22 18:11:39 +01:00
2019-04-16 21:04:04 +02:00
#. In the build directory call cmake, including any additional custom CMake options, see below::
2018-03-22 18:11:39 +01:00
$ cmake ../app4triqs.src
#. Compile the code, run the tests and install the application::
$ make
$ make test
$ make install
Version compatibility
---------------------
2019-04-24 21:19:25 +02:00
Keep in mind that the version of `` app4triqs `` must be compatible with your TRIQS library version,
see :ref: `TRIQS website <triqslibs:versions>` .
In particular the Major and Minor Version numbers have to be the same.
To use a particular version, go into the directory with the sources, and look at all available versions::
2019-04-16 21:04:04 +02:00
$ cd app4triqs.src && git tag
Checkout the version of the code that you want::
$ git checkout 2.1.0
2019-04-24 21:19:25 +02:00
and follow steps 2 to 4 above to compile the code.
2018-03-22 18:11:39 +01:00
Custom CMake options
--------------------
2019-04-24 21:19:25 +02:00
The compilation of `` app4triqs `` can be configured using CMake-options::
2018-03-22 18:11:39 +01:00
2020-06-10 22:47:19 +02:00
cmake ../app4triqs.src -DOPTION1=value1 -DOPTION2=value2 ...
2019-04-16 21:04:04 +02:00
+-----------------------------------------------------------------+-----------------------------------------------+
| Options | Syntax |
+=================================================================+===============================================+
| Specify an installation path other than path_to_triqs | -DCMAKE_INSTALL_PREFIX=path_to_app4triqs |
+-----------------------------------------------------------------+-----------------------------------------------+
| Build in Debugging Mode | -DCMAKE_BUILD_TYPE=Debug |
+-----------------------------------------------------------------+-----------------------------------------------+
| Disable testing (not recommended) | -DBuild_Tests=OFF |
+-----------------------------------------------------------------+-----------------------------------------------+
| Build the documentation | -DBuild_Documentation=ON |
+-----------------------------------------------------------------+-----------------------------------------------+