hpx: fix incompatible cxxstd with boost and compiling tests (#13660)

* Add a variant for tests and parallelize builds

- Fix a bug with boost defaulting to cxxstd=98 when cxxstd=11 is the
  minimum for hpx
- Disable tests by default and use a variant to enable them if requested
- Enable parallel builds: each process takes up to 1Gb when tests are
  not enabled.

* Remove tests variant

- The variant doesn't change what gets installed. Testing can be
  activated using `spack install --test=root hpx`
This commit is contained in:
Teodor Nikolov 2019-11-10 01:21:40 +01:00 committed by Adam J. Stewart
parent d01a8f7cd6
commit 3db3395ed1

View File

@ -43,7 +43,6 @@ class Hpx(CMakePackage, CudaPackage):
variant('tools', default=False, description='Build HPX tools')
variant('examples', default=False, description='Build examples')
depends_on('boost')
depends_on('hwloc')
depends_on('python', type=('build', 'test', 'run'))
depends_on('pkgconfig', type='build')
@ -77,11 +76,6 @@ class Hpx(CMakePackage, CudaPackage):
depends_on('papi', when='instrumentation=papi')
depends_on('valgrind', when='instrumentation=valgrind')
# TODO: hpx can build perfectly fine in parallel, except that each
# TODO: process might need more than 2GB to compile. This is just the
# TODO: most conservative approach to ensure a sane build.
parallel = False
def cxx_standard(self):
value = self.spec.variants['cxxstd'].value
return '-DHPX_WITH_CXX{0}=ON'.format(value)
@ -125,6 +119,11 @@ def cmake_args(self):
'ON' if '+cuda' in spec else 'OFF'
))
# Tests
args.append('-DHPX_WITH_TESTS={0}'.format(
'ON' if self.run_tests else 'OFF'
))
# Tools
args.append('-DHPX_WITH_TOOLS={0}'.format(
'ON' if '+tools' in spec else 'OFF'