mirror of https://gitlab.com/QEF/q-e.git
169 lines
5.8 KiB
Plaintext
169 lines
5.8 KiB
Plaintext
HOW TO CONFIGURE "CONFIGURE" (Gerardo Ballabio)
|
|
|
|
Edit file "configure.ac". File "configure" is regenerated by executing
|
|
"autoconf". If you get a message saying "configure.in not found", you
|
|
have a too old copy of autoconf: install an updated one. autoconf
|
|
overwrites configure: if you want to preserve the old one, make a copy.
|
|
|
|
"configure.ac" contains some autoconf macros, i.e. capitalized names
|
|
starting with AC_, that normally you shouldn't edit. The remaining
|
|
part is a normale bash (not tcsh!) shell script.
|
|
|
|
In order to add a new architecture, you have to add a new case where it
|
|
is needed.
|
|
|
|
1) Look for lines:
|
|
|
|
# check compiling environment
|
|
case $build in
|
|
*-pc-linux-* )
|
|
...
|
|
*-ibm-aix* )
|
|
...
|
|
eccetera )
|
|
|
|
here you have to add the case corresponding to your architecture.
|
|
The string identifying your architecture is obtained by executing
|
|
"config.guess". For instance on a PC it may be "i686-pc-linux-gnu",
|
|
while on IBM sp4 it is "powerpc-ibm-aix5.1.0.0". It is convenient
|
|
to put some asterisks to account for small variations of the string
|
|
for different machines of the same family. For instance, you could
|
|
have aix4.3 instead of 5.1, or athlon instead of i686...
|
|
|
|
Then you have to set the appropriate values for "try_f90", "try_ar",
|
|
"try_arflags". For the latter two, "ar" and "ruv" should be always
|
|
fine, unless some special flag is required (e.g. -X64 with sp4).
|
|
"try_f90" contains the list of candidate Fortran 90 compilers,
|
|
in order of decreasing preference (i.e. configure will use the
|
|
first it finds). I followed this criterion:
|
|
- first look for parallel Fortran 90 compilers (mpif90, mpixlf90_r...)
|
|
- if none is found, look for serial Fortran 90 compilers
|
|
- if nothing is found, look for Fortran 77 compilers:
|
|
they wil not compile PWscf, but one may still try
|
|
|
|
Define also "try_dflags" if the code contains some #ifdef specific to
|
|
your machine: for instance "try_dflags=-D__AIX" or "try_dflags=-D__LINUX".
|
|
You can also define "is_arch=1" where "arch" is the architecture name
|
|
(i.e. is_linux, is_aix, is_mips...) but it is not needed unless it is
|
|
used later to select some library that is specific to that architecture.
|
|
|
|
2) You need to give the list of C and Fortran 77 compilers, also in
|
|
decreasing order of preference. This is done later because the choice
|
|
depends on the Fortran 90 compiler. For instance, if ifc is available,
|
|
you might want to use icc, while if pgf90 is found you may want pgcc.
|
|
This is done where you find:
|
|
|
|
# check Fortran 90 compiler
|
|
if test "$f90" = "" ; then f90="$try_f90" ; fi
|
|
AC_PROG_F77($f90)
|
|
f90=$F77
|
|
|
|
case "$build:$f90" in
|
|
*-pc-linux-*:pgf* )
|
|
...
|
|
*-pc-linux-*:ifort | *-pc-linux-*:ifc )
|
|
...
|
|
et cetera )
|
|
|
|
In general here you have to define only "try_cc" and "try_f77", unless
|
|
your compiler has some weirdness. For instance, for Intel compiler you
|
|
need to know the version because different versions need different flags.
|
|
|
|
3) Where you find:
|
|
|
|
# check whether the C and Fortran compilers are compatible
|
|
case "$build:$cc:$f90" in
|
|
# list supported combinations here
|
|
...
|
|
|
|
you can insert the case corresponding to your architecture, with
|
|
the compilers that are known to work. Otherwise "configure" will
|
|
write a message like this:
|
|
|
|
----------------------------------------------
|
|
WARNING: the following problems were detected:
|
|
|
|
unsupported C/Fortran compilers combination:
|
|
CC=gcc, F77=f77, F90=g77
|
|
|
|
you may not be able to compile this program
|
|
----------------------------------------------
|
|
|
|
which you may however ignore.
|
|
|
|
4) Then you have to choose the flags to be used with the various
|
|
compilers. Look for lines:
|
|
|
|
# check compilers flags
|
|
case "$build:$f90" in
|
|
*-pc-linux-* )
|
|
...
|
|
*-ibm-aix*:mpxlf* | *-ibm-aix*:xlf* )
|
|
...
|
|
eccetera )
|
|
|
|
insert your case and define:
|
|
- "try_fflags": flags for Fortran 77
|
|
- "try_f90flags": flags for Fortran 90. In most case they will be the
|
|
same as in Fortran 77 plus some others. In that case, define them as
|
|
"\$(FFLAGS) -something_else".
|
|
- "try_fflags_noopt": flags for Fortran 77 with no optimization.
|
|
It is needed to compile flib/dlamch.f, used by flib/lapack.f,
|
|
if lapack is compiled from source. Usually, "-O0".
|
|
- "try_ldflags": flags for the linking phase, excluding libraries
|
|
- "try_dflags": must be defined if there is in the code some #ifdef
|
|
specific to your compiler, for instance -D__PGI, -D__INTEL.
|
|
Define it as "$try_dflags -D..." so that pre-existing flags, if any,
|
|
are conserved.
|
|
- if you need a different preprocessor from the standard one ($CC -E),
|
|
define it in "try_cpp".
|
|
- if the Fortran 90 compiler can do C-style preprocessing (the rule
|
|
to be used is "install/Rules.nocpp"), define "have_cpp=1";
|
|
otherwise, if preprocessing is to be performed by the C preprocessor
|
|
(the rule i s"install/Rules.cpp"), don't specify "have_cpp".
|
|
|
|
Where you find:
|
|
|
|
case "$build:$cc" in
|
|
*-pc-linux-*:mpicc )
|
|
...
|
|
*-pc-linux-*:pgcc )
|
|
...
|
|
eccetera )
|
|
|
|
define "try_cflags". Finally where you find:
|
|
|
|
# preprocessor
|
|
AC_PROG_CPP
|
|
if test "$cpp" = "" ; then cpp=$try_cpp; fi
|
|
if test "$cpp" = "" ; then cpp=$CPP; fi
|
|
|
|
echo $ECHO_N "setting CPPFLAGS... $ECHO_C"
|
|
case $cpp in
|
|
cpp) try_cppflags="-P -traditional" ;;
|
|
fpp) try_cppflags="-P" ;;
|
|
...
|
|
|
|
insert the case for your preprocessor, but only if you use a
|
|
nonstandard one
|
|
|
|
5) Finally you have to tell "configure" which libraries to load and
|
|
where to look for them. If you have optimized machine-specific
|
|
libraries available (for instance, essl on sp4, mkl on linux/ifc),
|
|
you have to add a case where you find:
|
|
|
|
# use vendor libraries if available
|
|
if test $is_aix
|
|
then
|
|
...
|
|
elif test $is_linux
|
|
then
|
|
...
|
|
eccetera
|
|
|
|
This is unfortunately a little bit complex to explain.
|
|
|
|
If you need just generic libraries (lapack, blas, fftw) but they aren't
|
|
found because they are in a "nonstandard" location, add the directory
|
|
where they are to the "libpath" for that library.
|