From c2284138b161cda1df33228e7e94efc94abd4329 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 20 Mar 2015 11:25:47 +0100 Subject: [PATCH] don't add -mavx to CFLAGS if it doesn't work Fixes compilation on non-x86. --- elpa-rpm.patch | 20 +++++++++++++++++--- elpa.spec | 4 +++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/elpa-rpm.patch b/elpa-rpm.patch index 8eaeae3..474ba11 100644 --- a/elpa-rpm.patch +++ b/elpa-rpm.patch @@ -1,6 +1,20 @@ +diff -up mpich/configure.ac.r mpich/configure.ac +--- mpich/configure.ac.r 2015-03-20 11:03:37.810818537 +0100 ++++ mpich/configure.ac 2015-03-20 11:03:41.003835548 +0100 +@@ -215,6 +215,10 @@ dnl first test failed: try again after u + [can_compile_avx=yes], + [can_compile_avx=no] + ) ++ if test x"${can_compile_avx}" = x"no" ; then ++ CFLAGS=$save_CFLAGS ++ CXXFLAGS=$save_CXXFLAGS ++ fi + fi + AC_MSG_RESULT([${can_compile_avx}]) + diff -up mpich/elpa.pc.in.r mpich/elpa.pc.in --- mpich/elpa.pc.in.r 2015-03-16 11:39:51.000000000 +0100 -+++ mpich/elpa.pc.in 2015-03-19 12:42:53.997589760 +0100 ++++ mpich/elpa.pc.in 2015-03-20 10:59:37.966517510 +0100 @@ -9,4 +9,4 @@ Version: @PACKAGE_VERSION@ URL: @PACKAGE_URL@ Libs: -L${libdir} -lelpa@SUFFIX@ @LIBS@ @OPENMP_FCFLAGS@ @@ -8,8 +22,8 @@ diff -up mpich/elpa.pc.in.r mpich/elpa.pc.in -fcflags= -I${includedir}/elpa@SUFFIX@-@PACKAGE_VERSION@/modules @OPENMP_FCFLAGS@ +fcflags= -I${libdir}/gfortran/modules @OPENMP_FCFLAGS@ diff -up mpich/Makefile.am.r mpich/Makefile.am ---- mpich/Makefile.am.r 2015-03-19 12:42:54.002589786 +0100 -+++ mpich/Makefile.am 2015-03-19 12:44:26.025065404 +0100 +--- mpich/Makefile.am.r 2015-03-17 16:05:37.000000000 +0100 ++++ mpich/Makefile.am 2015-03-20 10:59:37.967517516 +0100 @@ -204,47 +204,47 @@ check_SCRIPTS = \ TESTS = $(check_SCRIPTS) diff --git a/elpa.spec b/elpa.spec index a855677..b134f70 100644 --- a/elpa.spec +++ b/elpa.spec @@ -4,7 +4,9 @@ Version: 2015.02.002 Release: 1%{?dist} URL: http://elpa.rzg.mpg.de/ Source0: http://elpa.rzg.mpg.de/elpa-%{version}.tar.gz -# fix pkgconfig file and use all CPUs for testsuite +# fix pkgconfig file +# use all CPUs for testsuite +# don't add -mavx to CFLAGS if it doesn't work (i.e. on arm) Patch1: elpa-rpm.patch # build against atlas instead of reference blas Patch2: elpa-atlas.patch