Fixing a small bug with metis@4+shared installs on the Mac platform.

This commit is contained in:
Joseph Ciurej 2016-05-25 12:27:52 -07:00
parent 483ec0d762
commit 734fb459a4

View file

@ -94,17 +94,19 @@ def install(self, spec, prefix):
install(sharefile, prefix.share) install(sharefile, prefix.share)
if '+shared' in spec: if '+shared' in spec:
shared_flags = ['-fPIC', '-shared']
if sys.platform == 'darwin': if sys.platform == 'darwin':
lib_dsuffix = 'dylib' shared_suffix = 'dylib'
load_flag = '-Wl,-all_load' shared_flags.extend(['-Wl,-all_load', 'libmetis.a'])
no_load_flag = ''
else: else:
lib_dsuffix = 'so' shared_suffix = 'so'
load_flag = '-Wl,-whole-archive' shared_flags.extend(['-Wl,-whole-archive', 'libmetis.a',
no_load_flag = '-Wl,-no-whole-archive' '-Wl,-no-whole-archive'])
ccompile('-fPIC', '-shared', load_flag, 'libmetis.a', no_load_flag, shared_out = '%s/libmetis.%s' % (prefix.lib, shared_suffix)
'-o', '%s/libmetis.%s' % (prefix.lib, lib_dsuffix)) shared_flags.extend(['-o', shared_out])
ccompile(*shared_flags)
# Set up and run tests on installation # Set up and run tests on installation
ccompile('-I%s' % prefix.include, '-L%s' % prefix.lib, ccompile('-I%s' % prefix.include, '-L%s' % prefix.lib,
@ -128,7 +130,7 @@ def install(self, spec, prefix):
os.system('%s %s 10' % (test_bin('partdmesh'), graph)) os.system('%s %s 10' % (test_bin('partdmesh'), graph))
os.system('%s %s' % (test_bin('mesh2dual'), graph)) os.system('%s %s' % (test_bin('mesh2dual'), graph))
# TODO: The following code should replace the testing code in the # FIXME: The following code should replace the testing code in the
# block above since it causes installs to fail when one or more of the # block above since it causes installs to fail when one or more of the
# Metis tests fail, but it currently doesn't work because the 'mtest', # Metis tests fail, but it currently doesn't work because the 'mtest',
# 'onmetis', and 'partnmesh' tests return error codes that trigger # 'onmetis', and 'partnmesh' tests return error codes that trigger