2018-03-22 18:11:39 +01:00
|
|
|
.. highlight:: bash
|
|
|
|
|
|
|
|
.. _install:
|
|
|
|
|
2019-04-16 21:04:04 +02:00
|
|
|
Compiling AP4TRIQS from source
|
|
|
|
==============================
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
Prerequisite
|
|
|
|
-------------------
|
|
|
|
|
2019-04-16 21:04:04 +02:00
|
|
|
#. The :ref:`TRIQS <triqslibs:welcome>` library, see :ref:`TRIQS installation instruction <triqslibs:installation>`.
|
|
|
|
In the following, we assume that Triqs is installed in the ``path_to_triqs`` directory.
|
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
|
|
|
|
|
|
|
$ source path_to_triqs/share/triqsvarsh.sh
|
|
|
|
|
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-16 21:04:04 +02:00
|
|
|
Be careful that the version of the TRIQS library and of the application must be
|
2018-03-22 18:11:39 +01:00
|
|
|
compatible (more information on the :ref:`TRIQS website <triqslibs:versions>`).
|
2019-04-16 21:04:04 +02:00
|
|
|
In particular you should make sure that the Major and Minor Version number
|
|
|
|
of the application and TRIQS agree.
|
|
|
|
If you want to use a particular version of the application, go into the directory with the sources
|
|
|
|
and look at all available versions::
|
|
|
|
|
|
|
|
$ cd app4triqs.src && git tag
|
|
|
|
|
|
|
|
Checkout the version of the code that you want::
|
|
|
|
|
|
|
|
$ git checkout 2.1.0
|
|
|
|
|
|
|
|
Then follow the steps 2 to 4 described above to compile the code.
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
Custom CMake options
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
Functionality of ``app4triqs`` can be tweaked using extra compile-time options passed to CMake::
|
|
|
|
|
2019-04-16 21:04:04 +02:00
|
|
|
cmake ../app4triqs.src -DOPTION1=value1 -DOPTION2=value2 ... ../app4triqs.src
|
|
|
|
|
|
|
|
+-----------------------------------------------------------------+-----------------------------------------------+
|
|
|
|
| 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 |
|
|
|
|
+-----------------------------------------------------------------+-----------------------------------------------+
|