Merge pull request #626 from davydden/mumps_shared_tests
add shared variant to mumps (needed for Trilinos) plus tests
This commit is contained in:
commit
7e7461e8fb
@ -8,12 +8,9 @@ IORDERINGSF = $(ISCOTCH)
|
|||||||
IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
|
IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
|
||||||
|
|
||||||
PLAT =
|
PLAT =
|
||||||
LIBEXT = .a
|
OUTC = -o
|
||||||
OUTC = -o
|
|
||||||
OUTF = -o
|
OUTF = -o
|
||||||
RM = /bin/rm -f
|
RM = /bin/rm -f
|
||||||
AR = ar vr
|
|
||||||
RANLIB = ranlib
|
|
||||||
|
|
||||||
INCSEQ = -I$(topdir)/libseq
|
INCSEQ = -I$(topdir)/libseq
|
||||||
LIBSEQ = -L$(topdir)/libseq -lmpiseq
|
LIBSEQ = -L$(topdir)/libseq -lmpiseq
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
import os
|
import os, sys
|
||||||
|
|
||||||
|
|
||||||
class Mumps(Package):
|
class Mumps(Package):
|
||||||
"""MUMPS: a MUltifrontal Massively Parallel sparse direct Solver"""
|
"""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('float', default=True, description='Activate the compilation of smumps')
|
||||||
variant('complex', default=True, description='Activate the compilation of cmumps and/or zmumps')
|
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('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')
|
depends_on('scotch + esmumps', when='~ptscotch+scotch')
|
||||||
@ -70,6 +70,9 @@ def write_makefile_inc(self):
|
|||||||
|
|
||||||
makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings)))
|
makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings)))
|
||||||
|
|
||||||
|
# when building shared libs need -fPIC, otherwise
|
||||||
|
# /usr/bin/ld: graph.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
|
||||||
|
fpic = '-fPIC' if '+shared' in self.spec else ''
|
||||||
# TODO: test this part, it needs a full blas, scalapack and
|
# TODO: test this part, it needs a full blas, scalapack and
|
||||||
# partitionning environment with 64bit integers
|
# partitionning environment with 64bit integers
|
||||||
if '+idx64' in self.spec:
|
if '+idx64' in self.spec:
|
||||||
@ -77,14 +80,14 @@ def write_makefile_inc(self):
|
|||||||
# the fortran compilation flags most probably are
|
# the fortran compilation flags most probably are
|
||||||
# working only for intel and gnu compilers this is
|
# working only for intel and gnu compilers this is
|
||||||
# perhaps something the compiler should provide
|
# perhaps something the compiler should provide
|
||||||
['OPTF = -O -DALLOW_NON_INIT %s' % '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8',
|
['OPTF = %s -O -DALLOW_NON_INIT %s' % (fpic,'-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8'),
|
||||||
'OPTL = -O ',
|
'OPTL = %s -O ' % fpic,
|
||||||
'OPTC = -O -DINTSIZE64'])
|
'OPTC = %s -O -DINTSIZE64' % fpic])
|
||||||
else:
|
else:
|
||||||
makefile_conf.extend(
|
makefile_conf.extend(
|
||||||
['OPTF = -O -DALLOW_NON_INIT',
|
['OPTF = %s -O -DALLOW_NON_INIT' % fpic,
|
||||||
'OPTL = -O ',
|
'OPTL = %s -O ' % fpic,
|
||||||
'OPTC = -O '])
|
'OPTC = %s -O ' % fpic])
|
||||||
|
|
||||||
|
|
||||||
if '+mpi' in self.spec:
|
if '+mpi' in self.spec:
|
||||||
@ -105,6 +108,27 @@ def write_makefile_inc(self):
|
|||||||
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
|
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
|
||||||
makefile_conf.append("CDEFS = -DAdd_")
|
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 -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % (os.environ['FC'],prefix.lib),
|
||||||
|
'RANLIB=echo'
|
||||||
|
])
|
||||||
|
else:
|
||||||
|
makefile_conf.extend([
|
||||||
|
'LIBEXT=.so',
|
||||||
|
'AR=$(FL) -shared -Wl,-soname -Wl,%s/$(notdir $@) -o' % prefix.lib,
|
||||||
|
'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_template = join_path(os.path.dirname(self.module.__file__),
|
||||||
'Makefile.inc')
|
'Makefile.inc')
|
||||||
@ -121,7 +145,7 @@ def write_makefile_inc(self):
|
|||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
make_libs = []
|
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.
|
# check on the libraries generated.
|
||||||
if '+float' in spec:
|
if '+float' in spec:
|
||||||
make_libs.append('sexamples')
|
make_libs.append('sexamples')
|
||||||
@ -135,10 +159,24 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
self.write_makefile_inc()
|
self.write_makefile_inc()
|
||||||
|
|
||||||
# Build fails in parallel, at least on OS-X
|
# Build fails in parallel
|
||||||
make(*make_libs, parallel=False)
|
make(*make_libs, parallel=False)
|
||||||
|
|
||||||
install_tree('lib', prefix.lib)
|
install_tree('lib', prefix.lib)
|
||||||
install_tree('include', prefix.include)
|
install_tree('include', prefix.include)
|
||||||
if '~mpi' in spec:
|
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')
|
||||||
|
Loading…
Reference in New Issue
Block a user