add fPIC to MUMPS when building shared libs

This commit is contained in:
Denis Davydov 2016-03-25 09:56:24 +01:00
parent fdd7e91ba0
commit 3e39daeb12

View File

@ -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: