2.3 configure
Keywords: user_guide

Next: 2.4 Libraries Up: 2 Installation Previous: 2.2 Prerequisites Contents
Subsections

- 2.3.1 Manual configuration

## 2.3 `configure`

To install the QUANTUM ESPRESSO source package, run the `configure` script. This is actually a wrapper to the true `configure`, located in the `install/` subdirectory. `configure` will (try to) detect compilers and libraries available on your machine, and set up things accordingly. Presently it is expected to work on most Linux 32- and 64-bit PCs (all Intel and AMD CPUs) and PC clusters, SGI Altix, IBM SP and BlueGene machines, NEC SX, Cray XT machines, Mac OS X, MS-Windows PCs, and (for experts!) on several GPU-accelerated hardware.

Instructions for the impatient:

        cd espresso-X.Y.Z/
        ./configure
         make all

Symlinks to executable programs will be placed in the `bin/` subdirectory. Note that both C and Fortran compilers must be in your execution path, as specified in the PATH environment variable. Additional instructions for special machines:

`./configure ARCH=crayxt4` | for CRAY XT machines
`./configure ARCH=necsx` | for NEC SX machines
`./configure ARCH=ppc64-mn` | PowerPC Linux + xlf (Marenostrum)
`./configure ARCH=ppc64-bg` | IBM BG/P (BlueGene)

`configure` generates the following files:

`make.sys` | compilation rules and flags (used by `Makefile`)
`install/configure.msg` | a report of the configuration run (not needed for compilation)
`install/config.log` | detailed log of the configuration run (may be needed for debugging)
`include/fft_defs.h` | defines fortran variable for C pointer (used only by FFTW)
`include/c_defs.h` | defines C to fortran calling convention
| and a few more definitions used by C files

NOTA BENE: unlike previous versions, `configure` no longer runs the `makedeps.sh` shell script that updates dependencies. If you modify the sources, run `./install/makedeps.sh` or type `make depend` to update files `make.depend` in the various subdirectories.

You should always be able to compile the QUANTUM ESPRESSO suite of programs without having to edit any of the generated files. However you may have to tune `configure` by specifying appropriate environment variables and/or command-line options. Usually the tricky part is to get external libraries recognized and used: see Sec.2.4 for details and hints.

Environment variables may be set in any of these ways:

         export VARIABLE=value; ./configure             # sh, bash, ksh
         setenv VARIABLE value; ./configure             # csh, tcsh
         ./configure VARIABLE=value                     # any shell

Some environment variables that are relevant to `configure` are:

`ARCH` | label identifying the machine type (see below)
`F90, F77, CC` | names of Fortran 95, Fortran 77, and C compilers
`MPIF90` | name of parallel Fortran 95 compiler (using MPI)
`CPP` | source file preprocessor (defaults to $CC -E)
`LD` | linker (defaults to $MPIF90)
`(C,F,F90,CPP,LD)FLAGS` | compilation/preprocessor/loader flags
`LIBDIRS` | extra directories where to search for libraries

For example, the following command line:

         ./configure MPIF90=mpf90 FFLAGS="-O2 -assume byterecl" \
                      CC=gcc CFLAGS=-O3 LDFLAGS=-static

instructs `configure` to use `mpf90` as Fortran 95 compiler with flags `-O2 -assume byterecl`, `gcc` as C compiler with flags `-O3`, and to link with flag `-static`. Note that the value of `FFLAGS` must be quoted, because it contains spaces. NOTA BENE: do not pass compiler names with the leading path included. `F90=f90xyz` is ok, `F90=/path/to/f90xyz` is not. Do not use environmental variables with `configure` unless they are needed! try `configure` with no options as a first step.

If your machine type is unknown to `configure`, you may use the `ARCH` variable to suggest an architecture among supported ones. Some large parallel machines using a front-end (e.g. Cray XT) will actually need it, or else `configure` will correctly recognize the front-end but not the specialized compilation environment of those machines. In some cases, cross-compilation requires to specify the target machine with the `-host` option. This feature has not been extensively tested, but we had at least one successful report (compilation for NEC SX6 on a PC). Currently supported architectures are:

`ia32` | Intel 32-bit machines (x86) running Linux
`ia64` | Intel 64-bit (Itanium) running Linux
`x86_64` | Intel and AMD 64-bit running Linux - see note below
`aix` | IBM AIX machines
`solaris` | PC's running SUN-Solaris
`sparc` | Sun SPARC machines
`crayxt4` | Cray XT4/XT5/XE machines
`mac686` | Apple Intel machines running Mac OS X
`cygwin` | MS-Windows PCs with Cygwin
`necsx` | NEC SX-6 and SX-8 machines
`ppc64` | Linux PowerPC machines, 64 bits
`ppc64-mn` | as above, with IBM xlf compiler
`ppc64-bg` | IBM BlueGene

Note: `x86_64` replaces `amd64` since v.4.1. Cray Unicos machines, SGI machines with MIPS architecture, HP-Compaq Alphas are no longer supported since v.4.2; PowerPC Macs are no longer supported since v.5.0. Finally, `configure` recognizes the following command-line options:

`-enable-parallel` | compile for parallel (MPI) execution if possible (default: yes)
`-enable-openmp` | compile for OpenMP execution if possible (default: no)
`-enable-shared` | use shared libraries if available (default: yes;
| "no" is implemented, untested, in only a few cases)
`-enable-debug` | compile with debug flags (only for selected cases; default: no)
`-disable-wrappers` | disable C to fortran wrapper check (default: enabled)
`-enable-signals` | enable signal trapping (default: disabled)

and the following optional packages:

`-with-internal-blas` | compile with internal BLAS (default: no)
`-with-internal-lapack` | compile with internal LAPACK (default: no)
`-with-scalapack=no` | do not use ScaLAPACK (default: yes)
`-with-scalapack=intel` | use ScaLAPACK for Intel MPI (default:OpenMPI)

If you want to modify the `configure` script (advanced users only!), see the Developer Manual.

###
2.3.1 Manual configuration

If `configure` stops before the end, and you don't find a way to fix it, you have to write working `make.sys`, `include/fft_defs.h` and `include/c_defs.h` files. For the latter two files, follow the explanations in `include/defs.h.README`.

If `configure` has run till the end, you should need only to edit `make.sys`. A few sample `make.sys` files are provided in `install/Make.`system. The template used by `configure` is also found there as `install/make.sys.in` and contains explanations of the meaning of the various variables. Note that you may need to select appropriate preprocessing flags in conjunction with the desired or available libraries (e.g. you need to add `-D__FFTW` to `DFLAGS` if you want to link internal FFTW). For a correct choice of preprocessing flags, refer to the documentation in `include/defs.h.README`.

NOTA BENE: If you change any settings (e.g. preprocessing, compilation flags) after a previous (successful or failed) compilation, you must run `make clean` before recompiling, unless you know exactly which routines are affected by the changed settings and how to force their recompilation.

Next: 2.4 Libraries Up: 2 Installation Previous: 2.2 Prerequisites Contents