diff options
author | Massimiliano Culpo <massimiliano.culpo@googlemail.com> | 2017-01-26 11:27:15 +0100 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-01-26 02:27:15 -0800 |
commit | 81a5146b1df1f69172c0f76bc3dbe469f4e366f9 (patch) | |
tree | b1f369a4b48c09fb90c499afd9856739ccf027ff /var | |
parent | 3b2124af6a861273df5bc19345f2a03e8c9db0e1 (diff) | |
download | spack-81a5146b1df1f69172c0f76bc3dbe469f4e366f9.tar.gz spack-81a5146b1df1f69172c0f76bc3dbe469f4e366f9.tar.bz2 spack-81a5146b1df1f69172c0f76bc3dbe469f4e366f9.tar.xz spack-81a5146b1df1f69172c0f76bc3dbe469f4e366f9.zip |
AutotoolsPackage: minor improvements (#2859)
* AutotoolsPackage: added configure_directory to permit build out of source. The configure script executable is now invoked with an absolute path. Modified a few packages accordingly.
* build_systems: functions returning directories are now properties
* build_systems: fixed issues with tcl and tk
* AutotoolsPackage: reworked recipe for autoreconf
Diffstat (limited to 'var')
23 files changed, 83 insertions, 147 deletions
diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py index 16c59469fa..851952be66 100644 --- a/var/spack/repos/builtin/packages/astyle/package.py +++ b/var/spack/repos/builtin/packages/astyle/package.py @@ -39,6 +39,7 @@ class Astyle(MakefilePackage): parallel = False + @property def build_directory(self): return join_path(self.stage.source_path, 'build', self.compiler.name) diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index d812350ae8..3dcf8f36b5 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -38,6 +38,8 @@ class Autoconf(AutotoolsPackage): depends_on('m4@1.4.6:', type='build') + build_directory = 'spack-build' + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py index 6c0a47ff95..8643f5d836 100644 --- a/var/spack/repos/builtin/packages/automake/package.py +++ b/var/spack/repos/builtin/packages/automake/package.py @@ -37,6 +37,8 @@ class Automake(AutotoolsPackage): depends_on('autoconf', type='build') + build_directory = 'spack-build' + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/bash-completion/package.py b/var/spack/repos/builtin/packages/bash-completion/package.py index 666a1bef13..0bd4d7c294 100644 --- a/var/spack/repos/builtin/packages/bash-completion/package.py +++ b/var/spack/repos/builtin/packages/bash-completion/package.py @@ -25,10 +25,10 @@ from spack import * -class BashCompletion(Package): +class BashCompletion(AutotoolsPackage): """Programmable completion functions for bash.""" homepage = "https://github.com/scop/bash-completion" - url = "https://github.com/scop/bash-completion/archive/2.3.tar.gz" + url = "https://github.com/scop/bash-completion/archive/2.3.tar.gz" version('2.3', '67e50f5f3c804350b43f2b664c33dde811d24292') version('develop', git='https://github.com/scop/bash-completion.git') @@ -41,16 +41,9 @@ class BashCompletion(Package): # Other dependencies depends_on('bash@4.1:', type='run') - def install(self, spec, prefix): - make_args = ['--prefix=%s' % prefix] - - autoreconf('-i') - configure(*make_args) - make() - # make("check") # optional, requires dejagnu and tcllib - make("install", - parallel=False) - + @run_after('install') + def show_message_to_user(self): + prefix = self.prefix # Guidelines for individual user as provided by the author at # https://github.com/scop/bash-completion print('=====================================================') @@ -59,6 +52,6 @@ class BashCompletion(Package): print('') print('# Use bash-completion, if available') print('[[ $PS1 && -f %s/share/bash-completion/bash_completion ]] && \ ' % prefix) # NOQA: ignore=E501 - print(' . %s/share/bash-completion/bash_completion' % prefix) + print(' . %s/share/bash-completion/bash_completion' % prefix) print('') print('=====================================================') diff --git a/var/spack/repos/builtin/packages/bison/package.py b/var/spack/repos/builtin/packages/bison/package.py index cc2d10dea1..a9691fab8b 100644 --- a/var/spack/repos/builtin/packages/bison/package.py +++ b/var/spack/repos/builtin/packages/bison/package.py @@ -36,3 +36,5 @@ class Bison(AutotoolsPackage): version('3.0.4', 'a586e11cd4aff49c3ff6d3b6a4c9ccf8') depends_on("m4", type='build') + + build_directory = 'spack-build' diff --git a/var/spack/repos/builtin/packages/czmq/package.py b/var/spack/repos/builtin/packages/czmq/package.py index f7791967b3..fd50197326 100644 --- a/var/spack/repos/builtin/packages/czmq/package.py +++ b/var/spack/repos/builtin/packages/czmq/package.py @@ -38,19 +38,3 @@ class Czmq(AutotoolsPackage): depends_on('autoconf', type='build') depends_on('pkg-config', type='build') depends_on('zeromq') - - def autoreconf(self, spec, prefix): - # Work around autogen.sh oddities - # bash = which("bash") - # bash("./autogen.sh") - mkdirp("config") - autoreconf = which("autoreconf") - autoreconf("--install", "--verbose", "--force", - "-I", "config", - "-I", join_path(spec['pkg-config'].prefix, - "share", "aclocal"), - "-I", join_path(spec['automake'].prefix, - "share", "aclocal"), - "-I", join_path(spec['libtool'].prefix, - "share", "aclocal"), - ) diff --git a/var/spack/repos/builtin/packages/elfutils/package.py b/var/spack/repos/builtin/packages/elfutils/package.py index bdc858e121..4a91c7db30 100644 --- a/var/spack/repos/builtin/packages/elfutils/package.py +++ b/var/spack/repos/builtin/packages/elfutils/package.py @@ -35,15 +35,15 @@ class Elfutils(AutotoolsPackage): homepage = "https://fedorahosted.org/elfutils/" + depends_on('libtool', type='build') + depends_on('automake', type='build') + depends_on('autoconf', type='build') + version('0.163', git='git://git.fedorahosted.org/git/elfutils.git', tag='elfutils-0.163') provides('elf') - def autoreconf(self, spec, prefix): - autoreconf = which('autoreconf') - autoreconf('-if') - def configure_args(self): return ['--enable-maintainer-mode'] diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index e4117877c1..0314950140 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -61,11 +61,3 @@ class Flex(AutotoolsPackage): url += "/archive/flex-{0}.tar.gz".format(version.dashed) return url - - def autoreconf(self, spec, prefix): - pass - - @when('@:2.6.0') - def autoreconf(self, spec, prefix): - libtoolize('--install', '--force') - autoreconf('--install', '--force') diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 31da068d72..a9fed4d8dd 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -30,7 +30,7 @@ import sys from os.path import isfile -class Gcc(Package): +class Gcc(AutotoolsPackage): """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, and Java.""" homepage = "https://gcc.gnu.org" @@ -85,7 +85,9 @@ class Gcc(Package): patch('piclibs.patch', when='+piclibs') patch('gcc-backport.patch', when='@4.7:4.9.2,5:5.3') - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec + prefix = self.spec.prefix # libjava/configure needs a minor fix to install into spack paths. filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure', string=True) @@ -138,18 +140,15 @@ class Gcc(Package): darwin_options = ["--with-build-config=bootstrap-debug"] options.extend(darwin_options) - build_dir = join_path(self.stage.path, 'spack-build') - configure = Executable(join_path(self.stage.source_path, 'configure')) - with working_dir(build_dir, create=True): - # Rest of install is straightforward. - configure(*options) - if sys.platform == 'darwin': - make("bootstrap") - else: - make() - make("install") + return options - self.write_rpath_specs() + build_directory = 'spack-build' + + @property + def build_targets(self): + if sys.platform == 'darwin': + return ['bootstrap'] + return [] @property def spec_dir(self): @@ -157,6 +156,7 @@ class Gcc(Package): spec_dir = glob("%s/lib64/gcc/*/*" % self.prefix) return spec_dir[0] if spec_dir else None + @run_after('install') def write_rpath_specs(self): """Generate a spec file so the linker adds a rpath to the libs the compiler used to build the executable.""" diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py index a4d8c289d7..e2eb984876 100644 --- a/var/spack/repos/builtin/packages/glib/package.py +++ b/var/spack/repos/builtin/packages/glib/package.py @@ -53,22 +53,9 @@ class Glib(AutotoolsPackage): # around a legitimate usage. patch('no-Werror=format-security.patch') + force_autoreconf = True + def url_for_version(self, version): """Handle glib's version-based custom URLs.""" url = 'http://ftp.gnome.org/pub/gnome/sources/glib' return url + '/%s/glib-%s.tar.xz' % (version.up_to(2), version) - - def autoreconf(self, spec, prefix): - autoreconf = which("autoreconf") - autoreconf("--install", "--verbose", "--force", - "-I", "config", - "-I", join_path(spec['pkg-config'].prefix, - "share", "aclocal"), - "-I", join_path(spec['automake'].prefix, - "share", "aclocal"), - "-I", join_path(spec['libtool'].prefix, - "share", "aclocal"), - ) - - def install(self, spec, prefix): - make("install", parallel=False) diff --git a/var/spack/repos/builtin/packages/gource/package.py b/var/spack/repos/builtin/packages/gource/package.py index dda00420a3..21994ad42c 100644 --- a/var/spack/repos/builtin/packages/gource/package.py +++ b/var/spack/repos/builtin/packages/gource/package.py @@ -25,11 +25,11 @@ from spack import * -class Gource(Package): +class Gource(AutotoolsPackage): """Software version control visualization.""" homepage = "http://gource.io" - url = "https://github.com/acaudwell/Gource/releases/download/gource-0.44/gource-0.44.tar.gz" + url = "https://github.com/acaudwell/Gource/releases/download/gource-0.44/gource-0.44.tar.gz" version('0.44', '79cda1bfaad16027d59cce55455bfab88b57c69d') @@ -49,15 +49,17 @@ class Gource(Package): depends_on('sdl2') depends_on('sdl2-image') - def install(self, spec, prefix): - make_args = ['--prefix=%s' % prefix, - '--disable-dependency-tracking', - '--without-x', - '--with-boost=%s' % spec['boost'].prefix] + parallel = False + force_autoreconf = True - autoreconf('-i') - configure(*make_args) - make() + def url_for_version(self, version): + tmp = 'https://github.com/acaudwell/Gource/releases/download/gource-{0}/gource-{0}.tar.gz' # NOQA: ignore=E501 + return tmp.format(version.dotted) - make("install", - parallel=False) + def configure_args(self): + spec = self.spec + return [ + '--disable-dependency-tracking', + '--without-x', + '--with-boost=%s' % spec['boost'].prefix + ] diff --git a/var/spack/repos/builtin/packages/libgd/package.py b/var/spack/repos/builtin/packages/libgd/package.py index 42eb23d85a..58867c85f8 100644 --- a/var/spack/repos/builtin/packages/libgd/package.py +++ b/var/spack/repos/builtin/packages/libgd/package.py @@ -38,8 +38,9 @@ class Libgd(AutotoolsPackage): """ homepage = "https://github.com/libgd/libgd" - url = "https://github.com/libgd/libgd/archive/gd-2.1.1.tar.gz" + url = 'https://github.com/libgd/libgd/releases/download/gd-2.2.4/libgd-2.2.4.tar.gz' + version('2.2.4', '0a3c307b5075edbe1883543dd1153c02') version('2.2.3', 'a67bd15fa33d4aac0a1c7904aed19f49') version('2.1.1', 'e91a1a99903e460e7ba00a794e72cc1e') @@ -54,16 +55,3 @@ class Libgd(AutotoolsPackage): depends_on('libpng') depends_on('libtiff') depends_on('fontconfig') - - def autoreconf(self, spec, prefix): - autoreconf("--install", "--force", - "-I", "m4", - "-I", join_path(spec['gettext'].prefix, - "share", "aclocal"), - "-I", join_path(spec['pkg-config'].prefix, - "share", "aclocal"), - "-I", join_path(spec['automake'].prefix, - "share", "aclocal"), - "-I", join_path(spec['libtool'].prefix, - "share", "aclocal") - ) diff --git a/var/spack/repos/builtin/packages/libquo/package.py b/var/spack/repos/builtin/packages/libquo/package.py index 3e574f7004..76a508f9c6 100644 --- a/var/spack/repos/builtin/packages/libquo/package.py +++ b/var/spack/repos/builtin/packages/libquo/package.py @@ -23,10 +23,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os -class Libquo(Package): +class Libquo(AutotoolsPackage): """QUO (as in "status quo") is a runtime library that aids in accommodating thread-level heterogeneity in dynamic, phased MPI+X applications comprising @@ -42,25 +41,8 @@ class Libquo(Package): depends_on('automake', type='build') depends_on('libtool', type='build') - def install(self, spec, prefix): - autoreconf_options = [ - '--install', - '--verbose', - '--force', - '-I', 'config', - '-I', os.path.join(spec['automake'].prefix, - 'share', 'aclocal'), - '-I', os.path.join(spec['libtool'].prefix, - 'share', 'aclocal') + def configure_args(self): + return [ + 'CC={0}'.format(self.spec['mpi'].mpicc), + 'FC={0}'.format(self.spec['mpi'].mpifc) ] - autoreconf(*autoreconf_options) - - configure_options = [ - '--prefix={0}'.format(prefix), - 'CC=%s' % join_path(spec['mpi'].prefix.bin, "mpicc"), - 'FC=%s' % join_path(spec['mpi'].prefix.bin, "mpif90") - ] - configure(*configure_options) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index cd12503681..ae706089c9 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -36,6 +36,8 @@ class Libtool(AutotoolsPackage): depends_on('m4@1.4.6:', type='build') + build_directory = 'spack-build' + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/libuv/package.py b/var/spack/repos/builtin/packages/libuv/package.py index 5254239019..2f303280da 100644 --- a/var/spack/repos/builtin/packages/libuv/package.py +++ b/var/spack/repos/builtin/packages/libuv/package.py @@ -37,5 +37,7 @@ class Libuv(AutotoolsPackage): depends_on('libtool', type='build') def autoreconf(self, spec, prefix): + # This is needed because autogen.sh generates on-the-fly + # an m4 macro needed during configuration bash = which("bash") bash('autogen.sh') diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index 415c55b21a..a8b0423933 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -41,6 +41,8 @@ class M4(AutotoolsPackage): depends_on('libsigsegv', when='+sigsegv') + build_directory = 'spack-build' + def configure_args(self): spec = self.spec args = ['--enable-c++'] diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index 2da30c7b0c..36ab8766b9 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -34,8 +34,9 @@ class NetcdfCxx4(AutotoolsPackage): version('4.2.1', 'd019853802092cf686254aaba165fc81') depends_on('netcdf') + + depends_on('automake', type='build') depends_on('autoconf', type='build') + depends_on('libtool', type='build') - def autoreconf(self, spec, prefix): - # Rebuild to prevent problems of inconsistency in git repo - which('autoreconf')('-ivf') + force_autoreconf = True diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index 60dfdf7405..69949b0017 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -27,7 +27,7 @@ import subprocess from spack import * -class Plumed(Package): +class Plumed(AutotoolsPackage): """PLUMED is an open source library for free energy calculations in molecular systems which works together with some of the most popular molecular dynamics engines. @@ -67,6 +67,8 @@ class Plumed(Package): depends_on('gsl', when='+gsl') depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') # Dictionary mapping PLUMED versions to the patches it provides # interactively @@ -84,6 +86,8 @@ class Plumed(Package): } } + force_autoreconf = True + def apply_patch(self, other): plumed = subprocess.Popen( [join_path(self.spec.prefix.bin, 'plumed'), 'patch', '-p'], @@ -99,12 +103,15 @@ class Plumed(Package): # Make plumed visible from dependent packages module.plumed = Executable(join_path(self.spec.prefix.bin, 'plumed')) - def install(self, spec, prefix): + @run_before('autoreconf') + def filter_gslcblas(self): # This part is needed to avoid linking with gsl cblas # interface which will mask the cblas interface # provided by optimized libraries due to linking order filter_file('-lgslcblas', '', 'configure.ac') - autoreconf('-ivf') + + def configure_args(self): + spec = self.spec # From plumed docs : # Also consider that this is different with respect to what some other @@ -114,8 +121,7 @@ class Plumed(Package): # with MPI you should use: # # > ./configure CXX="$MPICXX" - configure_opts = ['--prefix=' + prefix] - + configure_opts = [] # If using MPI then ensure the correct compiler wrapper is used. if '+mpi' in spec: configure_opts.extend([ @@ -153,6 +159,4 @@ class Plumed(Package): configure_opts.extend([ '--enable-modules={0}'.format("".join(module_opts))]) - configure(*configure_opts) - make() - make('install') + return configure_opts diff --git a/var/spack/repos/builtin/packages/py-meep/package.py b/var/spack/repos/builtin/packages/py-meep/package.py index 0ebba77ac6..64ca4e25d9 100644 --- a/var/spack/repos/builtin/packages/py-meep/package.py +++ b/var/spack/repos/builtin/packages/py-meep/package.py @@ -51,8 +51,8 @@ class PyMeep(PythonPackage): phases = ['clean', 'build_ext', 'install', 'bdist'] - def setup_file(self, spec, prefix): - return 'setup-mpi.py' if '+mpi' in spec else 'setup.py' + def setup_file(self): + return 'setup-mpi.py' if '+mpi' in self.spec else 'setup.py' def common_args(self, spec, prefix): include_dirs = [ diff --git a/var/spack/repos/builtin/packages/py-pypar/package.py b/var/spack/repos/builtin/packages/py-pypar/package.py index f10b6d807f..6ba999c063 100644 --- a/var/spack/repos/builtin/packages/py-pypar/package.py +++ b/var/spack/repos/builtin/packages/py-pypar/package.py @@ -37,8 +37,7 @@ class PyPypar(PythonPackage): depends_on('mpi') depends_on('py-numpy', type=('build', 'run')) + build_directory = 'source' + def url_for_version(self, version): return "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pypar/pypar-%s.tgz" % version - - def build_directory(self): - return 'source' diff --git a/var/spack/repos/builtin/packages/swiftsim/package.py b/var/spack/repos/builtin/packages/swiftsim/package.py index 1c424b5ca0..2ebdc1fdcb 100644 --- a/var/spack/repos/builtin/packages/swiftsim/package.py +++ b/var/spack/repos/builtin/packages/swiftsim/package.py @@ -58,13 +58,6 @@ class Swiftsim(AutotoolsPackage): tty.warn('This is needed to clone SWIFT repository') spack_env.set('GIT_SSL_NO_VERIFY', 1) - def autoreconf(self, spec, prefix): - libtoolize() - aclocal() - autoconf() - autogen = Executable('./autogen.sh') - autogen() - def configure_args(self): return ['--prefix=%s' % self.prefix, '--enable-mpi' if '+mpi' in self.spec else '--disable-mpi', diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py index 2ec8bb5236..a9bc3cceaa 100644 --- a/var/spack/repos/builtin/packages/tcl/package.py +++ b/var/spack/repos/builtin/packages/tcl/package.py @@ -42,6 +42,8 @@ class Tcl(AutotoolsPackage): depends_on('zlib') + configure_directory = 'unix' + def url_for_version(self, version): base_url = 'http://prdownloads.sourceforge.net/tcl' return '{0}/tcl{1}-src.tar.gz'.format(base_url, version) @@ -52,9 +54,6 @@ class Tcl(AutotoolsPackage): env.set('TCL_LIBRARY', join_path(self.prefix.lib, 'tcl{0}'.format( self.spec.version.up_to(2)))) - def build_directory(self): - return 'unix' - @run_after('install') def symlink_tclsh(self): with working_dir(self.prefix.bin): diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py index 071db04e63..66573eaa45 100644 --- a/var/spack/repos/builtin/packages/tk/package.py +++ b/var/spack/repos/builtin/packages/tk/package.py @@ -42,6 +42,8 @@ class Tk(AutotoolsPackage): depends_on("tcl") depends_on("libx11", when='+X') + configure_directory = 'unix' + def url_for_version(self, version): base_url = "http://prdownloads.sourceforge.net/tcl" return "{0}/tk{1}-src.tar.gz".format(base_url, version) @@ -52,9 +54,6 @@ class Tk(AutotoolsPackage): run_env.set('TK_LIBRARY', join_path(self.prefix.lib, 'tk{0}'.format( self.spec.version.up_to(2)))) - def build_directory(self): - return 'unix' - def configure_args(self): spec = self.spec return ['--with-tcl={0}'.format(spec['tcl'].prefix.lib)] |