Building ALM using Makefile¶
ALM can also be built with the Makefile in the src
subdirectory.
This approach only generates the command line version of ALM (binary alm
).
Therefore, if you want to use ALM from python as well, please
build ALM using conda.
Requirement¶
- C++ compiler (C++11 standard or newer)
- LAPACK
- Boost C++ library
- Eigen3 library
- spglib
How to install¶
Install the LAPACK, Boost C++, and Eigen3, and spglib.
To install the Boost C++ library, please download a source file from the website and unpack the file. Then, copy the ‘boost’ subdirectory to the include folder in the home directory (or anywhere you like). This can be done as follows:
$ cd $ mkdir etc; cd etc (Download a source file and mv it to ~/etc) $ tar xvf boost_x_yy_z.tar.bz2 $ cd ../ $ mkdir include; cd include $ ln -s ../etc/boost_x_yy_z/boost .
In this example, we made a symbolic link to the ‘boost’ subdirectory in
$HOME/include
. Instead of installing from source, you can install the Boost library with Homebrew on Mac.In the same way, please install the Eigen3 include files as follows:
$ cd $ mkdir etc; cd etc (Download a source file and mv it to ~/etc) $ tar xvf eigen-eigen-*.tar.bz2 (* is an array of letters and digits) $ cd ../ $ cd include $ ln -s ../etc/eigen-eigen-*/Eigen .
Clone ALM from the git repository and edit Makefile:
$ git clone https://github.com/ttadano/ALM $ cd ALM/src/ (Edit Makefile.linux or Makefile.osx) $ make -f Makefile.linux -j (or make -j Makefile.osx -j)
In the
src
directory, we provide sample Makefiles for linux (Intel compiler) and MacOS (GCC installed via homebrew) as shown below.
1 2 3 4 5 6 7 8 9 | CXX = icpc CXXFLAGS = -O2 -xHOST -qopenmp -std=c++11 INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include CXXL = ${CXX} LDFLAGS = -mkl -L$(SPGLIB_ROOT)/lib -lsymspg LAPACK = LIBS = ${LAPACK} |
1 2 3 4 5 6 7 8 9 10 11 | # Use gcc >= 4.8 to use OpenMP # OpenMP-enabled gcc can be installed via homebrew CXX = g++-9 CXXFLAGS = -O2 -fopenmp -std=c++11 INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include -I/usr/local/include/eigen3/ -I/usr/local/include/ CXXL = ${CXX} LDFLAGS = -lgomp -L$(SPGLIB_ROOT)/lib -lsymspg LAPACK = -llapack -lblas LIBS = ${LAPACK} |
Modify
LD_LIBRARY_PATH
as follows:bash, zsh $ export LD_LIBRARY_PATH=$(HOME)/src/spglib/lib:$LD_LIBRARY_PATH csh, tcsh $ setenv LD_LIBRARY_PATH $(HOME)/src/spglib/lib:$LD_LIBRARY_PATH