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 CVS access you can check out the current ALPS cvs version from cvs.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)
See ALPS Tinderbox for the current status of tested platforms and compilers.
The ALPS libraries requires the source tree of version 1.33.1 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
- HDF5 (Hierarchical Data Format version 5) library 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
Installation of Pre-build Packages
- testing (etch) and unstable (sid)
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
- stable (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 used 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
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.
|--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 bugzilla
Copyright (C) 1994-2006 by Matthias Troyer Copyright (C) 1994-2006 by Synge Todo Copyright (C) 2006 by Ryo Igarashi and Siegfried Guertler