summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Ciurej <ciurej1@llnl.gov>2016-04-26 10:24:36 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-04-26 10:24:36 -0700
commit8ec5e8118643223c00b3106fb4e4f1204821e380 (patch)
tree2a6ee33f3bb417ade2bc0dc8f5a576937eb379cc
parent8e227f603d0c158e9f71a0bc0a815d977415908c (diff)
downloadspack-8ec5e8118643223c00b3106fb4e4f1204821e380.tar.gz
spack-8ec5e8118643223c00b3106fb4e4f1204821e380.tar.bz2
spack-8ec5e8118643223c00b3106fb4e4f1204821e380.tar.xz
spack-8ec5e8118643223c00b3106fb4e4f1204821e380.zip
Update Package : Zoltan (#833)
* Added preliminary implementations for the debug and shared variants. * Fixed a few problems with the '+shared' variant of the Zoltan package. Added support for a few more important Zoltan package versions. * Fixed a minor compiler incompatibility issue with the '+shared+mpi' variants.
-rw-r--r--var/spack/repos/builtin/packages/zoltan/package.py35
1 files changed, 31 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/zoltan/package.py b/var/spack/repos/builtin/packages/zoltan/package.py
index e20ae81adb..738dfb508b 100644
--- a/var/spack/repos/builtin/packages/zoltan/package.py
+++ b/var/spack/repos/builtin/packages/zoltan/package.py
@@ -1,3 +1,4 @@
+import re, os, glob
from spack import *
class Zoltan(Package):
@@ -12,8 +13,13 @@ class Zoltan(Package):
base_url = "http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions"
version('3.83', '1ff1bc93f91e12f2c533ddb01f2c095f')
+ version('3.8', '9d8fba8a990896881b85351d4327c4a9')
+ version('3.6', '9cce794f7241ecd8dbea36c3d7a880f9')
version('3.3', '5eb8f00bda634b25ceefa0122bd18d65')
+ variant('debug', default=False, description='Builds a debug version of the library')
+ variant('shared', default=True, description='Builds a shared version of the library')
+
variant('fortran', default=True, description='Enable Fortran support')
variant('mpi', default=False, description='Enable MPI support')
@@ -24,28 +30,49 @@ class Zoltan(Package):
'--enable-f90interface' if '+fortan' in spec else '--disable-f90interface',
'--enable-mpi' if '+mpi' in spec else '--disable-mpi',
]
+ config_cflags = [
+ '-O0' if '+debug' in spec else '-O3',
+ '-g' if '+debug' in spec else '-g0',
+ ]
+
+ if '+shared' in spec:
+ config_args.append('--with-ar=$(CXX) -shared $(LDFLAGS) -o')
+ config_args.append('RANLIB=echo')
+ config_cflags.append('-fPIC')
if '+mpi' in spec:
- config_args.append('--with-mpi=%s' % spec['mpi'].prefix)
- config_args.append('--with-mpi-compilers=%s' % spec['mpi'].prefix.bin)
config_args.append('CC=%s/mpicc' % spec['mpi'].prefix.bin)
config_args.append('CXX=%s/mpicxx' % spec['mpi'].prefix.bin)
+ config_args.append('--with-mpi=%s' % spec['mpi'].prefix)
+ config_args.append('--with-mpi-compilers=%s' % spec['mpi'].prefix.bin)
# NOTE: Early versions of Zoltan come packaged with a few embedded
# library packages (e.g. ParMETIS, Scotch), which messes with Spack's
# ability to descend directly into the package's source directory.
- if spec.satisfies('@:3.3'):
+ if spec.satisfies('@:3.6'):
cd('Zoltan_v%s' % self.version)
mkdirp('build')
cd('build')
config_zoltan = Executable('../configure')
- config_zoltan('--prefix=%s' % pwd(), *config_args)
+ config_zoltan(
+ '--prefix=%s' % pwd(),
+ '--with-cflags=%s' % ' '.join(config_cflags),
+ '--with-cxxflags=%s' % ' '.join(config_cflags),
+ *config_args)
make()
make('install')
+ # NOTE: Unfortunately, Zoltan doesn't provide any configuration options for
+ # the extension of the output library files, so this script must change these
+ # extensions as a post-processing step.
+ if '+shared' in spec:
+ for libpath in glob.glob('lib/*.a'):
+ libdir, libname = (os.path.dirname(libpath), os.path.basename(libpath))
+ move(libpath, os.path.join(libdir, re.sub(r'\.a$', '.so', libname)))
+
mkdirp(prefix)
move('include', prefix)
move('lib', prefix)