next up previous contents
Next: 2.4 Libraries Up: 2 Installation Previous: 2.2 Prerequisites   Contents


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 -h for help). 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, IBM BlueGene machines, NEC SX, Cray XT machines, Mac OS X, MS-Windows PCs. Detailed but sometimes outdated installation instructions for specific HPC machines may be found in files install/README.sys, where sys is the machine name.

Instructions for the impatient:

    cd qe-X.Y.Z/
     make all
This will (try to) produce parallel (MPI) executable if a proper parallel environment is detected, serial executables otherwise. For OpenMP executables, specify ./configure -enable-openmp. 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: 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 (useful for debugging)
include/c_defs.h a few definitions used by C files
include/configure.h info on compilation flags (not used: in Modules/environment.f90
  uncomment #define __HAVE_CONFIG_INFO to enable its usage)

NOTA BENE: configure no longer updates files make.depend, containing dependencies upon modules, in the various subdirectories. If you modify the sources, run ./install/ or type make depend to update files make.depend.
NOTA BENE 2: used to be called make.sys until v.6.0. The change of name is due to frequent problems with mailers assuming that whatever ends in .sys is a suspect virus. NOTA BENE 3: if you interrupt make, it may fail when you start it again later (this will happen for instance if make is interrupted while unpacking and compiling the FoX library). If so, run make clean before running make again.

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
     env VARIABLE=value ./configure                 # any shell
     ./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, Fortran-77, and C compilers
MPIF90 name of parallel Fortran 90 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

(note that F90 is an ``historical'' name - we actually use Fortran 2003 - and that it should be used only together with option -disable-parallel. In fact, the value of F90 must be consistent with the parallel Fortran compiler which is determined by configure and stored in the MPIF90 variable).

For example, the following command line:

     ./configure MPIF90=mpif90 FFLAGS="-O2 -assume byterecl" \
                  CC=gcc CFLAGS=-O3 LDFLAGS=-static
instructs configure to use mpif90 as Fortran 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: passing the complete path to compilers (e.g., F90=/path/to/f90xyz) may lead to obscure errors during compilation. As a rule: do not define environment variables for configure unless you need it. Always 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
crayxt4 Cray XT4/XT5/XE machines
mac686 Apple Intel machines running Mac OS X
cygwin MS-Windows PCs with Cygwin
mingw32 Cross-compilation for MS-Windows, using mingw, 32 bits
mingw64 As above, 64 bits
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
arm ARM machines (with gfortran)

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. IBM machines with AIX are no longer supported since v.6.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)
-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 (yes|no|intel) Use scalapack if available.
  Set to intel to use Intel MPI and blacs (default: use OpenMPI)
-with-elpa-include Specify full path of ELPA include and modules headers (default: no)
-with-elpa-lib Specify full path of the ELPA library (default: no)
-with-elpa-version Specify ELPA version, only year (2015 or 2016, default: 2016)
-with-hdf5 (no | <path>) Write portable binary files using HDF5.
  A valid <path> for HDF5 library must be specified (default: no)
-with-libxc Link the libxc library (default:no)
-with-libxc-prefix directory where libxc is installed
-with-libxc-include directory where libxc Fortran headers reside

The following options are available for the CUDA Fortran accelerated version (currently in a separate package, not yet included in the main distribution):
-with-cuda=value enables compilation of the CUDA Fortran
  accelerated subroutines.
  value should point the path where the CUDA toolkit
  is installed, e.g. /opt/cuda (default: no)
-with-cuda-cc=value sets the compute capabilities for the compilation
  of the accelerated subroutines.
  value must be consistent with the hardware and the
  NVidia driver installed on the workstation or on the
  compute nodes of the HPC facility (default: 35)
-with-cuda-runtime=value sets the version of the CUDA toolkit used
  for the compilation of the accelerated code.
  value must be consistent with the
  CUDA Toolkit installed on the workstation
  or available on the compute nodes of the HPC facility.
  PGI compilers currently accept 7.5, 8.0 or 9.0 (default: 8.0)

Please note that in order to compile the CUDA Fortran code you need ... the CUDA Fortran code (it is not yet available in the main distribution)! you also need a recent version of the PGI Fortran compilers (at least 17.4). OpenMP must be enabled, and you may want to use a CUDA-aware MPI distribution to optimize the data transfer between the processes.

If you want to modify configure (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 a working file (optionally, include/c_defs.h). The template used by configure is install/ 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. configure will clean object and executables, unless you use option -save.

next up previous contents
Next: 2.4 Libraries Up: 2 Installation Previous: 2.2 Prerequisites   Contents
Paolo Giannozzi 2019-04-18