Commit 7ea5c43a authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Make ELPA ready for packaging as RPM

This includes a number of changes:

- ScaLAPACK2 on from the openSUSE:science repository is now correctly
  auto-detected. As ScaLAPACK2 already includes BLACS, an additional
  BLACS library must not be linked!

- The resulting library is now called elpa-2014.06.000.so, as was
  probably originally intended anyway

- The pkg-config file was renamed to elpa-2014.06.000.pc and filled with
  correct values. With this, a package using ELPA can easily get the
  necessary compilation and library flags.

In this commit, only the "precious" files (Makefile.am, configure.ac,
etc.) are included, to make clear what has been changed by hand.

In the subsequent commit also all autoconf generated files will follow.
parent 0811dfc5
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 ## Process this file with automake to produce Makefile.in
AM_FCFLAGS = @AM_FCFLAGS@ @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = @AM_LDFLAGS@ @BLACS_LDFLAGS@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
BLACS_LDFLAGS = @BLACS_LDFLAGS@ AM_FCFLAGS = $(SCALAPACK_FCFLAGS) @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
# libelpa # libelpa
if WITH_OPENMP if WITH_OPENMP
lib_LTLIBRARIES = libelpa_mt.la lib_LTLIBRARIES = libelpa-@PACKAGE_VERSION@_mt.la
else else
lib_LTLIBRARIES = libelpa.la lib_LTLIBRARIES = libelpa-@PACKAGE_VERSION@.la
endif endif
##rule to produce fortran config file: ##rule to produce fortran config file:
...@@ -18,138 +17,138 @@ endif ...@@ -18,138 +17,138 @@ endif
# grep "^#define" ./config.h > $@ # grep "^#define" ./config.h > $@
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES = src/elpa1.F90 src/elpa2.F90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES = src/elpa1.F90 src/elpa2.F90
else else
libelpa_la_SOURCES = src/elpa1.F90 src/elpa2.F90 libelpa_@PACKAGE_VERSION@_la_SOURCES = src/elpa1.F90 src/elpa2.F90
endif endif
if WITH_REAL_GENERIC_KERNEL if WITH_REAL_GENERIC_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real.f90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real.f90
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real.f90 libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real.f90
endif endif
endif endif
if WITH_COMPLEX_GENERIC_KERNEL if WITH_COMPLEX_GENERIC_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90 libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90
endif endif
endif endif
if WITH_REAL_GENERIC_SIMPLE_KERNEL if WITH_REAL_GENERIC_SIMPLE_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.f90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.f90
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.f90 libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.f90
endif endif
endif endif
if WITH_COMPLEX_GENERIC_SIMPLE_KERNEL if WITH_COMPLEX_GENERIC_SIMPLE_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90 libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90
endif endif
endif endif
if WITH_REAL_BGP_KERNEL if WITH_REAL_BGP_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90 libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90
endif endif
endif endif
if WITH_REAL_BGQ_KERNEL if WITH_REAL_BGQ_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90 libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90 libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90
endif endif
endif endif
if WITH_REAL_SSE_KERNEL if WITH_REAL_SSE_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
endif endif
else else
if WITH_COMPLEX_SSE_KERNEL if WITH_COMPLEX_SSE_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
endif endif
endif endif
endif endif
if WITH_REAL_AVX_BLOCK2_KERNEL if WITH_REAL_AVX_BLOCK2_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c
endif endif
endif endif
if WITH_REAL_AVX_BLOCK4_KERNEL if WITH_REAL_AVX_BLOCK4_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c
endif endif
endif endif
if WITH_REAL_AVX_BLOCK6_KERNEL if WITH_REAL_AVX_BLOCK6_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c
endif endif
endif endif
if WITH_COMPLEX_AVX_BLOCK1_KERNEL if WITH_COMPLEX_AVX_BLOCK1_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
endif endif
endif endif
if WITH_COMPLEX_AVX_BLOCK2_KERNEL if WITH_COMPLEX_AVX_BLOCK2_KERNEL
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp
else else
libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp
endif endif
endif endif
#if WITH_AVX_SANDYBRIDGE #if WITH_AVX_SANDYBRIDGE
#if WITH_OPENMP #if WITH_OPENMP
# libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \ # libelpa_@PACKAGE_VERSION@_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \
src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp # src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
#else #else
# libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \ # libelpa_@PACKAGE_VERSION@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \
src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp # src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
#endif #endif
#endif #endif
if WITH_OPENMP if WITH_OPENMP
libelpa_mt_la_LDFLAGS = -version-info $(ELPA_SO_VERSION) libelpa_@PACKAGE_VERSION@_mt_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
else else
libelpa_la_LDFLAGS = -version-info $(ELPA_SO_VERSION) libelpa_@PACKAGE_VERSION@_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
endif endif
# install any .mod files in the include/ dir # install any .mod files in the include/ dir
elpa_includedir = $(includedir)/elpa elpa_includedir = $(includedir)/elpa-@PACKAGE_VERSION@
nobase_elpa_include_HEADERS = $(wildcard modules/*) nobase_elpa_include_HEADERS = $(wildcard modules/*)
# other files to distribute # other files to distribute
filesdir = $(datarootdir) filesdir = $(datadir)/@PACKAGE@-@PACKAGE_VERSION@/examples
files_DATA = \ dist_files_DATA = \
test/read_real.F90 \ test/read_real.F90 \
test/read_real_gen.F90 \ test/read_real_gen.F90 \
test/test_complex2.F90 \ test/test_complex2.F90 \
...@@ -166,57 +165,62 @@ files_DATA = \ ...@@ -166,57 +165,62 @@ files_DATA = \
# test programs # test programs
if WITH_OPENMP if WITH_OPENMP
build_lib = libelpa_mt.la build_lib = libelpa-@PACKAGE_VERSION@_mt.la
else else
build_lib = libelpa.la build_lib = libelpa-@PACKAGE_VERSION@.la
endif endif
# pkg-config stuff # pkg-config stuff
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = elpa.pc pkgconfig_DATA = elpa-@PACKAGE_VERSION@.pc
# test programs # test programs
#bindir = $(abs_top_builddir) #bindir = $(abs_top_builddir)
bin_PROGRAMS = test_real test_real2 test_real2_default_kernel test_complex test_complex2 test_complex2_default_kernel test_real2_choose_kernel_with_api test_complex2_choose_kernel_with_api print_available_elpa2_kernels testsdir = $(datadir)/@PACKAGE@-@PACKAGE_VERSION@/tests
tests_PROGRAMS = test_real test_real2 test_real2_default_kernel test_complex test_complex2 test_complex2_default_kernel test_real2_choose_kernel_with_api test_complex2_choose_kernel_with_api
bin_PROGRAMS = print_available_elpa2_kernels
test_real_SOURCES = test/test_real.F90 test_real_SOURCES = test/test_real.F90
test_real_LDADD = $(build_lib) test_real_LDADD = $(build_lib)
test_real_LDFLAGS = -static test_real_LDFLAGS = $(AM_LDFLAGS) -static
test_real2_SOURCES = test/test_real2.F90 test_real2_SOURCES = test/test_real2.F90
test_real2_LDADD = $(build_lib) test_real2_LDADD = $(build_lib)
test_real2_LDFLAGS = -static test_real2_LDFLAGS = $(AM_LDFLAGS) -static
test_real2_default_kernel_SOURCES = test/test_real2_default_kernel.F90 test_real2_default_kernel_SOURCES = test/test_real2_default_kernel.F90
test_real2_default_kernel_LDADD = $(build_lib) test_real2_default_kernel_LDADD = $(build_lib)
test_real2_default_kernel_LDFLAGS = -static test_real2_default_kernel_LDFLAGS = $(AM_LDFLAGS) -static
test_real2_choose_kernel_with_api_SOURCES = test/test_real2_choose_kernel_with_api.F90 test_real2_choose_kernel_with_api_SOURCES = test/test_real2_choose_kernel_with_api.F90
test_real2_choose_kernel_with_api_LDADD = $(build_lib) test_real2_choose_kernel_with_api_LDADD = $(build_lib)
test_real2_choose_kernel_with_api_LDFLAGS = -static test_real2_choose_kernel_with_api_LDFLAGS = $(AM_LDFLAGS) -static
test_complex_SOURCES = test/test_complex.F90 test_complex_SOURCES = test/test_complex.F90
test_complex_LDADD = $(build_lib) test_complex_LDADD = $(build_lib)
test_complex_LDFLAGS = -static test_complex_LDFLAGS = $(AM_LDFLAGS) -static
test_complex2_SOURCES = test/test_complex2.F90 test_complex2_SOURCES = test/test_complex2.F90
test_complex2_LDADD = $(build_lib) test_complex2_LDADD = $(build_lib)
test_complex2_LDFLAGS = -static test_complex2_LDFLAGS = $(AM_LDFLAGS) -static
test_complex2_default_kernel_SOURCES = test/test_complex2_default_kernel.F90 test_complex2_default_kernel_SOURCES = test/test_complex2_default_kernel.F90
test_complex2_default_kernel_LDADD = $(build_lib) test_complex2_default_kernel_LDADD = $(build_lib)
test_complex2_default_kernel_LDFLAGS = -static test_complex2_default_kernel_LDFLAGS = $(AM_LDFLAGS) -static
test_complex2_choose_kernel_with_api_SOURCES = test/test_complex2_choose_kernel_with_api.F90 test_complex2_choose_kernel_with_api_SOURCES = test/test_complex2_choose_kernel_with_api.F90
test_complex2_choose_kernel_with_api_LDADD = $(build_lib) test_complex2_choose_kernel_with_api_LDADD = $(build_lib)
test_complex2_choose_kernel_with_api_LDFLAGS = -static test_complex2_choose_kernel_with_api_LDFLAGS = $(AM_LDFLAGS) -static
print_available_elpa2_kernels_SOURCES = test/print_available_elpa2_kernels.F90 print_available_elpa2_kernels_SOURCES = test/print_available_elpa2_kernels.F90
print_available_elpa2_kernels_LDADD = $(build_lib) print_available_elpa2_kernels_LDADD = $(build_lib)
check_SCRIPTS = test_real.sh test_real2.sh test_real2_default_kernel.sh test_complex.sh test_complex2.sh test_complex2_default_kernel.sh test_real2_choose_kernel_with_api.sh test_complex2_choose_kernel_with_api.sh print_available_elpa2_kernels.sh #check_SCRIPTS = test_real.sh test_real2.sh test_real2_default_kernel.sh test_complex.sh test_complex2.sh test_complex2_default_kernel.sh test_real2_choose_kernel_with_api.sh test_complex2_choose_kernel_with_api.sh print_available_elpa2_kernels.sh
#TESTS = $(check_SCRIPTS)
check_SCRIPTS = print_available_elpa2_kernels.sh
TESTS = $(check_SCRIPTS) TESTS = $(check_SCRIPTS)
test_real.sh: test_real.sh:
...@@ -261,6 +265,18 @@ elpa2.i: $(top_srcdir)/src/elpa2.F90 ...@@ -261,6 +265,18 @@ elpa2.i: $(top_srcdir)/src/elpa2.F90
elpa1.i: $(top_srcdir)/src/elpa1.F90 elpa1.i: $(top_srcdir)/src/elpa1.F90
$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/elpa1.F90 -o $@ $(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/elpa1.F90 -o $@
CLEANFILES = test_real.sh test_real2.sh test_real2_default_kernel.sh test_complex.sh test_complex2.sh test_complex2_default_kernel.sh test_real2_choose_kernel_with_api.sh test_complex2_choose_kernel_with_api.sh print_available_elpa2_kernels elpa2.i CLEANFILES = \
test_real.sh \
test_real2.sh \
test_real2_default_kernel.sh \
test_complex.sh test_complex2.sh \
test_complex2_default_kernel.sh \
test_real2_choose_kernel_with_api.sh \
test_complex2_choose_kernel_with_api.sh \
print_available_elpa2_kernels.sh \
elpa2.i \
config-f90.h \
modules/*
EXTRA_DIST = fdep/fortran_dependencies.pl fdep/fortran_dependencies.mk
@FORTRAN_MODULE_DEPS@ @FORTRAN_MODULE_DEPS@
AC_PREREQ([2.69]) AC_PREREQ([2.69])
AC_INIT([elpa],[2014.06.000], elpa-library@rzg.mpg.de) AC_INIT([elpa],[2014.06.000], elpa-library@rzg.mpg.de)
AC_SUBST([PACKAGE_VERSION])
AC_CONFIG_SRCDIR([src/elpa1.F90]) AC_CONFIG_SRCDIR([src/elpa1.F90])
AM_INIT_AUTOMAKE([foreign -Wall subdir-objects]) AM_INIT_AUTOMAKE([foreign -Wall subdir-objects])
...@@ -18,8 +19,6 @@ AM_SILENT_RULES([yes]) ...@@ -18,8 +19,6 @@ AM_SILENT_RULES([yes])
rm -rf config.h config-f90.h rm -rf config.h config-f90.h
AC_SUBST([ELPA_LIB_VERSION], [2014.06.000])
# this is the version of the API, should be changed in the major revision # this is the version of the API, should be changed in the major revision
# if and only if the actual API changes # if and only if the actual API changes
# see http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # see http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
...@@ -44,13 +43,12 @@ AM_PROG_CC_C_O ...@@ -44,13 +43,12 @@ AM_PROG_CC_C_O
AM_PROG_AR AM_PROG_AR
AM_PROG_AS AM_PROG_AS
#AC_PROG_CXX # C++
m4_include([m4/ax_prog_cxx_mpi.m4]) m4_include([m4/ax_prog_cxx_mpi.m4])
AX_PROG_CXX_MPI([],[have_mpi=yes],[have_mpi=no AX_PROG_CXX_MPI([],[have_mpi=yes],[have_mpi=no
if test "x${have_mpi}" = xno; then if test x"${have_mpi}" = x"no"; then
AC_MSG_ERROR([no mpi found]) AC_MSG_ERROR([no mpi found])
fi]) fi])
dnl variables needed for the tests dnl variables needed for the tests
...@@ -64,7 +62,7 @@ have_mkl=no ...@@ -64,7 +62,7 @@ have_mkl=no
have_mpi=no have_mpi=no
have_lapack=no have_lapack=no
have_scalapack=no have_scalapack=no
dnl these tests will decide which kernels can be build dnl these tests will decide which kernels can be build
dnl the usual case is all except the BlueGene (bg) kernels dnl the usual case is all except the BlueGene (bg) kernels
...@@ -676,8 +674,8 @@ dnl check whether one can compile with avx - gcc intrinsics ...@@ -676,8 +674,8 @@ dnl check whether one can compile with avx - gcc intrinsics
AC_MSG_CHECKING([whether we can compile a gcc intrinsic AVX program]) AC_MSG_CHECKING([whether we can compile a gcc intrinsic AVX program])
dnl first pass: try with specified CFLAGS and CXXFLAGS dnl first pass: try with specified CFLAGS and CXXFLAGS
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h> #include <x86intrin.h>
void main(){ void main(){
double* q; double* q;
__m256d a1_1 = _mm256_load_pd(q); __m256d a1_1 = _mm256_load_pd(q);
...@@ -690,8 +688,8 @@ dnl first test failed: try again after updating CFLAGS and CXXFLAGS with -mavx ...@@ -690,8 +688,8 @@ dnl first test failed: try again after updating CFLAGS and CXXFLAGS with -mavx
if test x"${can_compile_avx}" = x"no"; then if test x"${can_compile_avx}" = x"no"; then
CFLAGS="$CFLAGS -mavx" CFLAGS="$CFLAGS -mavx"
CXXFLAGS="$CXXFLAGS -mavx" CXXFLAGS="$CXXFLAGS -mavx"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h> #include <x86intrin.h>
void main(){ void main(){
double* q; double* q;
__m256d a1_1 = _mm256_load_pd(q); __m256d a1_1 = _mm256_load_pd(q);
...@@ -722,7 +720,7 @@ AC_ARG_WITH([avx-optimization], ...@@ -722,7 +720,7 @@ AC_ARG_WITH([avx-optimization],
[with_avx_optimization=yes], [with_avx_optimization=yes],
[with_avx_optimization=no]) [with_avx_optimization=no])
AC_MSG_RESULT([${with_avx_optimization}]) AC_MSG_RESULT([${with_avx_optimization}])
if test x"${with_avx_optimization}" = xyes; then if test x"${with_avx_optimization}" = x"yes"; then
CFLAGS="$CFLAGS -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize" 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" CXXFLAGS="$CXXFLAGS -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize"
fi fi
...@@ -748,29 +746,29 @@ AC_ARG_WITH([openmp], ...@@ -748,29 +746,29 @@ AC_ARG_WITH([openmp],
[with_openmp=yes], [with_openmp=yes],
[with_openmp=no]) [with_openmp=no])
AC_MSG_RESULT([${with_openmp}]) AC_MSG_RESULT([${with_openmp}])
if test x"${enable_openmp}" = xyes; then if test x"${enable_openmp}" = x"yes"; then
with_openmp=yes with_openmp=yes
AC_MSG_CHECKING(whether --enable-openmp is specified) AC_MSG_CHECKING(whether --enable-openmp is specified)
AC_MSG_RESULT([${enable_openmp}]) AC_MSG_RESULT([${enable_openmp}])
fi fi
AM_CONDITIONAL([WITH_OPENMP],[test x"$with_openmp" = x"yes"]) AM_CONDITIONAL([WITH_OPENMP],[test x"$with_openmp" = x"yes"])
if test x"${with_openmp}" = xyes; then if test x"${with_openmp}" = x"yes"; then
AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading]) AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading])
AX_ELPA_OPENMP AX_ELPA_OPENMP
fi fi
FCFLAGS="$FCFLAGS $OPENMP_FCFLAGS $OPENMP_FFFLAGS"
#LDFLAGS="$LDFLAGS $OPENMP_FCFLAGS $OPENMP_FFFLAGS"
save_FCFLAGS=$FCFLAGS save_FCFLAGS=$FCFLAGS
save_LDFLAGS=$LDFLAGS save_LDFLAGS=$LDFLAGS
FCFLAGS="$FCFLAGS $BLACS_FCFLAGS" AC_ARG_VAR([SCALAPACK_LDFLAGS],[Extra LDFLAGS necessary to link a program with Scalapack])
LDFLAGS="$LDFLAGS $BLACS_LDFLAGS" AC_ARG_VAR([SCALAPACK_FCFLAGS],[Extra FCFLAGS necessary to compile a Fortran program with Scalapack])
FCFLAGS="$FCFLAGS $SCALAPACK_FCFLAGS"
LDFLAGS="$LDFLAGS $SCALAPACK_LDFLAGS"
dnl check whether fortran error_unit is defined dnl check whether fortran error_unit is defined
AC_MSG_CHECKING([whether Fortran module iso_fortran_env is available]) AC_MSG_CHECKING([whether Fortran module iso_fortran_env is available])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test_error_unit program test_error_unit
use ISO_FORTRAN_ENV, only : error_unit use ISO_FORTRAN_ENV, only : error_unit
implicit none implicit none
...@@ -787,9 +785,9 @@ dnl check whether one can link with specified MKL (desired method) ...@@ -787,9 +785,9 @@ dnl check whether one can link with specified MKL (desired method)
AC_MSG_CHECKING([whether we can compile a Fortran program using MKL]) AC_MSG_CHECKING([whether we can compile a Fortran program using MKL])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test_mkl program test_mkl
use mkl_service use mkl_service
character*198 :: string character*198 :: string
call mkl_get_version_string(string) call mkl_get_version_string(string)
write(*,'(a)') string write(*,'(a)') string
...@@ -802,9 +800,9 @@ AC_MSG_RESULT([${can_compile_with_mkl}]) ...@@ -802,9 +800,9 @@ AC_MSG_RESULT([${can_compile_with_mkl}])
if test x"$can_compile_with_mkl" = x"yes" ; then if test x"$can_compile_with_mkl" = x"yes" ; then
AC_MSG_CHECKING([whether we can link a Fortran program with MKL]) AC_MSG_CHECKING([whether we can link a Fortran program with MKL])
AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_LINK_IFELSE([AC_LANG_SOURCE([
program test_mkl program test_mkl
use mkl_service use mkl_service
character*198 :: string character*198 :: string
call mkl_get_version_string(string) call mkl_get_version_string(string)
write(*,'(a)') string write(*,'(a)') string
...@@ -828,41 +826,39 @@ else ...@@ -828,41 +826,39 @@ else
if test x"${have_blas}" = x"no" ; then if test x"${have_blas}" = x"no" ; then
AC_MSG_ERROR([could not link with blas: specify path]) AC_MSG_ERROR([could not link with blas: specify path])
fi fi
dnl now lapack dnl now lapack
AC_SEARCH_LIBS([dlarrv],[lapack],[have_lapack=yes],[have_lapack=no]) AC_SEARCH_LIBS([dlarrv],[lapack],[have_lapack=yes],[have_lapack=no])
AC_MSG_CHECKING([whether we can link a program with a lapack lib]) AC_MSG_CHECKING([whether we can link a program with a lapack lib])
AC_MSG_RESULT([${have_lapack}]) AC_MSG_RESULT([${have_lapack}])
if test x"${have_lapack}" = x"no" ; then if test x"${have_lapack}" = x"no" ; then
AC_MSG_ERROR([could not link with lapack: specify path]) AC_MSG_ERROR([could not link with lapack: specify path])
fi fi
dnl now blacs
AC_SEARCH_LIBS([bi_f77_init],[mpiblacsF77init],[],[],[-lmpiblacs])
AC_SEARCH_LIBS([blacs_gridinit],[mpiblacs],[have_blacs=yes],[have_blacs=no])
AC_MSG_CHECKING([whether we can link a program with a blacs lib])
AC_MSG_RESULT([${have_blacs}])
dnl test whether scalapack already contains blacs
scalapack_libs="mpiscalapack scalapack"
AC_SEARCH_LIBS([blacs_gridinit], [$scalapack_libs],[have_blacs=yes],[have_blacs=no])
dnl Test for stand-alone blacs
if test x"${have_blacs}" = x"no"; then
AC_SEARCH_LIBS([bi_f77_init],[mpiblacsF77init],[],[],[-lmpiblacs])
AC_SEARCH_LIBS([blacs_gridinit],[mpiblacs blacs],[have_blacs=yes],[have_blacs=no])
fi
if test x"${have_blacs}" = x"no" ; then if x"${have_blacs}" = x"no"; then
AC_MSG_ERROR([could not link with blacs: specify path]) AC_MSG_ERROR([No usable BLACS or ScaLAPACK 2 found. If installed in a non-standard place, please specify suitable LDFLAGS and FCFLAGS as arguments to configure])
fi fi
dnl now scalapack