62 lines
2.1 KiB
Diff
62 lines
2.1 KiB
Diff
diff -up mpich/configure.ac.avx mpich/configure.ac
|
|
--- 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
|
|
+ AVXCFLAGS="-mavx"
|
|
+ CXXFLAGS="$CXXFLAGS -mavx"
|
|
AC_MSG_CHECKING([whether we can compile AVX intrinsics in C++])
|
|
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
|
|
+ AVXCXXFLAGS="-mavx"
|
|
fi
|
|
fi
|
|
|
|
+CFLAGS=$save_CFLAGS
|
|
+CXXFLAGS=$save_CXXFLAGS
|
|
+
|
|
if test "${can_compile_avx}" = "yes" ; then
|
|
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])
|
|
+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
|
|
+++ 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)
|
|
+libelpa@SUFFIX@_la_CXXFLAGS = $(AVXCXXFLAGS) $(AM_CFLAGS)
|
|
|
|
libelpa@SUFFIX@_la_SOURCES = src/elpa_utilities.F90 \
|
|
src/elpa1.F90 \
|