The purpose of this document is to provide you with a step-by-step tutorial for installing ALPSCore and additional libraries you might need for your solver, in this case on NERSC Cray machines, for example, on Cori.
Here we assume that:
- You have an access to the machine.
- You use
bashshell. - You have access to the GitHub repositories with the codes.
- You are fine to use the default Cray development environment: compiler, linear algebra library, and MPI library.
Let's begin!
- First of all, load the necessary modules for CMake, Boost, HDF5, and FFTW3.
$ module add cmake boost cray-hdf5 fftwand declare C and C++ compilers to be used:
$ export CC=$(which cc)
$ export CXX=$(which CC)- It is convenient to decide where you will download, build and install the software. For example, it can be somewhere in your home directory, on in a "scratch" directory (pointed by environment variable
SCRATCHon Cori), or in your project directory.
You may be able to find the names of your project directories by the following command:
$ (for f in $(id -Gn); do d=/global/project/projectdirs/$f; [ -r $d ] && [ -w $d ] && [ -x $d ] && ls -ld $d; done)- So, let's assume your project directory name is
/global/project/projectdirs/m1234567and it is in its subdirectory we want to install the code. Let's put this directory name in a shell variablemy_base_dir, for convenience, and make sure that the directory is created.
$ my_base_dir=/global/project/projectdirs/m1234567/$USER/alpscore_stuff
$ mkdir -pv $my_base_dir- Assign the directories for source, build and installation.
- ALPSCore directories: Note that
ALPSCore_DIRvariable must be exported and must point to the directory where ALPSCore is to be installed.
$ alpscore_src=$my_base_dir/ALPSCore $ alpscore_build=$alpscore_src/000build $ export ALPSCore_DIR=$my_base_dir/install
- NFFT3 directories:
$ nfft3_src=$my_base_dir/nfft3 $ export NFFT3_DIR=$my_base_dir/install/nfft3
- ALPSCore directories: Note that
(See ALPSCore installation Wiki page for details.)
Download:
$ git clone https://github.com/ALPSCore/ALPSCore.git $alpscore_srcBuild and install. Note that on Cray we have to compile ALPSCore statically:
$ mkdir -pv $alpscore_build
$ cd $alpscore_build
$ cmake $alpscore_src -DALPS_BUILD_TYPE=static -DCMAKE_INSTALL_PREFIX=$ALPSCore_DIR
$ make -j4
$ make installVerify that installation is successful:
$ (cd $ALPSCore_DIR/lib && ls -1 libalps*)should produce the output like this:
libalps-accumulators.a
libalps-gf.a
libalps-hdf5.a
libalps-mc.a
libalps-params.a
libalps-utilities.a
Download NFFT3 library from https://www-user.tu-chemnitz.de/~potts/nfft/ and unpack it.
$ mkdir -pv $nfft3_src
$ cd $nfft3_src
$ wget https://www-user.tu-chemnitz.de/~potts/nfft/download/nfft-3.3.2.tar.gz
$ tar -xzf nfft-3.3.2.tar.gzPrepare the build. Note that we have to inform NFFT3 of the location of the FFTW3 library, and also we disable the generation of the shared libraries.
$ cd nfft-3.3.2/
$ ./configure --prefix=$NFFT3_DIR CC=$CC --with-fftw3=$FFTW_DIR/.. --enable-shared=no --enable-static=yesUnfortunately, there seems to be a bug either in GNU Autotools or in NFFT3: the configure script generates spurious link arguments that will cause the build to fail. We have to fix it and regenerate the build:
$ sed -e 's/-lne required -lm//' <config.status >config.status.fixed
$ make distclean
$ cp config.status.fixed config.status
$ chmod +x config.status
$ ./config.statusThen build and install:
$ make -j4
$ make installVerify that installation is successful:
$ (cd $NFFT3_DIR && ls -1dF lib/* include/*)should produce the output like this:
include/nfft3.h
include/nfft3mp.h
lib/libnfft3.a
lib/libnfft3.la*
lib/pkgconfig/