GPAW relies on the Python library atomic simulation environment (ASE), so you need to install ASE first. GPAW itself is written mostly in the Python programming language, but there are also some C-code used for:
performance critical parts
So, in order to make GPAW work, you need to compile some C-code.
You will need to build a dynamically linked library
_gpaw.so) that the standard Python interpreter can load.
There are several ways to install GPAW:
Alternatively, you can download the source code and then install with a
python3 -m pip install ..
There may be a package for your Linux distribution that you can use (named
If you are a developer that need to change the code you should look at this description: Development workflow.
Optional (highly recommended for increased performance):
See Release notes for version requirements.
$ python3 -m pip install gpaw
This will compile and install GPAW (both
_gpaw.so and all the Python
files) in your
~/.local/lib/pythonX.Y/site-packages folder where
Python can automatically find it. Pip will also place
the command line tool gpaw in the
~/.local/bin folder, so
make sure you have that in your
$PATH environment variable.
Check that you have installed everything in the correct places:
$ gpaw info
Install PAW datasets¶
Install the datasets into the folder
<dir> using this command:
$ gpaw install-data <dir>
See Installation of PAW datasets for more details.
Now you should be ready to use GPAW, but before you start, please run the tests as described below.
Run a simple test calculation¶
Make sure that everything works by running a simple test:
$ gpaw test
If this worked then try also a parallel calculation:
$ gpaw -P 4 test
Please report errors to the
gpaw-users mailing list so that we
can fix them (see Mail List).
Testing GPAW for how to run the complete test suite.
Getting the source code¶
You can get the source from a tar-file or from Git:
Unpack and make a soft link:
$ tar -xf gpaw-24.1.0.tar.gz $ ln -s gpaw-24.1.0 gpaw
Here is a list of tarballs.
- Git clone:
Alternatively, you can get the source for the latest stable release from https://gitlab.com/gpaw/gpaw like this:
$ git clone -b 24.1.0 https://gitlab.com/gpaw/gpaw.git
or if you want the development version:
$ git clone https://gitlab.com/gpaw/gpaw.git
We also have Git tags for older stable versions of GPAW. See the Release notes for which tags are available. Also the dates of older releases can be found there.
The install script may need a little help finding you libraries
(BLAS, FFTW, ScaLapack, libxc, libvdwxc, …).
This can be done by adding a
siteconfig.py file in one of these three
the file that
The first one found will be used. As an example,
might contain the following lines:
libraries = ['myblas']
library_dirs = ['path_to_myblas']
Now, GPAW would be built with “
linker flags. Look at the file siteconfig_example.py
for more possible options. Platforms and architectures
provides examples of
siteconfig.py files for different platforms.
By default, setup looks if mpicc is available, and if setup
finds one, a parallel version is build. If the setup does not find
mpicc, a user can specify one in the
Additionally a user may want to enable ScaLAPACK, setting in
scalapack = True
and, in this case, provide BLACS/ScaLAPACK
as described in Customizing installation.
Part of the code can be parallelized also with OpenMP. OpenMP
threading can be enabled by setting in
extra_compile_args += ['-fopenmp']
extra_link_args += ['-fopenmp']
Note that a multithreaded BLAS library should be used together with OpenMP parallelization. Also, MPI library needs to support the MPI_THREAD_MULTIPLE thread support level.
Instructions for running parallel calculations can be found in the user manual.
fftw = True
libraries += ['fftw3']
If you OS does not have a LibXC package you can use then you can download and install LibXC as described here. A few extra tips:
Libxc installation requires both a C compiler and a Fortran compiler.
We’ve tried Intel and gnu compilers and haven’t noticed much of a performance difference. Use whatever is easiest.
Libxc shared libraries can be built with the “–enable-shared” option to configure. This might be slightly preferred because it reduces memory footprints for executables.
Typically when building GPAW one has to modify
siteconfig.pyin a manner similar to the following:
library_dirs += ['/my/path/to/libxc/5.2.0/install/lib'] include_dirs += ['/my/path/to/libxc/5.2.0/install/include']
or if you don’t want to modify your
siteconfig.py, you can add these lines to your
export C_INCLUDE_PATH=/my/path/to/libxc/5.2.0/install/include export LIBRARY_PATH=/my/path/to/libxc/5.2.0/install/lib export LD_LIBRARY_PATH=/my/path/to/libxc/5.2.0/install/lib
wget http://www.tddft.org/programs/octopus/down.php?file=libxc/5.2.0/libxc-5.2.0.tar.gz -O libxc-5.2.0.tar.gz
tar -xf libxc-5.2.0.tar.gz
./configure --enable-shared --disable-fortran --prefix=$HOME/libxc-5.2.0
# add these to your .bashrc: