summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/netcdf/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/netcdf/package.py')
-rw-r--r--var/spack/repos/builtin/packages/netcdf/package.py68
1 files changed, 25 insertions, 43 deletions
diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py
index f12e2941c8..8a806dbf95 100644
--- a/var/spack/repos/builtin/packages/netcdf/package.py
+++ b/var/spack/repos/builtin/packages/netcdf/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 numbers
@@ -45,6 +26,7 @@ class Netcdf(AutotoolsPackage):
# Version 4.4.1.1 is having problems in tests
# https://github.com/Unidata/netcdf-c/issues/343
+ version('4.6.1', 'ee81c593efc8a6229d9bcb350b6d7849')
version('4.4.1.1', '503a2d6b6035d116ed53b1d80c811bda')
# netcdf@4.4.1 can crash on you (in real life and in tests). See:
# https://github.com/Unidata/netcdf-c/issues/282
@@ -152,10 +134,10 @@ class Netcdf(AutotoolsPackage):
r'\1{0}\2'.format(max_vars))
def configure_args(self):
- CFLAGS = []
- CPPFLAGS = []
- LDFLAGS = []
- LIBS = []
+ cflags = []
+ cppflags = []
+ ldflags = []
+ libs = []
config_args = ['--enable-v2',
'--enable-utilities',
@@ -176,7 +158,7 @@ class Netcdf(AutotoolsPackage):
if '~shared' in self.spec:
# We don't have shared libraries but we still want it to be
# possible to use this library in shared builds
- CFLAGS.append(self.compiler.pic_flag)
+ cflags.append(self.compiler.pic_flag)
config_args += self.enable_or_disable('dap')
# config_args += self.enable_or_disable('cdmremote')
@@ -188,10 +170,10 @@ class Netcdf(AutotoolsPackage):
# undefined reference to `SSL_CTX_use_certificate_chain_file
curl = self.spec['curl']
curl_libs = curl.libs
- LIBS.append(curl_libs.link_flags)
- LDFLAGS.append(curl_libs.search_flags)
+ libs.append(curl_libs.link_flags)
+ ldflags.append(curl_libs.search_flags)
# TODO: figure out how to get correct flags via headers.cpp_flags
- CPPFLAGS.append('-I' + curl.prefix.include)
+ cppflags.append('-I' + curl.prefix.include)
if self.spec.satisfies('@4.4:'):
if '+mpi' in self.spec:
@@ -203,16 +185,16 @@ class Netcdf(AutotoolsPackage):
# are removed. Variables CPPFLAGS, LDFLAGS, and LD_LIBRARY_PATH must be
# used instead.
hdf5_hl = self.spec['hdf5:hl']
- CPPFLAGS.append(hdf5_hl.headers.cpp_flags)
- LDFLAGS.append(hdf5_hl.libs.search_flags)
+ cppflags.append(hdf5_hl.headers.cpp_flags)
+ ldflags.append(hdf5_hl.libs.search_flags)
if '+parallel-netcdf' in self.spec:
config_args.append('--enable-pnetcdf')
pnetcdf = self.spec['parallel-netcdf']
- CPPFLAGS.append(pnetcdf.headers.cpp_flags)
+ cppflags.append(pnetcdf.headers.cpp_flags)
# TODO: change to pnetcdf.libs.search_flags once 'parallel-netcdf'
# package gets custom implementation of 'libs'
- LDFLAGS.append('-L' + pnetcdf.prefix.lib)
+ ldflags.append('-L' + pnetcdf.prefix.lib)
else:
config_args.append('--disable-pnetcdf')
@@ -222,26 +204,26 @@ class Netcdf(AutotoolsPackage):
config_args += self.enable_or_disable('hdf4')
if '+hdf4' in self.spec:
hdf4 = self.spec['hdf']
- CPPFLAGS.append(hdf4.headers.cpp_flags)
+ cppflags.append(hdf4.headers.cpp_flags)
# TODO: change to hdf4.libs.search_flags once 'hdf'
# package gets custom implementation of 'libs' property.
- LDFLAGS.append('-L' + hdf4.prefix.lib)
+ ldflags.append('-L' + hdf4.prefix.lib)
# TODO: change to self.spec['jpeg'].libs.link_flags once the
# implementations of 'jpeg' virtual package get 'jpeg_libs'
# property.
- LIBS.append('-ljpeg')
+ libs.append('-ljpeg')
if '+szip' in hdf4:
# This should also come from hdf4.libs
- LIBS.append('-lsz')
+ libs.append('-lsz')
# Fortran support
# In version 4.2+, NetCDF-C and NetCDF-Fortran have split.
# Use the netcdf-fortran package to install Fortran support.
- config_args.append('CFLAGS=' + ' '.join(CFLAGS))
- config_args.append('CPPFLAGS=' + ' '.join(CPPFLAGS))
- config_args.append('LDFLAGS=' + ' '.join(LDFLAGS))
- config_args.append('LIBS=' + ' '.join(LIBS))
+ config_args.append('CFLAGS=' + ' '.join(cflags))
+ config_args.append('CPPFLAGS=' + ' '.join(cppflags))
+ config_args.append('LDFLAGS=' + ' '.join(ldflags))
+ config_args.append('LIBS=' + ' '.join(libs))
return config_args