superlu-dist: avoid harcoding blas/lapack/mpi; remove preferred version
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
|
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
|
||||||
'set_executable', 'copy_mode', 'unset_executable_mode',
|
'set_executable', 'copy_mode', 'unset_executable_mode',
|
||||||
'remove_dead_links', 'remove_linked_tree', 'find_library_path',
|
'remove_dead_links', 'remove_linked_tree', 'find_library_path',
|
||||||
'fix_darwin_install_name']
|
'fix_darwin_install_name','to_link_flags']
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
@@ -424,6 +424,19 @@ def fix_darwin_install_name(path):
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
def to_link_flags(library):
|
||||||
|
"""Transforms a path to a <library> into linking flags -L<dir> -l<name>.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
A string of linking flags.
|
||||||
|
"""
|
||||||
|
dir = os.path.dirname(library)
|
||||||
|
# Asume libXYZ.suffix
|
||||||
|
name = os.path.basename(library)[3:].split(".")[0]
|
||||||
|
res = '-L%s -l%s' % (dir,name)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
def find_library_path(libname, *paths):
|
def find_library_path(libname, *paths):
|
||||||
"""Searches for a file called <libname> in each path.
|
"""Searches for a file called <libname> in each path.
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ class SuperluDist(Package):
|
|||||||
url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz"
|
url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz"
|
||||||
|
|
||||||
version('5.0.0', '2b53baf1b0ddbd9fcf724992577f0670')
|
version('5.0.0', '2b53baf1b0ddbd9fcf724992577f0670')
|
||||||
# default to version 4.3 since petsc and trilinos are not tested with 5.0.
|
version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae')
|
||||||
version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae', preferred=True)
|
|
||||||
version('4.2', 'ae9fafae161f775fbac6eba11e530a65')
|
version('4.2', 'ae9fafae161f775fbac6eba11e530a65')
|
||||||
version('4.1', '4edee38cc29f687bd0c8eb361096a455')
|
version('4.1', '4edee38cc29f687bd0c8eb361096a455')
|
||||||
version('4.0', 'c0b98b611df227ae050bc1635c6940e0')
|
version('4.0', 'c0b98b611df227ae050bc1635c6940e0')
|
||||||
@@ -47,10 +46,10 @@ def install(self, spec, prefix):
|
|||||||
makefile_inc = []
|
makefile_inc = []
|
||||||
makefile_inc.extend([
|
makefile_inc.extend([
|
||||||
'PLAT = _mac_x',
|
'PLAT = _mac_x',
|
||||||
'DSuperLUroot = %s' % self.stage.source_path, #self.stage.path, prefix
|
'DSuperLUroot = %s' % self.stage.source_path,
|
||||||
'DSUPERLULIB = $(DSuperLUroot)/lib/libsuperlu_dist.a',
|
'DSUPERLULIB = $(DSuperLUroot)/lib/libsuperlu_dist.a',
|
||||||
'BLASDEF = -DUSE_VENDOR_BLAS',
|
'BLASDEF = -DUSE_VENDOR_BLAS',
|
||||||
'BLASLIB = -L%s -llapack %s -lblas' % (spec['lapack'].prefix.lib, spec['blas'].prefix.lib), # FIXME: avoid hardcoding blas/lapack lib names
|
'BLASLIB = %s %s' % (to_link_flags(spec['lapack'].lapack_shared_lib),to_link_flags(spec['blas'].blas_shared_lib)),
|
||||||
'METISLIB = -L%s -lmetis' % spec['metis'].prefix.lib,
|
'METISLIB = -L%s -lmetis' % spec['metis'].prefix.lib,
|
||||||
'PARMETISLIB = -L%s -lparmetis' % spec['parmetis'].prefix.lib,
|
'PARMETISLIB = -L%s -lparmetis' % spec['parmetis'].prefix.lib,
|
||||||
'FLIBS =',
|
'FLIBS =',
|
||||||
@@ -58,12 +57,12 @@ def install(self, spec, prefix):
|
|||||||
'ARCH = ar',
|
'ARCH = ar',
|
||||||
'ARCHFLAGS = cr',
|
'ARCHFLAGS = cr',
|
||||||
'RANLIB = true',
|
'RANLIB = true',
|
||||||
'CC = mpicc', # FIXME avoid hardcoding MPI compiler names
|
'CC = %s' % spec['mpi'].mpicc,
|
||||||
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' %(spec['parmetis'].prefix.include, spec['metis'].prefix.include),
|
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' %(spec['parmetis'].prefix.include, spec['metis'].prefix.include),
|
||||||
'NOOPTS = -fPIC -std=c99',
|
'NOOPTS = -fPIC -std=c99',
|
||||||
'FORTRAN = mpif77',
|
'FORTRAN = %s' % spec['mpi'].mpif77,
|
||||||
'F90FLAGS = -O2',
|
'F90FLAGS = -O2',
|
||||||
'LOADER = mpif77',
|
'LOADER = %s' % spec['mpi'].mpif77,
|
||||||
'LOADOPTS =',
|
'LOADOPTS =',
|
||||||
'CDEFS = -DAdd_'
|
'CDEFS = -DAdd_'
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user