summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/esmf/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/esmf/package.py')
-rw-r--r--var/spack/repos/builtin/packages/esmf/package.py45
1 files changed, 18 insertions, 27 deletions
diff --git a/var/spack/repos/builtin/packages/esmf/package.py b/var/spack/repos/builtin/packages/esmf/package.py
index 394e316751..107aaffaa2 100644
--- a/var/spack/repos/builtin/packages/esmf/package.py
+++ b/var/spack/repos/builtin/packages/esmf/package.py
@@ -1,27 +1,8 @@
-##############################################################################
-# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
-# Produced at the Lawrence Livermore National Laboratory.
+# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
-# This file is part of Spack.
-# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
-# LLNL-CODE-647188
-#
-# For details, see https://github.com/spack/spack
-# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License (as
-# published by the Free Software Foundation) version 2.1, February 1999.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
-# conditions of the GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##############################################################################
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
from spack import *
import os
@@ -59,7 +40,7 @@ class Esmf(MakefilePackage):
depends_on('xerces-c@3.1.0:', when='+xerces')
# Testing dependencies
- # depends_on('perl', type='test') # TODO: Add a test deptype
+ depends_on('perl', type='test')
# Make esmf build with newer gcc versions
# https://sourceforge.net/p/esmf/esmf/ci/3706bf758012daebadef83d6575c477aeff9c89b/
@@ -69,6 +50,10 @@ class Esmf(MakefilePackage):
# https://sourceforge.net/p/esmf/esmf/ci/34de0ccf556ba75d35c9687dae5d9f666a1b2a18/
patch('mvapich2.patch', when='@:7.0.99')
+ # Allow different directories for creation and
+ # installation of dynamic libraries on OSX:
+ patch('darwin_dylib_install_name.patch', when='platform=darwin')
+
# Make script from mvapich2.patch executable
@run_before('build')
@when('@:7.0.99')
@@ -104,7 +89,7 @@ class Esmf(MakefilePackage):
# bin/binO/Linux.gfortran.64.default.default
os.environ['ESMF_INSTALL_BINDIR'] = 'bin'
os.environ['ESMF_INSTALL_LIBDIR'] = 'lib'
- os.environ['ESMF_INSTALL_MODDIR'] = 'mod'
+ os.environ['ESMF_INSTALL_MODDIR'] = 'include'
############
# Compiler #
@@ -149,11 +134,17 @@ class Esmf(MakefilePackage):
# ESMF_COMM must be set to indicate which MPI implementation
# is used to build the ESMF library.
if '+mpi' in spec:
- if '^mvapich2' in spec:
+ if 'platform=cray' in self.spec:
+ os.environ['ESMF_COMM'] = 'mpi'
+ elif '^mvapich2' in spec:
os.environ['ESMF_COMM'] = 'mvapich2'
elif '^mpich' in spec:
- # FIXME: mpich or mpich2?
+ # esmf@7.0.1 does not include configs for mpich3,
+ # so we start with the configs for mpich2:
os.environ['ESMF_COMM'] = 'mpich2'
+ # The mpich 3 series split apart the Fortran and C bindings,
+ # so we link the Fortran libraries when building C programs:
+ os.environ['ESMF_CXXLINKLIBS'] = '-lmpifort'
elif '^openmpi' in spec:
os.environ['ESMF_COMM'] = 'openmpi'
elif '^intel-parallel-studio+mpi' in spec: