Setup and Installation (Library)
ALPS Application setup and installation documentation is on the separate page " Setup and Installation (Applications)".
The latest version of the ALPS libraries can be downloaded from our download page. if you have SVN access you can check out the current ALPS SVN version from svn.comp-phys.org.
Supported Platforms and Compilers
The ALPS libraries have been tested on the following platforms and compilers:
- Linux with GNU Compiler Collection (g++ version 3.1 and higher), and Intel C++ Compiler (icc version 7.0 and higher)
- MacOS X with GNU compiler (g++ Apple-version 3.1, 3.3 and 4.0)
- IBM AIX with Visual Age C++ (xlC version 6.0) and GNU (g++ version 3.1 and higher) compilers
- Compaq Tru64 UNIX with Compq C++ Compiler (cxx)
- SGI IRIX with MIPSpro C++ Compiler (CC)
- HP-UX with HP C++ Compiler (aCC)
- Windows with Cygwin or coLinux platforms and GNU Compiler Collection (g++ version 3.1 and higher
The ALPS libraries requires the source tree of version 1.41 or higher of the Boost C++ library, available at http://www.boost.org. For the IBM compiler and gcc version 3.4 a more recent snapshot or a current CVS checkout is required. Note that it is only necessary to download and untar the Boost sources but no installation is required.
If support for additional features is desired, the following libraries are needed as well:
- An XSLT transformer, such as Xalan of the Apache project or xsltproc of the Gnome libxslt for XML processing. Xalan or xsltproc have to be in the standard path for executables.
- MPI (Message Passing Interface) libraries for message passing support
- [experimental] HDF5 (Hierarchical Data Format version 5) library (version 1.8 or newer) for efficient large-scale storage support
- [experimental] Xerces C++ or Expat XML parser for additional XML support
- [experimental] POSIX Thread Library (pthread) for multi-thread support
- [optional] Python (version 2.5 or later), wxPython, VTK for GUI. See Setup and Installation (Python) for an installation guide.
Installation of Pre-build Packages
- stable (etch) and unstable (sid)
This ALPS version is 1.2.2
There are pre-build Debian packages of the ALPS library in the official Debian package repository. The light version is in the main section. Try
$ sudo apt-get install libalps-light1-dev libalps-sgl1-dev libalps-bin
for minimal installation. To get the full list of packages, check .
The full version is in the non-free section. Try
$ sudo apt-get install libalps1-dev libalps-sgl1-dev libalps-bin
- oldstable (sarge)
There are no pre-build Debian packages yet...
Installation from the Sources
For easy setup, we have provided a configure script. Just type
Some of the more frequently used options are illustrated here:
$ ./configure --prefix=/path/to/install --with-boost=/path/to/my/boost\ --with-blas-dir=/path/to/my/blas --with-blas="-lmy_blas" --with-lapack-dir=/path/to/my/lapack\ --with-lapack="-lmy_lapack" CXXFLAGS="-my -cpp -flags" CXX=g++-mine
in the top directory of ALPS source tree. The configure script accepts several command-line options (try configure --help). The configure script will automatically look for the directories containing the libraries/source files required (such as boost). If those cannot be found, you need to use further options. See Configure Options for details. The script will print out a short summary showing which features of ALPS will be available with your current configuration. After configuration, type
$ make $ make install
to build and install all the header files, libraries and tools. This step may take a while. The tools will be created in the tool directory of the ALPS source tree. You can set the path to this directory to use them from all locations of your system. Now the essential part of the ALPS-library installation is completed.
To compile example files, type
$ make examples
To compile and run test suites, type
$ make tests
On some clusters, the installation is not straightforward. On the ETHZ brutus cluster, for example, you will have to type something like
./configure --with-boost=/cluster/home/phys/your_user_name/boost_1_35_0/\ --with-blas-dir=/opt/intel/mkl/10.0.2.018/lib/em64t/ \ --with-blas="-lmkl_gf_lp64 -lmkl_sequential -lmkl_em64t -lguide" --enable-warnings\ --with-mpi=/cluster/apps/openmpi/1.2.6/x86_64/gnu/ --with-mpi-libdir=/cluster/apps/openmpi/1.2.6/x86_64/gnu/lib\ --with-mpi-libs="-lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" \ --prefix=/cluster/home/phys/your_user_name/ALPS_OPENMPI_MKL --with-lapack-dir=/opt/intel/mkl/10.0.2.018/lib/em64t/\ --with-lapack="-lmkl_gf_lp64 -lmkl_sequential -lmkl_lapack -lmkl_em64t -lguide"
this, combined with the module load mkl and module load open_mpi in your bashrc will create Makefiles for ALPS linked to the sequential (i.e. un-threaded) MKL blas / lapack libraries and the OpenMPI MPI libraries. To figure out the appropriate command on your machine, have a look at your blas / lapack installation manual and use mpiCC -show (sometimes -showme) to find the MPI libraries that have to be linked. Also, make sure that the LD_LIBRARY_PATH contains the path to your shared libraries (and is exported to the nodes, if the program is executed on a cluster).
In this section we explain important options for ALPS configure script. For complete list of options see the output of
$ ./configure --help
For directories, please specify the whole path starting from root.
|--prefix=PREFIX||Install the files in PREFIX. The default value is $HOME/ALPS. The headers, libraries, and tools are installed in PREFIX/include, PREFIX/lib, and PREFIX/bin, respectively.|
|--with-compiler=MODE||Specify C/C++ compiler. Currently gnu, kai, intel, como, hp32, hp64, dec, sgi32, sgi64, cray, macos, macos-gcc-3, macos-gcc-3.3, macos-gcc-4.0, and generic are acceptable. The default value for MODE is generic.|
|--enable-optimization||Enable optimization flags (-O3 etc) passed to the C++ compiler. Default is yes.|
|--enable-exceptions||Enable C++ exception handling. Default is yes.|
|--enable-warnings||Enable warning messages from the C++ compiler. Default is no.|
|--with-boost=DIR||Specify the place where the Boost C++ library main tree is installed. By default configure script will search $HOME/boost, $HOME/src/boost, PREFIX/boost, and PREFIX/src/boost, /usr/local/boost, and /usr/local/src/boost.|
|--with-boost-incdir=DIR||Specify the place where the Boost header files are installed, in case you have a precompiled Boost C++ library.|
|--with-boost-libdir=DIR||Specify the place where the Boost library (eg. libboost.a) is installed, in case you have a precompiled Boost C++ library.|
|--with-boost-libs=LIBS||Specify Boost C++ libraries (eg. -lboost_date_time -lboost_filesystem) to be linked, in case you have a precompiled Boost C++ library.|
|--with-boost-toolset=TOOLSET||Specify Boost toolset abbreviation, eg. gcc-d for gcc with debugging, il-mt for intel-linux with multi-threading etc, in case you have a precompiled Boost C++ library. For more details, please see http://www.boost.org/more/getting_started.html#Results .|
|--enable-boost-config||Use Boost user configuration header file generated by Boost configure script. By default ALPS configure script does not run Boost configure script and thus does not use Boost user configuration header. Try this option in case you have a problem with default Boost configuration.|
Normally configure script will automatically find optional libraries (MPI, HDF5, etc) installed in your system. However, if these libraries are installed in the places different from usual ones, you must specify them by the following options. For directories, please specify the the whole path starting from root.
|specifies the library files for the BLAS, ATLAS, and LAPACK libraries. If more than one library needs to be linked, they have to be specifed in quotes, such as in --with-blas='-lblas -lf2c'.The BLAS (or ATLAS) and the LAPACK libraries are needed for the full and sparse diagonalization example application.|
|specifies the place where the BLAS, ATLAS, and LAPACK libraries are installed. The BLAS (or ATLAS) and the LAPACK libraries are needed for the full and sparse diagonalization example application.|
|--with-dxml||specifies the use of Compaq Digital Extended Math Library for the BLAS and LAPACK functions.|
|--with-mkl=PROC||specifies the use of Intel Math Kernel Library for the BLAS and LAPACK functions. Optional parameter PROC specifies the type of processor (p3 for Pentium 3, p4 for Pentium 4, or itp for Itanium).|
|--with-scsl||specifies the use of SGL SCSL Scientific Library for the BLAS and LAPACK functions.|
|--with-veclib||specifies the use of vecLib framework on Mac OS X for the BLAS and LAPACK functions.|
|--with-mpi=DIR||Specify the place where MPI is installed. MPI headers (eg. mpi.h) and libraries (eg. libmpi.a) are assumed to be installed in DIR/include and DIR/lib, respectivly.|
|--with-mpi-incdir=DIR||Specify the place where MPI headers (eg. mpi.h) are installed.|
|--with-mpi-libdir=DIR||Specify the place where MPI libraries (eg. libmpi.a) are installed.|
|--with-mpi-libs=DIR||Specify MPI libraries (eg. -lmpi) to be linked.|
|--without-mpi||Disable MPI support.|
|Enable HDF5 support. HDF5 headers (eg. hdf5.h) and libraries (eg. libhdf5.a) are assumed to be installed in DIR/include and DIR/lib, respectivly, if DIR is specified.|
|Use Expat XML parser. Headers (eg. expat.h) and libraries (eg. libexpat.a) are assumed to be installed in DIR/include and DIR/lib, respectivly, if DIR is specified.|
|Use Xerces C++ XML parser. Headers (eg. xercesc/parsers/SAXParser.hpp) and libraries (eg. libxerces-c.a) are assumed to be installed in DIR/include and DIR/lib, respectivly, if DIR is specified.|
|--with-pthread||Enable pthread support.|
Compiling User Applications
In order to develop and compile user applications on top of the ALPS libraries, user programs must include ALPS headers and be linked with ALPS libraries. ALPS header files are installed under PREFIX/include, where PREFIX is the path specified by the option to the configure script (see #Configure_Options). ALPS libraries are installed under PREFIX/lib. For example, you can compile and link your program as
$ CC -I/home/ALPS/include -L/home/ALPS/lib -o myprog myprog.C -lalps -lcomm-sgl -lm
For parallel applications using MPI, -lcomm-sgl should be replaced by -lcomm-mpi, and appropriate linker flags for MPI should be appended (e.g. -lmpi). You should link the ALPS libraries exactly in this order. Otherwise you will have an error message from the linker.
Note that during the ALPS setup and installation, a script file named include.mk is also prepared and installed, in which useful macros for make (such as $(CPPFLAGS) and $(LIBS)) are predefined. By using this file, which is installed as PREFIX/share/alps/include.mk, you can write a simple makefile for your application, e.g.
$ cat Makefile include $HOME/ALPS/share/alps/include.mk myprog$nbsp;: myprog.C $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o myprog myprog.C $(LDFLAGS) $(LIBS) myprog_mpi$nbsp;: myprog.C $(CXX) $(CPPFLAGS_MPI) $(CXXFLAGS) -o myprog_mpi myprog.C $(LDFLAGS_MPI) $(LIBS_MPI)
(Note that large spaces should be replaced by tabs).
If you want to build your application using autoconf/automake, there is a example package at http://rigarash.info/myprog.tar.gz .
If you are stuck please file a bug in our ALPS Trac (developers only) or ask for help on our mailing list.
Copyright (C) 1994-2006 by Matthias Troyer Copyright (C) 1994-2006 by Synge Todo Copyright (C) 2006 by Ryo Igarashi and Siegfried Guertler Copyright (C) 2009 by Emanuel Gull