Skip to content
Snippets Groups Projects
Unverified Commit ef3338a4 authored by albestro's avatar albestro Committed by GitHub
Browse files

Improve HPX package management of coroutines implementation (#17654)


* introduce logic for boost+context dependency and generic_context variant

* fix OTF2 instrumentation minor problem

* default coroutine impl depends on platform

* fix flake8

* add reference to ~generic_coroutines conflict info

* Update var/spack/repos/builtin/packages/hpx/package.py

Co-authored-by: default avatarAdam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: default avatarAdam J. Stewart <ajstewart426@gmail.com>
parent 8e6fe883
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
from spack import * from spack import *
import sys
class Hpx(CMakePackage, CudaPackage): class Hpx(CMakePackage, CudaPackage):
...@@ -48,6 +49,14 @@ class Hpx(CMakePackage, CudaPackage): ...@@ -48,6 +49,14 @@ class Hpx(CMakePackage, CudaPackage):
description="Support for networking through parcelports", description="Support for networking through parcelports",
) )
default_generic_coroutines = True
if sys.platform.startswith('linux') or sys.platform == 'win32':
default_generic_coroutines = False
variant(
"generic_coroutines", default=default_generic_coroutines,
description='Use Boost.Context as the underlying coroutines'
' context switch implementation.')
variant('tools', default=False, description='Build HPX tools') variant('tools', default=False, description='Build HPX tools')
variant('examples', default=False, description='Build examples') variant('examples', default=False, description='Build examples')
...@@ -69,6 +78,15 @@ class Hpx(CMakePackage, CudaPackage): ...@@ -69,6 +78,15 @@ class Hpx(CMakePackage, CudaPackage):
# https://github.com/STEllAR-GROUP/hpx/issues/4728#issuecomment-640685308 # https://github.com/STEllAR-GROUP/hpx/issues/4728#issuecomment-640685308
depends_on('boost@:1.72.0', when='@:1.4') depends_on('boost@:1.72.0', when='@:1.4')
# COROUTINES
# ~generic_coroutines conflict is not fully implemented
# for additional information see:
# https://github.com/spack/spack/pull/17654
# https://github.com/STEllAR-GROUP/hpx/issues/4829
depends_on('boost+context', when='+generic_coroutines')
_msg_generic_coroutines = 'This platform requires +generic_coroutines'
conflicts('~generic_coroutines', when='platform=darwin', msg=_msg_generic_coroutines)
# CXX Standard # CXX Standard
depends_on('boost cxxstd=11', when='cxxstd=11') depends_on('boost cxxstd=11', when='cxxstd=11')
depends_on('boost cxxstd=14', when='cxxstd=14') depends_on('boost cxxstd=14', when='cxxstd=14')
...@@ -120,7 +138,7 @@ def cmake_args(self): ...@@ -120,7 +138,7 @@ def cmake_args(self):
args.extend(self.instrumentation_args()) args.extend(self.instrumentation_args())
if 'instrumentation=apex' in spec: if 'instrumentation=apex' in spec:
args += ['-DAPEX_WITH_OTF2=ON' args += ['-DAPEX_WITH_OTF2=ON',
'-DOTF2_ROOT={0}'.format(spec['otf2'].prefix)] '-DOTF2_ROOT={0}'.format(spec['otf2'].prefix)]
# Networking # Networking
...@@ -154,6 +172,12 @@ def cmake_args(self): ...@@ -154,6 +172,12 @@ def cmake_args(self):
spec.variants['max_cpu_count'].value spec.variants['max_cpu_count'].value
)) ))
# HPX_WITH_GENERIC_CONTEXT_COROUTINES
args.append(
self.define_with_variant(
'HPX_WITH_GENERIC_CONTEXT_COROUTINES', 'generic_coroutines')
)
# Examples # Examples
args.append('-DHPX_WITH_EXAMPLES={0}'.format( args.append('-DHPX_WITH_EXAMPLES={0}'.format(
'ON' if '+examples' in spec else 'OFF' 'ON' if '+examples' in spec else 'OFF'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment