Merge pull request #1270 from davydden/pkg/mumps_scalapack_fix_blas

Pkg/mumps scalapack fix blas
This commit is contained in:
Todd Gamblin
2016-07-18 13:57:26 -07:00
committed by GitHub
2 changed files with 64 additions and 43 deletions

View File

@@ -25,8 +25,10 @@
from spack import *
import sys
class NetlibScalapack(Package):
"""ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines"""
"""ScaLAPACK is a library of high-performance linear algebra routines for
parallel distributed memory machines"""
homepage = "http://www.netlib.org/scalapack/"
url = "http://www.netlib.org/scalapack/scalapack-2.0.2.tgz"
@@ -48,10 +50,22 @@ class NetlibScalapack(Package):
def install(self, spec, prefix):
options = [
"-DBUILD_SHARED_LIBS:BOOL=%s" % ('ON' if '+shared' in spec else 'OFF'),
"-DBUILD_STATIC_LIBS:BOOL=%s" % ('OFF' if '+shared' in spec else 'ON'),
"-DUSE_OPTIMIZED_LAPACK_BLAS:BOOL=ON", # forces scalapack to use find_package(LAPACK)
]
"-DBUILD_SHARED_LIBS:BOOL=%s" % ('ON' if '+shared' in spec else
'OFF'),
"-DBUILD_STATIC_LIBS:BOOL=%s" % ('OFF' if '+shared' in spec else
'ON'),
# forces scalapack to use find_package(LAPACK):
"-DUSE_OPTIMIZED_LAPACK_BLAS:BOOL=ON",
]
# Make sure we use Spack's Lapack:
options.extend([
'-DLAPACK_FOUND=true',
'-DLAPACK_INCLUDE_DIRS=%s' % spec['lapack'].prefix.include,
'-DLAPACK_LIBRARIES=%s' % (
spec['lapack'].lapack_shared_lib if '+shared' in spec else
spec['lapack'].lapack_static_lib),
])
if '+fpic' in spec:
options.extend([
@@ -66,16 +80,15 @@ def install(self, spec, prefix):
make()
make("install")
# The shared libraries are not installed correctly on Darwin; correct this
# The shared libraries are not installed correctly on Darwin:
if (sys.platform == 'darwin') and ('+shared' in spec):
fix_darwin_install_name(prefix.lib)
def setup_dependent_package(self, module, dependent_spec):
spec = self.spec
lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'
lib_suffix = lib_dsuffix if '+shared' in spec else '.a'
lib_suffix = dso_suffix if '+shared' in spec else 'a'
spec.fc_link = '-L%s -lscalapack' % spec.prefix.lib
spec.cc_link = spec.fc_link
spec.libraries = [join_path(spec.prefix.lib, 'libscalapack%s' % lib_suffix)]
spec.libraries = [join_path(spec.prefix.lib,
'libscalapack.%s' % lib_suffix)]