From dae219d5c3b08e50f04c14508638a3ba30f3b615 Mon Sep 17 00:00:00 2001
From: Denis Davydov <davydden@gmail.com>
Date: Tue, 23 Aug 2016 22:24:16 +0200
Subject: nwchem: add another patch

---
 .../builtin/packages/nwchem/Gcc6_macs_optfix.patch | 40 ++++++++++++++++++++++
 var/spack/repos/builtin/packages/nwchem/package.py |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 var/spack/repos/builtin/packages/nwchem/Gcc6_macs_optfix.patch

(limited to 'var')

diff --git a/var/spack/repos/builtin/packages/nwchem/Gcc6_macs_optfix.patch b/var/spack/repos/builtin/packages/nwchem/Gcc6_macs_optfix.patch
new file mode 100644
index 0000000000..6d903923b5
--- /dev/null
+++ b/var/spack/repos/builtin/packages/nwchem/Gcc6_macs_optfix.patch
@@ -0,0 +1,40 @@
+Index: src/config/makefile.h
+===================================================================
+--- src/config/makefile.h	(revision 28470)
++++ src/config/makefile.h	(revision 28471)
+@@ -910,6 +910,7 @@
+         GNUMINOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | egrep __VERS | cut -c24)
+         GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
+         GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
++        GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6  ] && echo true)
+         endif
+         ifeq ($(GNU_GE_4_6),true)
+         DEFINES  += -DGCC46
+@@ -921,6 +922,9 @@
+           
+           FOPTIONS += -Warray-bounds
+         endif
++        ifeq ($(GNU_GE_6),true)
++         FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
++        endif
+         ifdef USE_OPENMP
+            FOPTIONS  += -fopenmp
+            LDOPTIONS += -fopenmp
+@@ -1067,6 +1071,7 @@
+         GNUMINOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | egrep __VERS | cut -c24)
+         GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
+         GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
++        GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6  ] && echo true)
+         ifeq ($(GNU_GE_4_6),true)
+          DEFINES  += -DGCC46
+         endif
+@@ -1076,6 +1081,9 @@
+ #gone          FFLAGS_FORGA += -fno-aggressive-loop-optimizations
+           FOPTIONS += -Warray-bounds
+         endif # GNU_GE_4_8
++        ifeq ($(GNU_GE_6),true)
++         FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
++        endif
+         endif # GNUMAJOR
+ 
+         ifdef USE_OPENMP
diff --git a/var/spack/repos/builtin/packages/nwchem/package.py b/var/spack/repos/builtin/packages/nwchem/package.py
index 06816429f5..43619c143a 100644
--- a/var/spack/repos/builtin/packages/nwchem/package.py
+++ b/var/spack/repos/builtin/packages/nwchem/package.py
@@ -62,6 +62,7 @@ class Nwchem(Package):
     patch('Util_getppn.patch', when='@6.6', level=0)
     patch('xccvs98.patch', when='@6.6', level=0)
     patch('zgesdv.patch', when='@6.6', level=0)
+    patch('Gcc6_macs_optfix.patch', when='@6.6', level=0)
 
     def install(self, spec, prefix):
         # see http://www.nwchem-sw.org/index.php/Compiling_NWChem
-- 
cgit v1.2.3-70-g09d2