diff options
-rw-r--r-- | .style.yapf | 2 | ||||
-rw-r--r-- | flake8.ini | 4 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/astyle/package.py | 20 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/openmpi/package.py | 63 |
4 files changed, 56 insertions, 33 deletions
diff --git a/.style.yapf b/.style.yapf index 4741fb4f3b..a4b3f65252 100644 --- a/.style.yapf +++ b/.style.yapf @@ -1,3 +1,3 @@ [style] based_on_style = pep8 -column_limit = 80 +column_limit = 79 diff --git a/flake8.ini b/flake8.ini index 757c71705e..32ced73dd7 100644 --- a/flake8.ini +++ b/flake8.ini @@ -1,3 +1,3 @@ [flake8] -ignore = W391,F403 -max-line-length = 120
\ No newline at end of file +ignore = W391,F403,E221,F821 +max-line-length = 79 diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py index 5274fc018f..57083bb947 100644 --- a/var/spack/repos/builtin/packages/astyle/package.py +++ b/var/spack/repos/builtin/packages/astyle/package.py @@ -1,8 +1,11 @@ from spack import * -import os + class Astyle(Package): - """A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Code.""" + """ + A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, + Objective-C, C#, and Java Source Code. + """ homepage = "http://astyle.sourceforge.net/" url = "http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz" @@ -11,8 +14,15 @@ class Astyle(Package): def install(self, spec, prefix): with working_dir('src'): + # we need to edit the makefile in place to set compiler: + make_file = join_path(self.stage.source_path, + 'build', 'gcc', 'Makefile') + filter_file(r'^CXX\s*=.*', 'CXX=%s'.format(spack_cxx), make_file) + make('-f', - join_path(self.stage.source_path,'build','clang','Makefile'), - parallel=False) + make_file, + parallel=False) + mkdirp(self.prefix.bin) - install(join_path(self.stage.source_path, 'src','bin','astyle'), self.prefix.bin) + install(join_path(self.stage.source_path, 'src', 'bin', 'astyle'), + self.prefix.bin) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index d0dd2d657f..c656f78dab 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -1,6 +1,8 @@ -from spack import * import os +from spack import * + + class Openmpi(Package): """Open MPI is a project combining technologies and resources from several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) @@ -26,17 +28,26 @@ class Openmpi(Package): patch('configure.patch', when="@1.10.0:1.10.1") variant('psm', default=False, description='Build support for the PSM library.') - variant('pmi', default=True, description='Build support for PMI-based launchers') + variant('psm2', default=False, description='Build support for the Intel PSM2 library.') + variant('pmi', default=False, description='Build support for PMI-based launchers') variant('verbs', default=False, description='Build support for OpenFabrics verbs.') + variant('mxm', default=False, description='Build Mellanox Messaging support') + + variant('thread_multiple', default=False, description='Enable MPI_THREAD_MULTIPLE support') - # TODO : variant support for other schedulers is missing + # TODO : variant support for alps, loadleveler is missing variant('tm', default=False, description='Build TM (Torque, PBSPro, and compatible) support') + variant('slurm', default=False, description='Build SLURM scheduler component') + + variant('sqlite3', default=False, description='Build sqlite3 support') + + # TODO : support for CUDA is missing provides('mpi@:2.2', when='@1.6.5') provides('mpi@:3.0', when='@1.7.5:') depends_on('hwloc') - + depends_on('sqlite', when='+sqlite3') def url_for_version(self, version): return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) @@ -54,30 +65,35 @@ class Openmpi(Package): self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') + @property + def verbs(self): + # Up through version 1.6, this option was previously named --with-openib + if self.spec.satisfies('@:1.6'): + return 'openib' + # In version 1.7, it was renamed to be --with-verbs + elif self.spec.satisfies('@1.7:'): + return 'verbs' def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, "--with-hwloc=%s" % spec['hwloc'].prefix, "--enable-shared", "--enable-static"] - - # Variants - if '+tm' in spec: - config_args.append("--with-tm") # necessary for Torque support - - if '+psm' in spec: - config_args.append("--with-psm") - - if '+pmi' in spec: - config_args.append("--with-pmi") #TODO: let user specify directory when possible - - if '+verbs' in spec: - # Up through version 1.6, this option was previously named --with-openib - if spec.satisfies('@:1.6'): - config_args.append("--with-openib") - # In version 1.7, it was renamed to be --with-verbs - elif spec.satisfies('@1.7:'): - config_args.append("--with-verbs") + # Variant based arguments + config_args.extend([ + # Schedulers + '--with-tm' if '+tm' in spec else '--without-tm', + '--with-slurm' if '+slurm' in spec else '--without-slurm', + # Fabrics + '--with-psm' if '+psm' in spec else '--without-psm', + '--with-psm2' if '+psm2' in spec else '--without-psm2', + ('--with-%s' % self.verbs) if '+verbs' in spec else ('--without-%s' % self.verbs), + '--with-mxm' if '+mxm' in spec else '--without-mxm', + # Other options + '--enable-mpi-thread-multiple' if '+thread_multiple' in spec else '--disable-mpi-thread-multiple', + '--with-pmi' if '+pmi' in spec else '--without-pmi', + '--with-sqlite3' if '+sqlite3' in spec else '--without-sqlite3' + ]) # TODO: use variants for this, e.g. +lanl, +llnl, etc. # use this for LANL builds, but for LLNL builds, we need: @@ -85,9 +101,6 @@ class Openmpi(Package): if self.version == ver("1.6.5") and '+lanl' in spec: config_args.append("--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") - # TODO: Spack should make it so that you can't actually find - # these compilers if they're "disabled" for the current - # compiler configuration. if not self.compiler.f77 and not self.compiler.fc: config_args.append("--enable-mpi-fortran=no") |