To install the QUANTUM ESPRESSO source package, run the configure script. It 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), PC clusters, IBM SP machines, SGI Origin and Altix, some HP-Compaq Alpha machines, NEC SX, Cray X1-XD-XT machines, Mac OS X, MS-Windows PCs. It may work with some assistance also on other architectures (see below).
For cross-compilation, you have to specify the target machine with the -host option (see below). This feature has not been extensively tested, but we had at least one successful report (compilation for NEC SX6 on a PC).
Specifically, configure generates the following files:
make.sys: compilation rules and flags configure.msg: a report of the configuration run include/fft_defs.h: defines fortran variable for C pointer include/c_defs.h: defines C to fortran calling convention and a few more things used by C filesconfigure.msg is only used by configure to print its final report and is not needed for compilation. NOTA BENE: unlike previous versions, configure no longer runs the makedeps.sh shell script that updates dependencies. If you modify the program sources, run ./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 tricky part is to get external libraries recognized and used: see Sec.2.3.1 for details and hints.
Environment variables may be set in any of these ways:
export VARIABLE=value # sh, bash, ksh ./configure setenv VARIABLE value # csh, tcsh ./configure ./configure VARIABLE=value # any shellSome 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) CFLAGS, FFLAGS, F90FLAGS, CPPFLAGS, LDFLAGS: compilation flags LIBDIRS: extra directories to search for libraries (see below)For example, the following command line:
./configure MPIF90=mpf90 FFLAGS="-O2 -assume byterecl" \ CC=gcc CFLAGS=-O3 LDFLAGS=-staticinstructs 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) may need to define the correct ARCH even if they are apparently recognized, because configure cannot figure out that cross-compilation is needed. Try the one that looks more similar to your machine type; you'll probably have to do some additional tweaking. 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 mips: SGI MIPS machines alpha: HP-Compaq alpha machines alinux: HP-Compaq alpha running Linux sparc: Sun SPARC machines solaris:PC's running SUN-Solaris crayx1: Cray X1 machines crayxt4: Cray XT4/5 machines macppc: Apple PowerPC machines running Mac OS X 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 compilerNote: x86_64 replaces amd64 since v.4.1. Finally, configure recognizes the following command-line options:
--disable-parallel: compile serial code, even if parallel compiler available --host=target : specify target machine for cross-compilation. target is a string identifying the architecture you want to compile for; run config.guess on the target machine --disable-shared: don't use shared libraries: generate static executables --enable-shared: use shared librariesThe latter two options actually work only in a few specific cases. If you want to modify the configure script (advanced users only!), see the Developer Manual. You will need GNU Autoconf (http://www.gnu.org/software/autoconf/) installed.
QUANTUM ESPRESSO makes use of the following external libraries:
MKL for Intel Linux PCs ACML for AMD Linux PCs ESSL for IBM machines complib.sgimath for SGI Origin SCSL for SGI Altix SUNperf for Sun cxml for HP-Compaq Alphas.If none of these is available, we suggest that you use the optimized ATLAS library (http://math-atlas.sourceforge.net/). Note that ATLAS is not a complete replacement for LAPACK: it contains all of the BLAS, plus the LU code, plus the full storage Cholesky code. Follow the instructions in the ATLAS distributions to produce a full LAPACK replacement.
Sergei Lisenkov reported success and good performances with optimized BLAS by Kazushige Goto. They can be freely downloaded (but not redistributed): http://www.cs.utexas.edu/users/flame/goto/
IBM ESSL SGI SCSL SUN sunperf NEC ASL AMD ACMLIf none of the above is available, you should use FFTW, choosing before compilation whether to load the built-in copy of FFTW or an external v.3 FFTW library. configure will first search for vendor-specific FFT libraries; if none is found, it will search for an external FFTW v.3 library; if none is found, it will fall back to the internal copy of FFTW. Appropriate precompiling options will be set in all cases:
__FFTW internal FFTW __FFTW3 external FFTW v.3 __SCSL SGI SCSL __SUNPERF SUN sunperf __ESSL IBM ESSL ASL NEC ASLIf you have recent versions of MKL installed, you may try the FFTW interface provided with MKL. You will have to compile them (they come in source form with the MKL library) and to modify the make.sys accordingly (MKL must linked after the FFTW-MKL interface)
If everything else fails, you'll have to modify the make.sys file manually: see the section on Manual configuration.
The configure script attempts to find optimized libraries, but may fail if they have been installed in non-standard places. You should examine the final value of BLAS_LIBS, LAPACK_LIBS, FFT_LIBS, MPI_LIBS (if needed), MASS_LIBS (IBM only), either in the output of configure or in the generated make.sys, to check whether it found all the libraries that you intend to use.
If some library was not found, you can specify a list of directories to search in the environment variable LIBDIRS, and rerun configure; directories in the list must be separated by spaces. For example:
./configure LIBDIRS="/opt/intel/mkl70/lib/32 /usr/lib/math"If this still fails, you may set some or all of the *_LIBS variables manually and retry. For example:
./configure BLAS_LIBS="-L/usr/lib/math -lf77blas -latlas_sse"Beware that in this case, configure will blindly accept the specified value, and won't do any extra search.
Please note: If you change any settings 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.
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 templates (each for a different machine type) are provided in the install/ directory: they have names of the form Make.system, where "system" is a string identifying the architecture and compiler.
Obsolete: if you have the Intel compiler ifc v.6 or earlier, you will have to run the script ./ifcmods.sh.
Most likely (and even more so if there isn't an exact match to your machine type), you'll have to tweak make.sys by hand. In particular, you must specify the full list of libraries that you intend to link to.
NOTA BENE: If you modify the program sources, run the makedeps.sh script or type make depend to update files make.depend in the various subdirectories.