Skip to content

Commit

Permalink
Merge pull request #2 from boegel/pybind11_python_fix
Browse files Browse the repository at this point in the history
only add -DPYTHON_EXECUTABLE configure option for pybind11 if it's not specified yet
  • Loading branch information
casparvl authored Sep 4, 2020
2 parents f76e9b5 + 16146fc commit c576851
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions easybuild/easyblocks/p/pybind11.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,15 @@ def extra_options(extra_vars=None):

def configure_step(self):
"""Avoid that a system Python is picked up when a Python module is loaded"""

# make sure right 'python' command is used for installing pybind11
python_root = get_software_root('Python')
if python_root:
self.cfg.update('configopts', "-DPYTHON_EXECUTABLE=%s/bin/python" % python_root)
python_exe_opt = '-DPYTHON_EXECUTABLE='
if python_root and python_exe_opt not in self.cfg['configopts']:
configopt = python_exe_opt + os.path.join(python_root, 'bin', 'python')
self.log.info("Adding %s to configopts since it is not specified yet", configopt)
self.cfg.update('configopts', configopt)

super(EB_pybind11, self).configure_step()

def test_step(self):
Expand Down

0 comments on commit c576851

Please sign in to comment.