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

Subsections

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 all "common" computers, that is: based on Intel, AMD, ARM CPUs, running Linux, Mac OS X, MS-Windows. QUANTUM ESPRESSO is known go work on many more kinds of machines but may requires some tweaking, especially for the hardware of large HPC centers. Detailed but sometimes outdated installation instructions for specific HPC machines may be found in files install/README.sys, where sys is the machine name.

Note: support for cMake is being added.

Instructions for the impatient:

    cd qe-X.Y.Z/
    ./configure
     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.

configure generates the following files:

make.inc 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/qe_cdefs.h (previously: include/c_defs.h) a few definitions used by C files
include/configure.h optionally: info on compilation flags (uncomment #define __HAVE_CONFIG_INFO in Modules/environment.f90 to enable its usage)

NOTA BENE: 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.
NOTA BENE 1: it is convenient to use "parallel make" to speed up compilation: make -jN compiles in parallel on N processors.
NOTA BENE 2: configure no longer updates files make.depend, containing dependencies upon modules, in the various subdirectories. If you modify the sources, run ./install/makedeps.sh or type make depend to update files make.depend.
NOTA BENE 3: make.inc 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.

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
As a rule: do not define environment variables for configure unless you need it. Always try configure with no options as a first step. 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.

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:

x86_64 Intel and AMD 64-bit running Linux
arm ARM machines (with gfortran or armflang)
crayxt4 Cray XT4/XT5/XE machines
mac686 Apple Intel machines running Mac OS X
mingw32 Cross-compilation for MS-Windows, using mingw, 32 bits
mingw64 As above, 64 bits
cygwin MS-Windows PCs with Cygwin
ppc64 Linux PowerPC machines, 64 bits
ppc64-mn as above, with IBM xlf compiler
ppc64-bg* IBM BlueGene
necsx* NEC SX-6 and SX-8 machines
ia32* Intel 32-bit machines (x86) running Linux
ia64* Intel 64-bit (Itanium) running Linux

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. Architectures marked with a * are to be considered obsolescent or obsolete.

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 some compilers; default: no)
-enable-pedantic compile with pedantic flags (only for gfortran; default: no)
-enable-signals enable signal trapping (default: disabled)


and the following optional packages:
-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 | | yes | <path>)
  Use HDF5, if yes configure assumes
  that a valid installation with version >= 1.8.16 is
  available, and h5cc and h5fc are in the default
  executable search path; <path> must be the root
  folder of a standalone hdf5 installation. (default: no).
-with-hdf5-libs= Specify the linker options needed by HDF5 when
  configure fails to detect them by itself. As value
  to specify here is usually composed by many
  substrings it should be enclosed by quotes so to
  prevent configure failures. (default: no)
-with-hdf5-include Specify full path the HDF5 include folder containing
  module and headers files. Use it if configure fails
  to detect the path by itself. (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 GPU version:
-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 remember that in order to compile the CUDA code for GPU's you need ... the CUDA code (it is aligned to but separated from the main distribution)! you also need a recent version of the PGI Fortran compiler. 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 make.inc file (optionally, include/qe_cdefs.h). The template used by configure is install/make.inc.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. configure will clean objects and executables, unless you use option -save.


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