2. Install¶
2.1. Download¶
You can download the source code for TeNeS from the GitHub page . If you have git installed on your machine, type the following command to start downloading:
$ git clone https://github.com/issp-center-dev/TeNeS
2.2. Prerequisites¶
The following tools are required for building TeNeS.
C++17 compiler
For Intel compilers, use the newer
icpx; the classicicpccannot compile mptensor. Note thaticpxenables-fp-model=fastby default, which breaks Inf/NaN handling; the TeNeS build automatically adds-fp-model=preciseto avoid this.
CMake (>=3.8.0)
BLAS and LAPACK
TeNeS depends on the following libraries, but these are downloaded automatically through the build process.
TeNeS can use MPI and ScaLAPACK for parallel operations of tensors. MPI and ScaLAPACK must be installed by yourself. For example, if you use Debian GNU/Linux (or Debian based system such as Ubuntu) and have root priviledges, you can easily install them by the following:
sudo apt install openmpi-bin libopenmpi-dev libscalapack-mpi-dev
For others, see the official instruction of some MPI implementation and ScaLAPACK.
TeNeS can also use ARPACK-NG as an optional dependency.
When it is installed, CMake detects and links it automatically, and it is used as the
eigensolver for the transfer matrices in the correlation-length measurement
(see the eigensolver parameter of the correlation_length section of the input file).
TeNeS builds and runs fine without it (the builtin solver is used instead).
On Debian GNU/Linux (or Debian based systems such as Ubuntu), it can be installed by
sudo apt install libarpack2-dev
and on macOS (Homebrew) by
brew install arpack
Python3 is required for the input file generators, tenes_simple and tenes_std .
Additionary, the following python packages are also required.
numpy
scipy
toml
2.3. Install¶
Build TeNeS by typing the following commands (Some environment such as CentOS provides CMake3 as
cmake3):
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=<path to install to> ..
$ make
The default value of the <path to install to> is /usr/local.
Parallel Build
The make command accepts -j <num> options and then uses <num> processes for a parallel building.
This reduces the time to build TeNeS drastically.
The executable file tenes will be generated in build/src directory.
By typing the following command, tests for tenes can be done.
$ make tests
Install TeNeS by typing the following commands:
$ make install
In this case, tenes, tenes_std and tenes_simple are installed into the <path to install to>/bin .
Disable MPI/ScaLAPACK parallelization
If you want to disable MPI/ScaLAPACK parallelization, pass -DENABLE_MPI=OFF option to cmake command.
On macOS, some functions of ScaLAPACK are incompatible with the system’s BLAS and LAPACK,
and TeNeS ends in error. It is recommended to disable MPI parallel.
Specify compiler
CMake detects your compiler automatically but sometimes this does not work. In this case, you can specify the compiler in the following way,
$ cmake -DCMAKE_CXX_COMPILER=<path to your compiler> ../
Specify ScaLAPACK
CMake detects your ScaLAPACK library automatically but may fail. In this case, you can specify the ScaLAPACK library (<path>/lib/libscalapack.so) in the following way,
$ cmake -DSCALAPACK_ROOT=<path> ../
Control the detection of ARPACK-NG
CMake detects ARPACK-NG automatically (when it is not found, TeNeS is built
with the builtin solver only). The behavior can be controlled by
-DENABLE_ARPACK=AUTO/ON/OFF (default AUTO; ON raises an error
when ARPACK-NG is not found, and OFF disables the detection).
If you want to use ARPACK-NG installed in a specific location
(<path>/lib/libarpack.so), add the following option:
$ cmake -DARPACK_ROOT=<path> ../
Use the pre-built mptensor
TeNeS is based on the parallelized tensor library mptensor. The build system of TeNeS installs this automatically, but if you want to use the specific version of the mptensor (<path>/lib/libmptensor.a), please add the following option in cmake.
$ cmake -DMPTENSOR_ROOT=<path> ../
Specify Python interpreter
TeNeS tools (tenes_simple and tenes_std) use python3 interpreter which is found in PATH via /usr/bin/env python3.
Please make sure that python3 command invokes the interpreter which you want to use, for example, by using type python3.
If you want to fix the interpreter (or /usr/bin/env does not exist), you can specify the interpreter in the following way,
$ cmake -DTENES_PYTHON_EXECUTABLE=<path to your interpreter> ../