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:

So, in order to make GPAW work, you need to compile some C-code. For serial calculations, you will need to build a dynamically linked library ( that the standard Python interpreter can load. For parallel calculations, you need to build a new Python interpreter (gpaw-python) that has MPI functionality built in.

There are several ways to install GPAW:

  • On a lucky day it’s as simple as pip3 install -U gpaw as described below.

  • Alternatively, you can download the source code, edit to tell the install script which libraries you want to link to and where they can be found (see Customizing installation) and then install with a python3 install --user as described here.

  • There may be a package for your Linux distribution that you can use (named gpaw).

  • If you are a developer that need to change the code you should look at this description: Developer installation.

See also


  • Python 3.5 or later

  • NumPy 1.9 or later (base N-dimensional array package)

  • SciPy 0.14 or later (library for scientific computing)

  • ASE 3.18.0 or later (atomic simulation environment)

  • a C-compiler

  • LibXC 3.x or 4.x

  • BLAS and LAPACK libraries

Optional, but highly recommended:

  • an MPI library (required for parallel calculations)

  • FFTW (for increased performance)


Installation using pip

The simplest way to install GPAW is using pip and the GPAW package from the Python package index (PyPI):

$ pip3 install --upgrade --user gpaw

This will compile and install GPAW (both and all the Python files) in your ~/.local/lib/pythonX.Y/site-packages folder where Python can automatically find it. The pip3 command will also place the command line tool gpaw in the ~/.local/bin folder, so make sure you have that in your PATH environment variable. If you have an mpicc command on your system then there will also be a gpaw-python executable in ~/.local/bin.

Check that you have installed everything in the correct places:

$ gpaw info

To check the compiled parallel features (like ScaLAPACK), you need to run:

$ gpaw-python -m 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 the tests

Make sure that everything works by running the test suite:

$ gpaw test

This will take a couple of hours. You can speed it up by using more than one core:

$ gpaw test -j 4

Please report errors to the gpaw-users mailing list so that we can fix them (see Mail List).

If tests pass, and the parallel version is built, test the parallel code:

$ gpaw -P 4 test

or equivalently:

$ mpiexec -np 4 gpaw-python -m gpaw test

Getting the source code

Sou can get the source from a tar-file or from Git:


You can get the source as a tar-file for the latest stable release (gpaw-19.8.1.tar.gz) or the latest development snapshot (gpaw-19.8.2b1.tar.gz).

Unpack and make a soft link:

$ tar -xf gpaw-19.8.1.tar.gz
$ ln -s gpaw-19.8.1 gpaw

Here is a list of tarballs.

Git clone

Alternatively, you can get the source for the latest stable release from like this:

$ git clone -b 19.8.1

or if you want the development version:

$ git clone

Add ~/gpaw to your PYTHONPATH environment variable and add ~/gpaw/tools to PATH (assuming ~/gpaw is where your GPAW folder is).


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.

Customizing installation

The install script does its best when trying to guess proper libraries and commands to build GPAW. However, if the standard procedure fails or user wants to override default values it is possible to customize the setup with file which is located in the GPAW base directory. As an example, might contain the following lines:

libraries = ['myblas', 'mylapack']
library_dirs = ['path_to_myblas']

Now, GPAW would be built with “-Lpath_to_myblas -lmyblas -lmylapack” linker flags. Look at the file itself for more possible options. Platforms and architectures provides examples of for different platforms. After editing, follow the instructions for the Developer installation.

Install with

If you have the source code, you can use the install script ( to compile and install the code:

$ python3 install --user

Parallel installation

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 file.

Additionally a user may want to enable ScaLAPACK, setting in

scalapack = True

and, in this case, provide BLACS/ScaLAPACK libraries and library_dirs as described in Customizing installation.

Instructions for running parallel calculations can be found in the user manual.


Older versions of GPAW would link FFTW using ctypes, based on library paths and the GPAW_FFTWSO environment variable if set. As of GPAW 1.5.1, FFTW is linked from like all other libraries.

Libxc Installation

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 in a manner similar to the following:

    library_dirs += ['/my/path/to/libxc/4.2.3/install/lib']
    include_dirs += ['/my/path/to/libxc/4.2.3/install/include']

    or if you don’t want to modify your, you can add these lines to your .bashrc:

    export C_INCLUDE_PATH=/my/path/to/libxc/4.2.3/install/include
    export LIBRARY_PATH=/my/path/to/libxc/4.2.3/install/lib
    export LD_LIBRARY_PATH=/my/path/to/libxc/4.2.3/install/lib


wget -O libxc-4.2.3.tar.gz
tar -xf libxc-4.2.3.tar.gz
cd libxc-4.2.3
./configure --enable-shared --disable-fortran --prefix=$HOME/libxc-4.2.3
make install

# add these to your .bashrc:
export C_INCLUDE_PATH=$XC/include
export LIBRARY_PATH=$XC/lib
export LD_LIBRARY_PATH=$XC/lib

Environment variables


Colon-separated paths where programs can be found.


Colon-separated paths where Python modules can be found.


Currently should be set to 1.


Comma-separated paths to folders containing the PAW datasets.

Set these permanently in your ~/.bashrc file:

$ export PATH=~/gpaw/tools:$PATH

or your ~/.cshrc file:

$ setenv PATH ${HOME}/gpaw/tools:${PATH}