Skip to content

Commit

Permalink
Avoid that a system python is picked up. This replaces the need for d…
Browse files Browse the repository at this point in the history
…efining this in the EasyConfig file, which was done fot pybind11 in GCCcore-9.3.0, but not done for the pybind11 in GCCcore-8.3.0
  • Loading branch information
casparvl committed Sep 2, 2020
1 parent 97b0b6a commit f76e9b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions easybuild/easyblocks/p/pybind11.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import change_dir
from easybuild.tools.run import run_cmd
from easybuild.tools.modules import get_software_root


class EB_pybind11(CMakePythonPackage):
Expand All @@ -54,6 +55,13 @@ def extra_options(extra_vars=None):
extra_vars['download_dep_fail'][0] = True
return extra_vars

def configure_step(self):
"""Avoid that a system Python is picked up when a Python module is loaded"""
python_root = get_software_root('Python')
if python_root:
self.cfg.update('configopts', "-DPYTHON_EXECUTABLE=%s/bin/python" % python_root)
super(EB_pybind11, self).configure_step()

def test_step(self):
"""Run pybind11 tests"""
# always run tests
Expand Down

0 comments on commit f76e9b5

Please sign in to comment.