summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorKelly (KT) Thompson <KineticTheory@users.noreply.github.com>2018-04-29 18:40:27 -0600
committerChristoph Junghans <christoph.junghans@gmail.com>2018-04-29 18:40:27 -0600
commitd02b5b96d3a49c6cd08cd458ae85892cf78a6115 (patch)
tree00abaf7d4b3c1d07ab13ad1b15059cedadffd5cd /var
parentc1febf8d9c91790d04cac8d42775eb0e4d7d435a (diff)
downloadspack-d02b5b96d3a49c6cd08cd458ae85892cf78a6115.tar.gz
spack-d02b5b96d3a49c6cd08cd458ae85892cf78a6115.tar.bz2
spack-d02b5b96d3a49c6cd08cd458ae85892cf78a6115.tar.xz
spack-d02b5b96d3a49c6cd08cd458ae85892cf78a6115.zip
Patch eospac package to allow compilation with %clang. (#7928)
When building eospac with %clang, spack's Fortran compiler wrapper is called 'flang', which is rejected by the eospac build system..Allow compilation with %clang by patching the eospac build system. My testing only covers %clang where flang is actually gfortran. However, this patch only registers 'flang' as a known Fortran compiler and does not set any flags or options that are compiler specific. .
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/eospac/flang.patch62
-rw-r--r--var/spack/repos/builtin/packages/eospac/package.py3
2 files changed, 65 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/eospac/flang.patch b/var/spack/repos/builtin/packages/eospac/flang.patch
new file mode 100644
index 0000000000..dcde70ff50
--- /dev/null
+++ b/var/spack/repos/builtin/packages/eospac/flang.patch
@@ -0,0 +1,62 @@
+--- a/Source/config/Makefile.-linux-gnu.detect
++++ b/Source/config/Makefile.-linux-gnu.detect
+@@ -19,7 +19,7 @@
+ # Compiler suite configurations based upon F90 ###
+ ##################################################################
+ # Default: use the first F90 compiler found from F90_List
+-F90_List = gfortran pgfortran pgf90 lf95 f90 ifort g95 ftn pathf90
++F90_List = gfortran pgfortran pgf90 lf95 f90 ifort g95 ftn pathf90 flang
+ F90_Found_List = $(foreach compiler,$(F90_List),$(call pathsearch,$(compiler)))
+ F90 = $(firstword $(F90_Found_List))
+ F90_Key = $(strip $(firstword $(foreach compiler,$(F90_List),$(call match_r1,$(compiler),$(F90)))))
+
+--- a/Source/config/Makefile.-linux-gnu.hashes
++++ b/Source/config/Makefile.-linux-gnu.hashes
+@@ -32,6 +32,7 @@
+ $(call set,_CC,g95, gcc ) # G95
+ $(call set,_CC,gfortran, gcc ) # gfortran
+ $(call set,_CC,ftn, cc gcc ) # Cray Computing Environment (cce)
++$(call set,_CC,flang, clang ) # flang/clang
+
+ $(call set,_CXX,pgfortran, pgCC g++ ) # PGI
+ $(call set,_CXX,pgf90, pgCC g++ ) # PGI
+@@ -42,6 +43,7 @@
+ $(call set,_CXX,g95, g++ ) # G95
+ $(call set,_CXX,gfortran, g++ ) # gfortran
+ $(call set,_CXX,ftn, CC g++ ) # Cray Computing Environment (cce)
++$(call set,_CC,flang, clang++ ) # flang/clang++
+
+ $(call set,_F77,pgfortran, pgfortran pgf77 pgf90 ) # PGI
+ $(call set,_F77,pgf90, pgfortran pgf77 pgf90 ) # PGI
+@@ -52,6 +54,7 @@
+ $(call set,_F77,g95, $(F90) ) # G95
+ $(call set,_F77,gfortran, $(F90) ) # gfortran
+ $(call set,_F77,ftn, $(F90) ) # Cray Computing Environment (cce)
++$(call set,_CC,flang, flang ) # flang
+
+ ##################################################################
+ ### Define CC, CXX and F77 according to $(F90_Key). ###
+@@ -94,6 +97,7 @@
+ $(call set,_COMP_FLAGS,gfortran, -I"$(INCDIR)" -Wno-c-binding-type) # gfortran
+ $(call set,_COMP_FLAGS,ppu-gfortran, -I"$(INCDIR)" ) # ppu-gfortran
+ $(call set,_COMP_FLAGS,ftn, -e m -I"$(INCDIR)" -hfp0 ) # Cray Computing Environment (cce)
++$(call set,_COMP_FLAGS,flang, -I"$(INCDIR)" ) # flang
+
+ # define define_module_subdir script options
+ $(call set,_DEFINE_MODULE_SUBDIR_FLAGS,f90,) # Absoft f90
+@@ -105,6 +109,7 @@
+ $(call set,_DEFINE_MODULE_SUBDIR_FLAGS,g95,) # G95
+ $(call set,_DEFINE_MODULE_SUBDIR_FLAGS,gfortran,) # gfortran
+ $(call set,_DEFINE_MODULE_SUBDIR_FLAGS,ftn,) # Cray Computing Environment (cce)
++$(call set,_DEFINE_MODULE_SUBDIR_FLAGS,flang,) # flang
+
+ # define define_module_subdir script patterns
+ $(call set,_DEFINE_MODULE_SUBDIR_PATTS,f90,absoft) # Absoft f90
+@@ -116,6 +121,7 @@
+ $(call set,_DEFINE_MODULE_SUBDIR_PATTS,g95,$(F90_Key)) # G95
+ $(call set,_DEFINE_MODULE_SUBDIR_PATTS,gfortran,gcc) # gfortran
+ $(call set,_DEFINE_MODULE_SUBDIR_PATTS,ftn,cce) # Cray Computing Environment (cce)
++$(call set,_DEFINE_MODULE_SUBDIR_PATTS,flang,clang) # flang/clang
+
+ # define optional modules for cross-compiling
+ X_Compile_Module_List = craype-haswell craype-mic-knl
diff --git a/var/spack/repos/builtin/packages/eospac/package.py b/var/spack/repos/builtin/packages/eospac/package.py
index b3eb1f84ab..222a7ee4db 100644
--- a/var/spack/repos/builtin/packages/eospac/package.py
+++ b/var/spack/repos/builtin/packages/eospac/package.py
@@ -37,6 +37,9 @@ class Eospac(Package):
version('6.4.0beta.1_r20171213193219', 'e4e4beabf946f0b8953532832002afc2')
version('6.3.1_r20161202150449', '549fda008c4169a69b02ec2a9de1e434', preferred=True)
+ # This patch allows the use of spack's compile wrapper 'flang'
+ patch('flang.patch', when='%clang')
+
def url_for_version(self, version):
return "https://laws.lanl.gov/projects/data/eos/get_file.php?package=eospac&filename=eospac_v{0}.tgz".format(version)