Commit 304b539c authored by Andreas Marek's avatar Andreas Marek

ELPA_development_version_qr: updated build procedure

Identical to ELPA 2013.11.001 the build procedure is updated

  - updated INSTALL documentation
  - improved description of kernels src/elpa2_kernels/README_elpa2_kernels.txt
  - improved OpenMP builds:
      * usage of OpenMP can now be specified with
        "--enable-openmp" or "--with-openmp"
  - improved checks for AVX build (identical to ELPA 2013.08.003):
     * if AVX kernels are specified AVX compilation is tested
     * the option "--with-avx-optimization" automatically updates
       CFLAGS and CXXFLAGS with optimization flags
parent 04566b03
......@@ -4,13 +4,10 @@ How to install ELPA:
ELPA is shipped with a typical "configure" and "make" procedure. It is
recommended to use this way to install ELPA, see (A). If you do not want to
install ELPA as library, but to include it in your source code, please refer
to point (B)
you can find a
"Makefile.example" in ./test, to see how this is done. Please distibute then
all files of ELPA with your code.
to point (B). An example makefile "Makefile.example" can be found in ./test,
to give some hints how this is done. Please distibute then all files of ELPA
with your code. Please note, that usage of ELPA as described in Section (B)
requires advanced knowledge about compilers, preprocessor flags, and optimizations.
(A): Installing ELPA as library with configure
......@@ -43,18 +40,20 @@ The configure installation is best done in four steps
You can either specify your own builds of lapack/blacs/scalapack
or use specialized Vendor packages, e.g. if available you can use
Intel's MKL. If you do not set these variables ELPA will not be
build!
Intel's MKL. If you do not set the variables "BLACS_LDFLAGS" and
"BLACS_FCFLAGS" ELPA will not be build!
Please set the optimisation that you would like with the
variable "FCFLAGS", "CFLAGS", and "CXXFLAGS", e.g. FCFLAGS="-O3 -xAVX".
For some elpa2-kernels, it is MANDATORY to set a few options,
variable "FCFLAGS", "CFLAGS", and "CXXFLAGS", e.g. FCFLAGS="-O3 -xAVX",
please see "./src/elpa2_kernels/README_elpa2_kernels.txt".
Set the "prefix" - flag, if you wish another installation location than
the default "/usr/local/".
If you want to use the hybrid MPI/OpenMP version of ELPA please specify
"--enable-openmp" or "--with-openmp"
Note, that at the moment we do not officially support "cross compilation"
allthough it should work.
......
......@@ -690,6 +690,7 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOUND = @CPP_FOUND@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
......
This diff is collapsed.
......@@ -7,6 +7,16 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
#AM_SILENT_RULES([yes])
AX_CHECK_GNU_MAKE()
if test x$_cv_gnu_make_command = x ; then
AC_MSG_ERROR([Need GNU Make])
fi
AC_CHECK_PROG(CPP_FOUND,cpp,yes,no)
if test "x${CPP_FOUND}" = xno; then
AC_MSG_ERROR([no cpp found])
fi
AC_PROG_INSTALL
AM_PROG_CC_C_O
......@@ -14,27 +24,6 @@ AM_PROG_AR
AM_PROG_AS
AC_PROG_CXX
AC_LANG(Fortran)
m4_include([m4/ax_prog_fc_mpi.m4])
dnl check whether an mpi compiler is available;
dnl if not abort since it is mandatory
AX_PROG_FC_MPI([],[have_mpi=yes],[have_mpi=no
if test "x${have_mpi}" = xno; then
AC_MSG_ERROR([no mpi found])
fi])
AC_SUBST([ELPA_LIB_VERSION], [2013.08.001])
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
AC_SUBST([ELPA_SO_VERSION], [0:0:0])
AC_FC_FREEFORM
AC_FC_MODULE_FLAG
AC_FC_MODULE_OUTPUT_FLAG
dnl macro for an --with-$2 switch that sets the
dnl preprocessor define $1, with description $3, default $4, possible values $5
AC_DEFUN([DEFINE_OPTION],[
......@@ -102,6 +91,105 @@ DEFINE_OPTION([WITH_AVX_REAL_BLOCK6], [avx-real-block6],
[no],[])
dnl check whether we better check if AVX compilation should work
if test "x${with_avx_sandybridge}" = xyes; then
check_avx_compilation=yes
fi
if test "x${with_amd_bulldozer}" = xyes; then
check_avx_compilation=yes
fi
if test "x${with_avx_complex_block1}" = xyes; then
check_avx_compilation=yes
fi
if test "x${with_avx_complex_block2}" = xyes; then
check_avx_compilation=yes
fi
if test "x${with_avx_real_block2}" = xyes; then
check_avx_compilation=yes
fi
if test "x${with_avx_real_block4}" = xyes; then
check_avx_compilation=yes
fi
if test "x${with_avx_real_block6}" = xyes; then
check_avx_compilation=yes
fi
dnl if necessary do the check for avx compilation
if test "x${check_avx_compilation}" = xyes; then
dnl check whether one can compile with avx - gcc intrinsics
AC_MSG_CHECKING([whether we can compile a gcc intrinsic AVX program])
dnl first pass: try with specified CFLAGS and CXXFLAGS
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
void main(){
double* q;
__m256d a1_1 = _mm256_load_pd(q);
}
])],
[can_compile_avx_prog=yes],
[can_compile_avx_prog=no]
)
dnl first test failed: try again after updating CFLAGS and CXXFLAGS with -mavx
if test "x${can_compile_avx_prog}" = xno; then
CFLAGS="$CFLAGS -mavx"
CXXFLAGS="$CXXFLAGS -mavx"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
void main(){
double* q;
__m256d a1_1 = _mm256_load_pd(q);
}
])],
[can_compile_avx_prog=yes],
[can_compile_avx_prog=no]
)
fi
AC_MSG_RESULT([${can_compile_avx_prog}])
if test "x${can_compile_avx_prog}" = xno; then
AC_MSG_ERROR([could not compile with gcc AVX intrinsic! Maybe choose another kernel])
fi
fi
dnl set the AVX optimization flags if this option is specified
AC_MSG_CHECKING(whether AVX optimization flags should be set automatically)
AC_ARG_WITH([avx-optimization],
AS_HELP_STRING([--with-avx-optimization],
[use AVX optimization, default no.]),
[with_avx_optimization=yes],
[with_avx_optimization=no])
AC_MSG_RESULT([${with_avx_optimization}])
if test "x${with_avx_optimization}" = xyes; then
CFLAGS="$CFLAGS -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize"
CXXFLAGS="$CXXFLAGS -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize"
fi
AC_LANG(Fortran)
m4_include([m4/ax_prog_fc_mpi.m4])
dnl check whether an mpi compiler is available;
dnl if not abort since it is mandatory
AX_PROG_FC_MPI([],[have_mpi=yes],[have_mpi=no
if test "x${have_mpi}" = xno; then
AC_MSG_ERROR([no mpi found])
fi])
AC_SUBST([ELPA_LIB_VERSION], [2013.11.001])
# this is the version of the API, should be changed in the major revision
# if and only if the actual API changes
AC_SUBST([ELPA_SO_VERSION], [0:0:0])
AC_FC_FREEFORM
AC_FC_MODULE_FLAG
AC_FC_MODULE_OUTPUT_FLAG
AC_MSG_CHECKING(whether OpenMP usage is specified)
AC_ARG_WITH([openmp],
AS_HELP_STRING([--with-openmp],
......@@ -109,6 +197,11 @@ AC_ARG_WITH([openmp],
[with_openmp=yes],
[with_openmp=no])
AC_MSG_RESULT([${with_openmp}])
if test "x${enable_openmp}" = xyes; then
with_openmp=yes
AC_MSG_CHECKING(whether --enable-openmp is specified)
AC_MSG_RESULT([${enable_openmp}])
fi
AM_CONDITIONAL([WITH_OPENMP],[test x"$with_openmp" = x"yes"])
if test "x${with_openmp}" = xyes; then
AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading])
......
......@@ -27,8 +27,13 @@ Currently we offer the following alternatives for the ELPA2 kernels:
in the hope to get optimal code from most FORTRAN
compilers. The configure option "--with-generic"
uses these kernels. They are propably a good
default if you do not know which kernel to use.
default if you do not know which kernel
to use. Note that in the real version,
there is used a complex variable in
order to enforce better compiler
optimizations. This produces correct
code, however, some compilers might
produce a warning.
......@@ -88,6 +93,10 @@ Several
-ftree-vectorize"
for best performace results.
For convenience the flag
"--with-avx-optimization" sets these
CFLAGS and CXXFLAGS automatically.
On Intel Sandybridge architectures the
configure option "--with-intel-sandybride"
use the best combination.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment