mirror of https://gitlab.com/QEF/q-e.git
349 lines
14 KiB
Plaintext
349 lines
14 KiB
Plaintext
----------------------------------------------------------------------
|
|
INSTALLATION INSTRUCTIONS
|
|
----------------------------------------------------------------------
|
|
|
|
More detailed instructions can be found in the Quantum-ESPRESSO User's
|
|
Guide: you can find it in the "Doc/" directory of the Quantum-ESPRESSO
|
|
source distribution, or download it from
|
|
http://www.pwscf.org/guide.htm
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
To install Quantum-ESPRESSO from source, you need working C and
|
|
Fortran-95 compilers (Fortran-90 is not sufficient, but most
|
|
"Fortran-90" compilers are actually Fortran-95-compliant).
|
|
These compilers must be in your PATH or otherwise their full
|
|
path must be explicitly given.
|
|
If you don't have a commercial Fortran-95 compiler, you may install the
|
|
free "g95" compiler (http://www.g95.org/) or the GNU fortran compiler
|
|
"gfortran" (http://www.gfortran.org/).
|
|
|
|
You also need a minimal Unix environment: basically, a command shell
|
|
(e.g., "bash" or "tcsh") and the utilities "make", "awk" and "sed".
|
|
MS-Windows users need to have Cygwin (a UNIX environment which runs
|
|
under Windows) installed: see http://www.cygwin.com/
|
|
|
|
Instructions for the impatient:
|
|
|
|
./configure
|
|
make all
|
|
|
|
Executable programs (actually, symlinks to them) will be placed in the
|
|
"bin/" directory.
|
|
|
|
If you have problems or would like to tweak the default settings, read
|
|
the detailed instructions below.
|
|
|
|
----------------------------------------------------------------------
|
|
CONFIGURE
|
|
----------------------------------------------------------------------
|
|
|
|
To configure 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 (Itanium
|
|
and Opteron) PCs and clusters, IBM SP machines, SGI Origin, some
|
|
HP-Compaq Alpha machines, Cray X1, Mac OS X, MS-Windows PCs, NEC SX6
|
|
(with cross compilation). It may work with some assistance also on
|
|
other architectures (see below). If it fails and you do not manage
|
|
to convince it to work, see the MANUAL INSTALLATION section below.
|
|
|
|
For cross-compilation, you have to specify the target machine with the
|
|
"--host" option (see below). This feature hasn't been tested
|
|
extensively, 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 the type of fortran variable
|
|
containing a C pointer.
|
|
"include/c_defs.h": defines C to fortran calling convention
|
|
and a few more things (used by C files)
|
|
"configure.msg" is only used by "configure" to print its final report.
|
|
It isn't 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".
|
|
|
|
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 most tricky part is to get external libraries recognized
|
|
and used: see the next section 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 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 : names of parallel compilers
|
|
CFLAGS, FFLAGS, F90FLAGS : compilation flags
|
|
LDFLAGS : linker 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=-static
|
|
|
|
instructs "configure" to use "mpf90" as parallel Fortran 90 compiler
|
|
with flags "-O2 -assume byterecl", "gcc" as C compiler with flags
|
|
"-O3", and to link with flags "-static". Note that the value of
|
|
FFLAGS must be quoted, because it contains spaces.
|
|
|
|
If your machine type is unknown to "configure", you may use the "ARCH"
|
|
variable to suggest an architecture among supported ones.
|
|
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
|
|
amd64 AMD 64-bit (Opteron) running Linux
|
|
aix IBM AIX machines
|
|
mips SGI MIPS machines
|
|
alpha HP-Compaq alpha machines
|
|
alinux HP-Compaq alpha running Linux
|
|
sparc Sun SPARC machines
|
|
crayx1 Cray X1 machines
|
|
macppc Apple PowerPC running Mac OS X
|
|
mac686 Apple Intel running Mac OS X
|
|
cygwin MS-Windows PCs with Cygwin
|
|
necsx NEC SX6
|
|
|
|
Finally, "configure" recognizes the following command-line options:
|
|
|
|
--disable-parallel : compile serial code, even if parallel
|
|
environment is available.
|
|
--disable-shared : don't use shared libraries: generate static
|
|
executables.
|
|
--enable-shared : use shared libraries.
|
|
--host=target : specify target machine for cross-compilation.
|
|
"Target" must be a string identifying the architecture
|
|
that you want to compile for; you can obtain it by running
|
|
"config.guess" on the target machine.
|
|
|
|
If you want to modify the "configure" script itself (advanced users
|
|
only!), read the instructions in "README.configure" first. You'll
|
|
need GNU Autoconf (http://www.gnu.org/software/autoconf/).
|
|
|
|
If "configure" fails and you cannot find a way to have it produce a
|
|
make.sys file, see the "MANUAL INSTALLATION PROCEDURE" section below
|
|
|
|
----------------------------------------------------------------------
|
|
LIBRARIES
|
|
|
|
Quantum-ESPRESSO makes use of the following external libraries:
|
|
|
|
BLAS (http://www.netlib.org/blas/) and LAPACK
|
|
(http://www.netlib.org/lapack/) for linear algebra
|
|
FFTW (http://www.fftw.org/) for Fast Fourier Transforms
|
|
|
|
A copy of the needed routines is provided with the distribution.
|
|
However, when available, optimized vendor-specific libraries can be
|
|
used instead: this often yields huge performance gains.
|
|
|
|
Quantum-ESPRESSO can use the following architecture-specific
|
|
replacements for BLAS and LAPACK:
|
|
|
|
essl for IBM machines
|
|
complib.sgimath for SGI Origin
|
|
SCSL for SGI Altix
|
|
sunperf for Sun
|
|
MKL for Intel Linux PCs
|
|
ACML for AMD Linux PCs
|
|
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. Missing routines are compiled into flib/lapack_atlas.a and should
|
|
be loaded together with ATLAS, unless you have an ATLAS library that
|
|
contains a full LAPACK replacement (follow the instructions in the
|
|
ATLAS distribution)
|
|
|
|
Axel Kohlmeyer maintains a set of ATLAS libraries, containing all of
|
|
LAPACK and no external reference to fortran libraries:
|
|
http://www.theochem.rub.de/~axel.kohlmeyer/cpmd-linux.html#atlas
|
|
|
|
Sergei Lisenkov reported success and good performances with
|
|
optimized BLAS by Kazushige Goto.
|
|
They can be downloaded freely (but not redistributed!) from:
|
|
http://www.cs.utexas.edu/users/flame/goto/
|
|
|
|
At compilation time you have to choose whether to use the built-in
|
|
copy of FFTW (v.<3), a precompiled FFTW v.<3 library, or a
|
|
precompiled FFTW v.3 library. This is done using preprocessing
|
|
options with rather obvious meaning : __FFTW, __USE_INTERNAL_FFTW, __FFTW3
|
|
|
|
The FFTW library can also be replaced by vendor-specific FFT libraries,
|
|
when available.
|
|
|
|
Finally, Quantum-ESPRESSO can use the MASS vector math library from
|
|
IBM, if available (only on AIX).
|
|
|
|
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 any libraries weren't 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"
|
|
|
|
Alternatively you can set environmental variable LD_LIBRARY_PATH
|
|
to contain the path to the missing libraries. 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. This is so that if
|
|
"configure" finds any library that you don't want to use, you can
|
|
override it.
|
|
|
|
If you want to use a precompiled FFTW v.<3 library, you will need
|
|
the corresponding "fftw.h" include file. That may or may not have been
|
|
installed on your system together with the library: in particular,
|
|
most Linux distributions split libraries into ``base'' and
|
|
``development'' packages, include files normally belonging to the
|
|
latter. Thus if you can't find "fftw.h" on your machine, chances are
|
|
you must install the FFTW development package (how to do this and
|
|
what it is exactly called depends on your operating system version).
|
|
|
|
If instead the file is there, but "configure" doesn't find it, you may
|
|
specify its location in the INCLUDEFFTW environment variable.
|
|
For example:
|
|
|
|
./configure INCLUDEFFTW="/usr/lib/fftw-2.1.3/fftw"
|
|
|
|
If everything else fails, you'll have to write the "make.sys" file
|
|
manually: see the "MANUAL INSTALLATION PROCEDURE" section below
|
|
|
|
*** 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.
|
|
|
|
----------------------------------------------------------------------
|
|
COMPILE
|
|
----------------------------------------------------------------------
|
|
|
|
There are a few adjustable parameters in "Modules/parameters.f90".
|
|
The present values will work for most cases. All other variables are
|
|
dynamically allocated: you do not need to recompile your code for a
|
|
different system.
|
|
|
|
At your option, you may compile the complete Quantum-ESPRESSO suite of
|
|
programs (with "make all"), or only some specific programs.
|
|
|
|
"make" with no arguments yields a list of valid compilation targets.
|
|
Here is a list:
|
|
|
|
make pw compile PW/pw.x (electronic and ionic optimization)
|
|
make cp compile CPV/cp.x (Car-Parrinello MD with ultrasoft
|
|
pseudopotentials)
|
|
make ph compile PH/ph.x (phonons)
|
|
make pp compile postprocessing codes in the PP directory
|
|
make gamma compile Gamma/phcg.x (Gamma-only version of ph.x)
|
|
make pwcond compile PWCOND/pwcond.x (ballistic conductance)
|
|
make d3 compile D3/d3.x (third-order energy derivatives)
|
|
make raman compile Raman/ram.x (Raman cross-section calculation)
|
|
make tools compile pwtools/* (miscellaneous tools for data
|
|
analysis)
|
|
|
|
make ld1 compile atomic/ld1.x code for pseudopotential generation
|
|
make upf compile upftools/* (utilities for pseudopotential
|
|
conversion)
|
|
|
|
make pwall same as "make pw ph pp d3 raman pwcond gamma tools"
|
|
make all same as "make pwall ld1 cp upf"
|
|
|
|
make clean remove object files and executables
|
|
make veryclean remove configuration files too
|
|
make tar build a tarball of the current source tree
|
|
|
|
For more detailed information, see the Quantum-ESPRESSO User's Guide.
|
|
|
|
----------------------------------------------------------------------
|
|
MANUAL INSTALLATION PROCEDURE
|
|
----------------------------------------------------------------------
|
|
|
|
This installation procedure is provided for architectures that are
|
|
not yet or no longer supported by "configure".
|
|
|
|
From the the top directory of the Quantum-ESPRESSO source tree,
|
|
at the shell prompt, issue the following command:
|
|
|
|
ls install/Make.*
|
|
|
|
There should be architecture-dependent templates for the following
|
|
machines;
|
|
|
|
alpha HP-Compaq alpha workstations
|
|
alphaMPI HP-Compaq alpha parallel machines
|
|
altix SGI Altix 350/3000 with Linux, Intel compiler
|
|
beo_ifc Linux clusters of PCs, Intel compiler
|
|
beowulf Linux clusters of PCs, Portland compiler
|
|
bgl IBM BG/L
|
|
cray-xd1 CRAY XD1
|
|
cray-xt3 CRAY XTr3
|
|
cygwin Windows PC, Intel compiler
|
|
fujitsu Fujitsu vector machines
|
|
gfortran GNU gfortran
|
|
hitachi Hitachi SR8000
|
|
hp HP PA-RISC workstations
|
|
hpMPI HP PA-RISC parallel machines
|
|
ia64 HP Itanium workstations
|
|
irix SGI workstations
|
|
macos-xlf MAC OS-X for PPC machines with xlf
|
|
macos-intel MAC OS-X for Intel CPUs with ifort compiler and mkl
|
|
origin SGI Origin 2000/3000
|
|
pc_abs Linux PCs, Absoft compiler
|
|
pc_ifc Linux PCs, Intel compiler
|
|
pc_lahey Linux PCs, Lahey compiler
|
|
pc_pgi Linux PCs, Portland compiler
|
|
power5-aix-serial
|
|
IBM Power5, serial
|
|
power5-aix-parallel
|
|
IBM Power5, parallel
|
|
sun Sun workstations
|
|
sunMPI Sun parallel machines
|
|
sxcross NEC SX6 (cross-compilation)
|
|
|
|
Note that some of them may be obsolete or badly outdated.
|
|
Choose a suitable Make.* and copy it into make.sys:
|
|
|
|
cp install/Make."the chosen architecture" make.sys
|
|
|
|
Edit the file "make.sys" to adapt to your local configuration:
|
|
typically, you'll have to specify where libraries are placed on
|
|
your system. Follow the explanations inside the file make.sys.
|
|
|
|
If you are using an old version of the ifc compiler, you need
|
|
to run the script "./ifcmods.sh".
|
|
|
|
If "configure" has run till the end, it should have produced
|
|
the correct files "include/fft_defs.h" and "include/c_defs.h".
|
|
If not, follow the explanations in "include/defs.h.README".
|
|
|
|
At this stage you are ready to move back to the 'COMPILE" section above
|