summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Green <greenc@fnal.gov>2019-02-13 23:17:10 -0600
committerPatrick Gartung <gartung@fnal.gov>2019-02-13 23:17:10 -0600
commit24d7f0f0afc4a133f0b840404620e291163a0333 (patch)
treefc2d7ceb669f610564bf1251af45f874acd090f5
parent7e8b8d61a14f9b62a7024eed198d869b3f9f93c7 (diff)
downloadspack-24d7f0f0afc4a133f0b840404620e291163a0333.tar.gz
spack-24d7f0f0afc4a133f0b840404620e291163a0333.tar.bz2
spack-24d7f0f0afc4a133f0b840404620e291163a0333.tar.xz
spack-24d7f0f0afc4a133f0b840404620e291163a0333.zip
xrootd: allow specification of C++ standard. (#10577)
* xrootd: add cxxstd variant. * xrootd: support for recent and upcoming versions.
-rw-r--r--var/spack/repos/builtin/packages/xrootd/package.py40
1 files changed, 39 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/xrootd/package.py b/var/spack/repos/builtin/packages/xrootd/package.py
index 68d2168af9..bb55f600ea 100644
--- a/var/spack/repos/builtin/packages/xrootd/package.py
+++ b/var/spack/repos/builtin/packages/xrootd/package.py
@@ -13,6 +13,10 @@ class Xrootd(CMakePackage):
homepage = "http://xrootd.org"
url = "http://xrootd.org/download/v4.6.0/xrootd-4.6.0.tar.gz"
+ version('4.8.5',
+ sha256='42e4d2cc6f8b442135f09bcc12c7be38b1a0c623a005cb5e69ff3d27997bdf73')
+ version('4.8.4',
+ sha256='f148d55b16525567c0f893edf9bb2975f7c09f87f0599463e19e1b456a9d95ba')
version('4.8.3', 'bb6302703ffc123f7f9141ddb589435e')
version('4.8.2', '531b632191b59c2cf76ab8d31af4a866')
version('4.8.1', 'a307973f7f43b0cc2688dfe502e17709')
@@ -35,6 +39,14 @@ class Xrootd(CMakePackage):
variant('readline', default=True,
description='Use readline')
+ variant('cxxstd',
+ default='11',
+ values=('98', '11', '14', '17'),
+ multi=False,
+ description='Use the specified C++ standard when building.')
+
+ conflicts('cxxstd=98', when='@4.7.0:')
+
depends_on('bzip2')
depends_on('cmake@2.6:', type='build')
depends_on('libxml2', when='+http')
@@ -45,7 +57,13 @@ class Xrootd(CMakePackage):
depends_on('zlib')
extends('python', when='+python')
- patch('python-support.patch', level=1, when='+python')
+ patch('python-support.patch', level=1, when='@:4.8.99+python')
+
+ def patch(self):
+ """Remove hardcoded -std=c++0x flag
+ """
+ if self.spec.satisfies('@4.7.0:'):
+ filter_file(r'\-std=c\+\+0x', r'', 'cmake/XRootDOSDefs.cmake')
def cmake_args(self):
spec = self.spec
@@ -59,3 +77,23 @@ class Xrootd(CMakePackage):
'-DENABLE_CEPH:BOOL=OFF'
]
return options
+
+ def setup_environment(self, spack_env, run_env):
+ cxxstdflag = ''
+ if self.spec.variants['cxxstd'].value == '98':
+ cxxstdflag = self.compiler.cxx98_flag
+ elif self.spec.variants['cxxstd'].value == '11':
+ cxxstdflag = self.compiler.cxx11_flag
+ elif self.spec.variants['cxxstd'].value == '14':
+ cxxstdflag = self.compiler.cxx14_flag
+ elif self.spec.variants['cxxstd'].value == '17':
+ cxxstdflag = self.compiler.cxx17_flag
+ else:
+ # The user has selected a (new?) legal value that we've
+ # forgotten to deal with here.
+ tty.die(
+ "INTERNAL ERROR: cannot accommodate unexpected variant ",
+ "cxxstd={0}".format(self.spec.variants['cxxstd'].value))
+
+ if cxxstdflag:
+ spack_env.append_flags('CXXFLAGS', cxxstdflag)