fix PYTHONPATH for OpenBabel Python bindings#1219
fix PYTHONPATH for OpenBabel Python bindings#1219boegel merged 4 commits intoeasybuilders:developfrom
Conversation
From OpenBabel 2.4.0 on the Python bindings are no longer
installed directly in `${PREFIX}/lib` but rather under
`${PREFIX}/lib/python2.7/site-packages` (for 2.7 Python).
This commit sets the correct PYTHONPATH in the module.
| # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
| # | ||
| # https://github.com/easybuilders/easybuild | ||
| # http://github.com/hpcugent/easybuild |
There was a problem hiding this comment.
@ostueker This is wrong after the move to the easybuilders organisation, please change it back?
| @staticmethod | ||
| def extra_options(): | ||
| extra_vars = { | ||
| 'try_python': [True, "Try to build Open Babel's Python bindings. (-DPYTHON_BINDINGS=ON)", CUSTOM], |
There was a problem hiding this comment.
What's the added benefit of introducing this?
If you don't want the Python bindings, it suffices to just exclude the use of Python as a dependency?
If there's a good use case for it, I'd rename it to with_python_bindings, since the try_ makes it sound like it's likely (& acceptable) to fail..
There was a problem hiding this comment.
it suffices to just exclude the use of Python as a dependency?
Unfortunately that does not work if Eigen has been built with a Python dependency as OpenBabel will inherit it indirectly.
| self.cfg['configopts'] += "-DPYTHON_INCLUDE_DIR=%s/include/python%s " % (root_python, shortpyver) | ||
| else: | ||
| self.log.info("Not enabling Python bindings") | ||
| self.with_python = False |
There was a problem hiding this comment.
Already initialised as False, no point in setting it to False again?
| # since OpenBabel 2.4.0 the Python bindings under | ||
| # ${PREFIX}/lib/python2.7/site-packages rather than ${PREFIX}/lib | ||
| shortpyver = '.'.join(get_software_version('Python').split('.')[:2]) | ||
| ob_pythonpath = 'lib/python%s/site-packages/' % (shortpyver) |
There was a problem hiding this comment.
we have a dedicated function for this in the PythonPackage generic easyblock, so this can simply become:
ob_pythonpath = det_pylibdir()In some cases it may be lib64 rather than lib, etc., which is taken into account by det_pylibdir()
|
This looks good to go, tested it on all existing I tried building OpenBabel 2.4.1 in order to have a test case for this, but the installation failed because most tests failed. @ostueker Have you been able to come up with a working easyconfig for |
|
I figured out the problem I was running into with the tests in OpenBabel 2.4.1, was caused by commenting out the patch that reinstates You weren't hitting this issue @ostueker because I guess you're using RPATH? PR for easyconfig in easybuilders/easybuild-easyconfigs#5533, this is good to go, thanks @ostueker! |
|
@boegel : Yes, we're using RPATH. |
From OpenBabel 2.4.0 on, the Python bindings are no longer installed directly in
${PREFIX}/libbut rather under${PREFIX}/lib/python2.7/site-packages(for 2.7 Python).This commit sets the correct PYTHONPATH in the generated module.