ESMF & NCL packages: Bug fixes for Intel Compilers (#11923)

* esmf: add patch when building with intel for 7.0.x
* esmf: set Makefile variables required to propagate CXX/F90 flags
* ncl: add ymake patch for @6.4.0:
* ncl: add pixman, bzip2, freetype dependencies
This commit is contained in:
Kevin Manalo 2019-08-23 20:16:09 -04:00 committed by Peter Scheibel
parent 6a730d7059
commit fd4eed117d
4 changed files with 59 additions and 6 deletions

View file

@ -0,0 +1,17 @@
--- old/build_config/Linux.intel.default/build_rules.mk 2019-06-27 15:55:30.857527494 -0400
+++ new/build_config/Linux.intel.default/build_rules.mk 2019-06-27 15:56:13.007089627 -0400
@@ -187,10 +187,10 @@
############################################################
# OpenMP compiler and linker flags
#
-ESMF_OPENMP_F90COMPILEOPTS += -openmp
-ESMF_OPENMP_CXXCOMPILEOPTS += -openmp
-ESMF_OPENMP_F90LINKOPTS += -openmp
-ESMF_OPENMP_CXXLINKOPTS += -openmp
+ESMF_OPENMP_F90COMPILEOPTS += -qopenmp
+ESMF_OPENMP_CXXCOMPILEOPTS += -qopenmp
+ESMF_OPENMP_F90LINKOPTS += -qopenmp
+ESMF_OPENMP_CXXLINKOPTS += -qopenmp
############################################################
# Set rpath syntax

View file

@ -43,6 +43,8 @@ class Esmf(MakefilePackage):
# Testing dependencies
depends_on('perl', type='test')
# Make esmf build with newer intel versions
patch('intel.patch', when='@:7.0.99 %intel@17:')
# Make esmf build with newer gcc versions
# https://sourceforge.net/p/esmf/esmf/ci/3706bf758012daebadef83d6575c477aeff9c89b/
patch('gcc.patch', when='@:7.0.99 %gcc@6:')
@ -96,6 +98,19 @@ def edit(self, spec, prefix):
os.environ['ESMF_INSTALL_LIBDIR'] = 'lib'
os.environ['ESMF_INSTALL_MODDIR'] = 'include'
# Allow compiler flags to carry through from compiler spec
os.environ['ESMF_CXXCOMPILEOPTS'] = \
' '.join(spec.compiler_flags['cxxflags'])
os.environ['ESMF_F90COMPILEOPTS'] = \
' '.join(spec.compiler_flags['fflags'])
# ESMF will simply not build with Intel using backing GCC 8, in that
# case you need to point to something older, below is commented but is
# an example
# os.environ['ESMF_CXXCOMPILEOPTS'] = \
# '-O2 -std=c++11 -gcc-name=/usr/bin/gcc'
# os.environ['ESMF_F90COMPILEOPTS'] = \
# '-O2 -gcc-name=/usr/bin/gcc'
############
# Compiler #
############

View file

@ -28,6 +28,8 @@ class Ncl(Package):
patch('hdf5.patch', when="@6.4.0")
# ymake-filter's buffer may overflow (upstream as of 6.5.0)
patch('ymake-filter.patch', when="@6.4.0")
# ymake additional local library and includes will be filtered improperly
patch('ymake.patch', when="@6.4.0:")
# This installation script is implemented according to this manual:
# http://www.ncl.ucar.edu/Download/build_from_src.shtml
@ -59,6 +61,9 @@ class Ncl(Package):
depends_on('libx11')
depends_on('libxaw')
depends_on('libxmu')
depends_on('pixman')
depends_on('bzip2')
depends_on('freetype')
# In Spack, we do not have an option to compile netcdf without netcdf-4
# support, so we will tell the ncl configuration script that we want
@ -171,9 +176,9 @@ def prepare_install_config(self):
# Build NCL?
'y\n',
# Parent installation directory :
'\'' + self.spec.prefix + '\'\n',
self.spec.prefix + '\n',
# System temp space directory :
'\'' + tempfile.gettempdir() + '\'\n',
tempfile.gettempdir() + '\n',
# Build NetCDF4 feature support (optional)?
'y\n'
]
@ -219,12 +224,12 @@ def prepare_install_config(self):
# Build GRIB2 support (optional) into NCL?
'n\n',
# Enter local library search path(s) :
# The paths will be passed by the Spack wrapper.
' \n',
self.spec['pixman'].prefix.lib + ' ' +
self.spec['bzip2'].prefix.lib + '\n',
# Enter local include search path(s) :
# All other paths will be passed by the Spack wrapper.
'\'' + join_path(self.spec['freetype'].prefix.include,
'freetype2') + '\'\n',
join_path(self.spec['freetype'].prefix.include, 'freetype2') +
'\n',
# Go back and make more changes or review?
'n\n',
# Save current configuration?

View file

@ -0,0 +1,16 @@
diff --git a/config/ymake b/config/ymake
index 7b785bc..ca24dba 100755
--- a/config/ymake
+++ b/config/ymake
@@ -649,6 +649,11 @@ case UNICOS:
set cppopt = -N
breaksw
case Linux:
+ set cppopt = -traditional-cpp
+ # because local libraries and includes will otherwise have this prefix
+ # '1-rhel7-1' instead of 'linux-rhel7-x86_64'
+ set defines = "$defines -Dlinux=linux -Dx86_64=x86_64"
+ breaksw
case FreeBSD:
case CYGWIN:
set cppopt = -traditional-cpp