Building ALPS from source
- 1 Building ALPS from source
- 1.1 Libraries and tools needed to build ALPS
- 1.1.1 Get dependent libraries and tools on MacOS X using Mac Ports
- 1.1.2 Get dependent libraries and tools on Ubuntu 10.04 Lucid (and higher)
- 1.1.3 Get dependent libraries and tools on CentOS 5.4 (should be identical with RHEL 5.4 and essentially all 5.* versions)
- 1.1.4 Get dependent libraries and tools on Debian GNU/Linux (sid)
- 1.1.5 Get some dependent libraries and tools from source using ALPS convenience scripts
- 1.2 Build ALPS
- 1.3 Notes for high performance computers
- 1.4 Notes for Unix Servers
- 1.1 Libraries and tools needed to build ALPS
Building ALPS from source
Libraries and tools needed to build ALPS
ALPS will need the following libraries and tools in addition to the ALPS sources:
- CMake version 2.8 or higher as a build system.
- Boost C++ Libraries version 1.47.0 or higher.
- HDF5 version 1.8.2 or higher
Many of the applications will also need
- BLAS and LAPACK libraries
To use the evaluation tools you will need Python and some Python packages
All these packages and tools can be installed from source. In the following we will give more instructions for packaged installations on various platforms.
The tebd code requires a fortran compiler and that HDF5 be built with the --enable-fortran configure option.
Get dependent libraries and tools on MacOS X using Mac Ports
- Get and install Mac Ports
- Install CMake either using the binary on http://www.cmake.org/ or using Mac Ports:
$ sudo port install cmake
- Install HDF5 1.8.2 or higher
$ sudo port install hdf5-18
- If you want Python support without Vistrails install Python and scientific Python packages:
$ sudo port install py27-numpy py27-scipy py27-matplotlib python27 $ sudo port select --set python python27
Alternatively you can also just install the ALPS Vistrails extensions
- Download and unpack the Boost C++ Libraries library sources 1.47.0 or higher if you have not downloaded them with the ALPS sources. NOTE: just download and unpack but do not build Boost
- Note that Xcode 4 does not provide a MPI implementation. To use ALPS with MPI you have to install it.
$ sudo port install openmpi
Get dependent libraries and tools on Ubuntu 10.04 Lucid (and higher)
1. Install required packages using Synaptic package manager.
build-essential cmake-curses-gui libhdf5-serial-dev libfftw3-dev gfortran python-matplotlib python-scipy liblapack-dev
- For Ubuntu 12.04 Precise Boost (version >= 1.47.0) can be installed from the package manager
- For ealier realeases download ALPS with the Boost sources included.
3. On Ubuntu, Vistrails is able to automatically install additional packages. If you however do not have administrative rights, you might need your administrator to install also the following packages:
python-qt4-gl python-qt4-sql python-vtk
Get dependent libraries and tools on CentOS 5.4 (should be identical with RHEL 5.4 and essentially all 5.* versions)
1. Make sure you have all the usual compilers installed. The following should pull in all required dependencies (including some libraries):
# yum install gcc-c++ gcc-gfortran
2. If you want to use the evaluation tools, you will need to install a newer version of Python than the provided 2.4. You can install from source or use an unofficial repository for binary RPMs. This is not required if you just want to run your compiled simulations (c++ applications), but make sure you still have python headers (specify -DALPS_BUILD_PYTHON=OFF when invoking cmake):
# yum install python-devel
3. CMake 2.8.0 or later and HDF5 1.8 or later need to be installed from source since there are no packages in the standard repositories. You can however use the install scripts in the script directory to save some work. See #Get some dependent libraries and tools from source using ALPS convenience scripts
4. More recent Boost packages are required. Use the ALPS package that includes them or get them separately.
5. If you don't have some version installed already, you will also need BLAS/LAPACK:
# yum install blas-devel lapack-devel
Get dependent libraries and tools on Debian GNU/Linux (sid)
(2010/04/08) You can now create ALPS binary (except SSE, #68) without external source!
- Install build-essential package using apt. This will pull g++, make, etc.
$ sudo aptitude install build-essential
- Install CMake using apt. Currently, this pulls 2.8.2
$ sudo aptitude install cmake-curses-gui
- Install HDF5 using apt. Currently, this pulls 1.8.4-patch1.
$ sudo aptitude install libhdf5-serial-dev
- Install Boost C++ Libraries using apt. Currently, this pulls 1.42.0. Note: Install libboost-all-dev. libboost-dev is not sufficient!
$ sudo aptitude install libboost-all-dev
- Install FFTW using apt.
$ sudo aptitude install libfftw3-dev
- Install Python and the needed packages h5py, numpy, scipy and matplotlib using apt.
$ sudo aptitude install python-h5py python-numpy python-matplotlib python-scipy
- Install gfortran using apt for LAPACK/BLAS autodetection.
$ sudo aptitude install gfortran
Get some dependent libraries and tools from source using ALPS convenience scripts
We have provided some shell scripts that can simplify building some of the dependent libraries from source:
- Checkout the ALPS source from subversion. (assume e.g. at $HOME/src/alps2)
- Install CMake and HDF5 using scripts, building in $HOME/tmp and installing into $HOME/opt
$ $HOME/src/alps2/script/cmake.sh $HOME/opt $HOME/tmp $ $HOME/src/alps2/script/hdf5.sh $HOME/opt $HOME/tmp
- Create a build directory (anywhere you have write access) and execute cmake giving the path to the alps and to the boost directory:
$ cmake -D Boost_ROOT_DIR:PATH=/path/to/boost/directory /path/to/alps/directory
In this case the installation directory will be '/opt/alps'. If you want to specify a different installation directory set the variable CMAKE_INSTALL_PREFIX. Note that for the directory you specify here, you need to have writing-rights, therefore if you do not have the right to write to '/opt/alps' you need to give this option in any case:
$ cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/directory /path/to/alps/directory
If you want to link against a 64-bit LAPACK version turn the LAPACK_64_BIT option on in cmake by adding the option -D LAPACK_64_BIT=ON
- Optionally look at or edit the CMake configuration settings using the CMake GUI or ccmake. This lets you set include and library paths for libraries which cmake did not find automatically. You may want to take a look at the descriptions of the relevant cmake options.
$ ccmake .
- Build and test ALPS
$ make $ make test $ make install
Notes for high performance computers
On HPC machines it might be nontrivial to configure and set up ALPS with the right combination of libraries. We thus provide setup configuration files for those machines where we have successfully installed ALPS and where the setup was nontrivial. More information can be found here
Notes for Unix Servers
On Unix servers you often do not have access to the root directory, and you cannot use the default directory to install HDF5 and Cmake. Here is an example on how to install Alps 2.0 on a server in which you have writing access only to your home directory (~/)
1. Download HDF5 and install into ~/opt
2. Download and install cmake into ~/cmake
3. Download the Alps sources into your home directory and expand them using "gunzip" and "tar -xrf". From the directory that you have just created execute:
> ../cmake-2.8.1/bin/cmake -D BLAS_LIBRARY=/usr/lib64/libblas.so.3.0.3 -D LAPACK_LIBRARY=/usr/lib64/liblapack.so.3.0.3 -D CMAKE_INSTALL_PREFIX=$HOME/ALPS -D LAPACK_64_BIT=ON -D HDF5_LIBRARIES=~/opt/lib/libhdf5.so.6 -D HDF5_INCLUDE_DIR=~/opt/include/ ~/alps-2.0.0b1-r4556-src-with-boost/alps/
4. add the following line to the ~/.bashrc file
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opt/lib to .bashrc