Helics: add python variant (#16625)
* Adding varient for python interface in HELICS * Append python interface to pythonpath * cleaning up blank lines * Update var/spack/repos/builtin/packages/helics/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
7411fe2d43
commit
c50b586e06
@ -39,6 +39,7 @@ class Helics(CMakePackage):
|
|||||||
variant('asio', default=True, description="Compile with ASIO libraries")
|
variant('asio', default=True, description="Compile with ASIO libraries")
|
||||||
variant('swig', default=False, description="Build language bindings with SWIG")
|
variant('swig', default=False, description="Build language bindings with SWIG")
|
||||||
variant('webserver', default=True, description="Enable the integrated webserver in the HELICS broker server")
|
variant('webserver', default=True, description="Enable the integrated webserver in the HELICS broker server")
|
||||||
|
variant('python', default=False, description="Enable Python interface")
|
||||||
|
|
||||||
# Build dependency
|
# Build dependency
|
||||||
depends_on('git', type='build', when='@master:')
|
depends_on('git', type='build', when='@master:')
|
||||||
@ -48,6 +49,7 @@ class Helics(CMakePackage):
|
|||||||
|
|
||||||
depends_on('libzmq@4.3:', when='+zmq')
|
depends_on('libzmq@4.3:', when='+zmq')
|
||||||
depends_on('mpi@2', when='+mpi')
|
depends_on('mpi@2', when='+mpi')
|
||||||
|
depends_on('python@3:', when='+python')
|
||||||
|
|
||||||
# OpenMPI doesn't work with HELICS <=2.4.1
|
# OpenMPI doesn't work with HELICS <=2.4.1
|
||||||
conflicts('^openmpi', when='@:2.4.1 +mpi')
|
conflicts('^openmpi', when='@:2.4.1 +mpi')
|
||||||
@ -60,6 +62,8 @@ class Helics(CMakePackage):
|
|||||||
conflicts('+tcp', when='~asio')
|
conflicts('+tcp', when='~asio')
|
||||||
conflicts('+udp', when='~asio')
|
conflicts('+udp', when='~asio')
|
||||||
|
|
||||||
|
extends('python', when='+python')
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
args = [
|
args = [
|
||||||
@ -103,4 +107,13 @@ def cmake_args(self):
|
|||||||
args.append('-DHELICS_ENABLE_SWIG={0}'.format(
|
args.append('-DHELICS_ENABLE_SWIG={0}'.format(
|
||||||
'ON' if '+swig' in spec else 'OFF'))
|
'ON' if '+swig' in spec else 'OFF'))
|
||||||
|
|
||||||
|
# Python
|
||||||
|
args.append('-DBUILD_PYTHON_INTERFACE={0}'.format(
|
||||||
|
'ON' if '+python' in spec else 'OFF'))
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
def setup_run_environment(self, env):
|
||||||
|
spec = self.spec
|
||||||
|
if '+python' in spec:
|
||||||
|
env.prepend_path('PYTHONPATH', self.prefix.python)
|
||||||
|
Loading…
Reference in New Issue
Block a user