From 246799d4ce816e24d59d58e5977d28bd76b15479 Mon Sep 17 00:00:00 2001 From: t-karatsu <49965247+t-karatsu@users.noreply.github.com> Date: Sat, 7 Dec 2019 03:05:16 +0900 Subject: [PATCH] sz: Change optimization flags for Fujitsu compiler (#14007) --- .../repos/builtin/packages/sz/fix_optimization.patch | 11 +++++++++++ var/spack/repos/builtin/packages/sz/package.py | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 var/spack/repos/builtin/packages/sz/fix_optimization.patch diff --git a/var/spack/repos/builtin/packages/sz/fix_optimization.patch b/var/spack/repos/builtin/packages/sz/fix_optimization.patch new file mode 100644 index 0000000000..208a7791ee --- /dev/null +++ b/var/spack/repos/builtin/packages/sz/fix_optimization.patch @@ -0,0 +1,11 @@ +--- spack-src/configure.org 2019-12-05 10:58:07.408584611 +0900 ++++ spack-src/configure 2019-12-05 10:58:29.670909716 +0900 +@@ -3019,7 +3019,7 @@ + + + # Checks for programs. +-: ${CFLAGS=-O3 -std=c99 -Wall} ++: ${CFLAGS=-O2 -std=c99 -Wall} + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/var/spack/repos/builtin/packages/sz/package.py b/var/spack/repos/builtin/packages/sz/package.py index 3924e0525f..68a206c153 100644 --- a/var/spack/repos/builtin/packages/sz/package.py +++ b/var/spack/repos/builtin/packages/sz/package.py @@ -35,6 +35,10 @@ class Sz(AutotoolsPackage): variant('fortran', default=False, description='Enable fortran compilation') + # Part of latest sources don't support -O3 optimization + # with Fujitsu compiler. + patch('fix_optimization.patch', when='@2.0.2.0:%fj') + def configure_args(self): args = [] if '+fortran' in self.spec: