Conversation
* origin/develop: (114 commits) enable building of shared FFTW libraries enhance sanity check for NCL Revert "update NCL easyblock to support building in parallel" (re-)bump to v3.3.0.dev0 bump version to v3.2.1, clarify updates to NAMD easyblock in release notes prepare release notes for eb321 minor style fixes in GROMACS w/ PLUMED support only use -std=c++11 for NAMD 2.12 and up fix specifying FFT(W) dirs + minor style fixes Move plumed patching step. Add openmp support to namd easyblock. Also add TCL support. Fix some more comments from Kenneth. bump to v3.3.0.dev0 bump version to 3.2.0 + minor enhancements to release notes prepare release notes for eb320 integrate support for open-source version of TBB into existing TBB easyblock update NCL easyblock to support building in parallel PoC for the TBB open source version add support to install Python extensions without unpacking Improvement, per reviewer suggestion ...
| @author: Dries Verdegem (Ghent University) | ||
| @author: Kenneth Hoste (Ghent University) | ||
| @author: Pieter De Baets (Ghent University) | ||
| @author: Jens Timmerman (Ghent University) |
There was a problem hiding this comment.
drop these above, only you and Adam are actual authors of this?
|
|
||
| custom_paths = { | ||
| 'files': [], | ||
| 'dirs': ['lib'] |
There was a problem hiding this comment.
Make this more specific, just include 'files': [tkinter_so]?
Should we also check whether nothing else is in the install dir?
There was a problem hiding this comment.
Well, we delete everything in there and copy only the tk parts back?
tkinter_so is a glob.
| """Set PYTHONPATH""" | ||
| txt = super(EB_Tkinter, self).make_module_extra() | ||
| pyver = '.'.join(self.version.split('.')[:2]) | ||
| txt += self.module_generator.prepend_paths('PYTHONPATH', os.path.join("lib", "python%s" % pyver)) |
| shlib_ext = get_shared_lib_ext() | ||
|
|
||
| # check whether _tkinter*.so is found, exact filename doesn't matter | ||
| tkinter_so = os.path.join(self.installdir, 'lib', pyver, '_tkinter*.' + shlib_ext) |
There was a problem hiding this comment.
use all_pylibdirs rather than hardcoding lib?
| mkdir(tmpdir) | ||
|
|
||
| pyver = '.'.join(self.version.split('.')[:2]) | ||
| libdir = os.path.join(self.installdir, "lib", "python%s" % pyver) |
| super(EB_Tkinter, self).install_step() | ||
|
|
||
| tmpname = "eb-tmp" | ||
| tmpdir = os.path.join(self.installdir, tmpname) |
There was a problem hiding this comment.
I'd make this a subdir of self.builddir, which is cleaned up automagically?
There was a problem hiding this comment.
also, use tempfile.mkdtemp, you can tell it in which location to create a directory, and specify a prefix for the name (eb-tmp- for example)
There was a problem hiding this comment.
that possible on a different filesystem. The reason why I do it like this is to have a real 'move' on the same fs.
There was a problem hiding this comment.
Is that really going to matter for the amount of files involved?
Are you worried about speed, or something else?
There was a problem hiding this comment.
Not sure, some people do weird things out there. But I don't feel strongly about this. I can change if that makes you happy.
There was a problem hiding this comment.
Well, it's a lot cleaner to use the build dir for this, since it's cleaned up automagically...
|
|
||
| copy([os.path.join(libdir, x) for x in tkdirs], tmpdir) | ||
|
|
||
| delete_dirs = [x for x in os.listdir(self.installdir) if not x == tmpname] |
There was a problem hiding this comment.
and if you use self.builddir in tmpdir, you don't even need to do this, you can just wipe self.installdir entirely?
| shutil.move(os.path.join(tmpdir, tkdirs[0]), libdir) | ||
| shutil.move(os.path.join(tmpdir, os.path.basename(tkdirs[1])), libdir) | ||
|
|
||
| rmtree2(tmpdir) |
There was a problem hiding this comment.
no need for this if tmpdir uses self.builddir
|
|
||
| pyver = '.'.join(self.version.split('.')[:2]) | ||
| libdir = os.path.join(self.installdir, "lib", "python%s" % pyver) | ||
| tkdirs = ["lib-tk", "lib-dynload/_tkinter.so"] |
There was a problem hiding this comment.
not all of these are dirs, but they are all files (somewhat) ;)
| """ | ||
|
|
||
| def configure_step(self): | ||
| """Check for Tk""" |
| from distutils.version import LooseVersion | ||
|
|
||
| from easybuild.easyblocks.generic.pythonpackage import det_pylibdir | ||
| from easybuild.easyblocks.p.python import EB_Python |
There was a problem hiding this comment.
don't use the .p., import directly from easybuild.easyblocks.python
|
|
||
| mkdir(pylibdir, parents=True) | ||
| shutil.move(os.path.join(tmpdir, tkparts[0]), pylibdir) | ||
| shutil.move(os.path.join(tmpdir, os.path.basename(tkparts[1])), pylibdir) |
There was a problem hiding this comment.
wrap this in try/except OSError as err:?
| 'files': ['%s/_tkinter.%s' % (pylibdir, shlib_ext)], | ||
| 'dirs': ['lib'] | ||
| } | ||
|
|
| try: | ||
| shutil.move(os.path.join(tmpdir, tkparts[0]), pylibdir) | ||
| shutil.move(os.path.join(tmpdir, os.path.basename(tkparts[1])), pylibdir) | ||
| except: |
There was a problem hiding this comment.
include the exception in the error message, so it's clear what exactly went wrong...
except OSError as err:
raise EasyBuildError("Failed to move Tkinter back to the install directory: %s", err)|
lgtm, and tested with easybuilders/easybuild-easyconfigs#4620, thanks @wpoely86 and @verdurin for levelling the ground for this! |
Follow up from #1118