Change from PR #552: rename setup_dependent_python_module -> setup_dependent_package
- Fixed in package.py
- Fixed wrong prototypes in packages that use it.
- Fixed build_environment to set module variables properly
  - added hacky fix to ensure spec/package consistency in build processes.
  - Need to think about defensive spec copy done by `Repo.get`.  May be
    time to think about an immutable spec implementation.
			
			
This commit is contained in:
		@@ -54,7 +54,7 @@ def setup_dependent_environment(self, env, dependent_spec):
 | 
			
		||||
        env.set('MPICH_F90', spack_f90)
 | 
			
		||||
        env.set('MPICH_FC', spack_fc)
 | 
			
		||||
 | 
			
		||||
    def setup_dependent_python_module(self, module, spec, dep_spec):
 | 
			
		||||
    def setup_dependent_package(self, module, dep_spec):
 | 
			
		||||
        """For dependencies, make mpicc's use spack wrapper."""
 | 
			
		||||
        # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers?
 | 
			
		||||
        module.mpicc = join_path(self.prefix.bin, 'mpicc')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
from spack import *
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
class NetlibScalapack(Package):
 | 
			
		||||
    """ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines"""
 | 
			
		||||
@@ -11,16 +12,16 @@ class NetlibScalapack(Package):
 | 
			
		||||
    version('2.0.0', '9e76ae7b291be27faaad47cfc256cbfe')
 | 
			
		||||
    # versions before 2.0.0 are not using cmake and requires blacs as
 | 
			
		||||
    # a separated package
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    variant('shared', default=True, description='Build the shared library version')
 | 
			
		||||
    variant('fpic', default=False, description="Build with -fpic compiler option")
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    provides('scalapack')
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    depends_on('mpi')
 | 
			
		||||
    depends_on('lapack')
 | 
			
		||||
    
 | 
			
		||||
    def install(self, spec, prefix):       
 | 
			
		||||
 | 
			
		||||
    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'),
 | 
			
		||||
@@ -40,10 +41,11 @@ def install(self, spec, prefix):
 | 
			
		||||
            make()
 | 
			
		||||
            make("install")
 | 
			
		||||
 | 
			
		||||
    def setup_dependent_python_module(self, module, spec, dependent_spec):
 | 
			
		||||
    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['scalapack'] else '.a'
 | 
			
		||||
        lib_suffix = lib_dsuffix if '+shared' in spec else '.a'
 | 
			
		||||
 | 
			
		||||
        spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib
 | 
			
		||||
        spec['scalapack'].cc_link = spec['scalapack'].fc_link
 | 
			
		||||
        spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, 'libscalapack%s' % lib_suffix)]
 | 
			
		||||
        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)]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user