summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2016-03-24 12:49:56 +0100
committerDenis Davydov <davydden@gmail.com>2016-03-25 06:56:46 +0100
commitfdd7e91ba078bea4f0fec1859124baaa8261fa2c (patch)
tree962c7f500b7a008a21290b77674a2d7def3680e8
parent38ea75e8ca65dd6c896fe7856efdb1d8355ec524 (diff)
downloadspack-fdd7e91ba078bea4f0fec1859124baaa8261fa2c.tar.gz
spack-fdd7e91ba078bea4f0fec1859124baaa8261fa2c.tar.bz2
spack-fdd7e91ba078bea4f0fec1859124baaa8261fa2c.tar.xz
spack-fdd7e91ba078bea4f0fec1859124baaa8261fa2c.zip
add shared variant to mumps (needed for Trilinos) plus tests
-rw-r--r--var/spack/repos/builtin/packages/mumps/Makefile.inc5
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py45
2 files changed, 41 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/mumps/Makefile.inc b/var/spack/repos/builtin/packages/mumps/Makefile.inc
index 2e6a041878..22d8f5518a 100644
--- a/var/spack/repos/builtin/packages/mumps/Makefile.inc
+++ b/var/spack/repos/builtin/packages/mumps/Makefile.inc
@@ -8,12 +8,9 @@ IORDERINGSF = $(ISCOTCH)
IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
PLAT =
-LIBEXT = .a
-OUTC = -o
+OUTC = -o
OUTF = -o
RM = /bin/rm -f
-AR = ar vr
-RANLIB = ranlib
INCSEQ = -I$(topdir)/libseq
LIBSEQ = -L$(topdir)/libseq -lmpiseq
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py
index 5a254dfd00..2801d4194d 100644
--- a/var/spack/repos/builtin/packages/mumps/package.py
+++ b/var/spack/repos/builtin/packages/mumps/package.py
@@ -1,6 +1,5 @@
from spack import *
-import os
-
+import os, sys
class Mumps(Package):
"""MUMPS: a MUltifrontal Massively Parallel sparse direct Solver"""
@@ -19,6 +18,7 @@ class Mumps(Package):
variant('float', default=True, description='Activate the compilation of smumps')
variant('complex', default=True, description='Activate the compilation of cmumps and/or zmumps')
variant('idx64', default=False, description='Use int64_t/integer*8 as default index type')
+ variant('shared', default=True, description='Build shared libraries')
depends_on('scotch + esmumps', when='~ptscotch+scotch')
@@ -105,6 +105,27 @@ class Mumps(Package):
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
makefile_conf.append("CDEFS = -DAdd_")
+ if '+shared' in self.spec:
+ if sys.platform == 'darwin':
+ # Building dylibs with mpif90 causes segfaults on 10.8 and 10.10. Use gfortran. (Homebrew)
+ makefile_conf.extend([
+ 'LIBEXT=.dylib',
+ 'AR=%s -dynamiclib -undefined dynamic_lookup -o ' % os.environ['FC'],
+ 'RANLIB=echo'
+ ])
+ else:
+ makefile_conf.extend([
+ 'LIBEXT=.so',
+ 'AR=$(FL) -shared -o',
+ 'RANLIB=echo'
+ ])
+ else:
+ makefile_conf.extend([
+ 'LIBEXT = .a',
+ 'AR = ar vr',
+ 'RANLIB = ranlib'
+ ])
+
makefile_inc_template = join_path(os.path.dirname(self.module.__file__),
'Makefile.inc')
@@ -121,7 +142,7 @@ class Mumps(Package):
def install(self, spec, prefix):
make_libs = []
- # the coice to compile ?examples is to have kind of a sanity
+ # the choice to compile ?examples is to have kind of a sanity
# check on the libraries generated.
if '+float' in spec:
make_libs.append('sexamples')
@@ -135,10 +156,24 @@ class Mumps(Package):
self.write_makefile_inc()
- # Build fails in parallel, at least on OS-X
+ # Build fails in parallel
make(*make_libs, parallel=False)
install_tree('lib', prefix.lib)
install_tree('include', prefix.include)
if '~mpi' in spec:
- install('libseq/libmpiseq.a', prefix.lib)
+ lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'
+ lib_suffix = lib_dsuffix if '+shared' in spec else '.a'
+ install('libseq/libmpiseq%s' % lib_suffix, prefix.lib)
+
+ # FIXME: extend the tests to mpirun -np 2 (or alike) when build with MPI
+ # FIXME: use something like numdiff to compare blessed output with the current
+ with working_dir('examples'):
+ if '+float' in spec:
+ os.system('./ssimpletest < input_simpletest_real')
+ if '+complex' in spec:
+ os.system('./csimpletest < input_simpletest_real')
+ if '+double' in spec:
+ os.system('./dsimpletest < input_simpletest_real')
+ if '+complex' in spec:
+ os.system('./zsimpletest < input_simpletest_cmplx')