elpa/elpa-no-avx.patch

62 lines
2.1 KiB
Diff
Raw Normal View History

diff -up mpich/configure.ac.avx mpich/configure.ac
2015-08-07 11:20:56 +00:00
--- mpich/configure.ac.avx 2015-08-06 17:31:47.819635434 +0200
+++ mpich/configure.ac 2015-08-07 12:42:07.817171493 +0200
@@ -198,8 +198,12 @@ AC_MSG_RESULT([${can_compile_sse}])
dnl check whether one can compile with avx - gcc intrinsics
+save_CFLAGS="$CFLAGS"
+save_CXXFLAGS="$CXXFLAGS"
+
dnl first pass: try with specified CFLAGS and CXXFLAGS
AC_MSG_CHECKING([whether we can compile AVX intrinsics in C])
+CFLAGS="$CFLAGS -mavx"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
@@ -213,6 +217,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
)
AC_MSG_RESULT([${can_compile_avx}])
if test "${can_compile_avx}" = "yes" ; then
2015-08-07 11:20:56 +00:00
+ AVXCFLAGS="-mavx"
+ CXXFLAGS="$CXXFLAGS -mavx"
AC_MSG_CHECKING([whether we can compile AVX intrinsics in C++])
2015-08-07 11:20:56 +00:00
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
@@ -230,9 +236,14 @@ if test "${can_compile_avx}" = "yes" ; t
AC_MSG_RESULT([${can_compile_avx}])
if test "${can_compile_avx}" = "no" ; then
AC_MSG_WARN([Cannot compile C++ with AVX: disabling AVX alltogether])
+ else
2015-08-07 11:20:56 +00:00
+ AVXCXXFLAGS="-mavx"
fi
fi
2015-08-07 11:20:56 +00:00
+CFLAGS=$save_CFLAGS
+CXXFLAGS=$save_CXXFLAGS
+
if test "${can_compile_avx}" = "yes" ; then
2015-08-07 11:20:56 +00:00
install_real_avx_block2=yes
install_real_avx_block4=yes
@@ -634,6 +645,8 @@ AC_SUBST([OPENMP_CFLAGS])
AC_SUBST([OPENMP_FCFLAGS])
AC_SUBST([OPENMP_LDFLAGS])
#AC_SUBST(OPT_FCFLAGS)
+AC_SUBST([AVXCFLAGS])
2015-08-07 11:20:56 +00:00
+AC_SUBST([AVXCXXFLAGS])
rm -rf modules/ .fortran_dependencies/
mkdir modules
diff -up mpich/Makefile.am.avx mpich/Makefile.am
--- mpich/Makefile.am.avx 2015-04-20 10:46:16.000000000 +0200
2015-08-07 11:20:56 +00:00
+++ mpich/Makefile.am 2015-08-06 17:31:47.820635439 +0200
@@ -8,6 +8,8 @@ AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
# libelpa
lib_LTLIBRARIES = libelpa@SUFFIX@.la
libelpa@SUFFIX@_la_LINK = $(FCLINK) $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
+libelpa@SUFFIX@_la_CFLAGS = $(AVXCFLAGS) $(AM_CFLAGS)
2015-08-07 11:20:56 +00:00
+libelpa@SUFFIX@_la_CXXFLAGS = $(AVXCXXFLAGS) $(AM_CFLAGS)
libelpa@SUFFIX@_la_SOURCES = src/elpa_utilities.F90 \
src/elpa1.F90 \