From eb45879c0eceed8ff1460e2812a9bd63b6e92b8a Mon Sep 17 00:00:00 2001 From: Jim Galarowicz Date: Mon, 17 Jul 2017 12:20:38 -0500 Subject: [PATCH] Add better changes for changing the krell packages from Package to CMakePackage. --- .../packages/cbtf-argonavis/package.py | 98 +++--- .../builtin/packages/cbtf-krell/package.py | 171 +++------- .../builtin/packages/cbtf-lanl/package.py | 80 +++-- .../repos/builtin/packages/cbtf/package.py | 136 ++++---- .../builtin/packages/openspeedshop/package.py | 313 +++++++++--------- 5 files changed, 388 insertions(+), 410 deletions(-) diff --git a/var/spack/repos/builtin/packages/cbtf-argonavis/package.py b/var/spack/repos/builtin/packages/cbtf-argonavis/package.py index 3c4715b1d73..3d6ac5922e6 100644 --- a/var/spack/repos/builtin/packages/cbtf-argonavis/package.py +++ b/var/spack/repos/builtin/packages/cbtf-argonavis/package.py @@ -67,6 +67,62 @@ class CbtfArgonavis(CMakePackage): parallel = False + build_directory = 'build_cbtf_argonavis' + + # We have converted from Package type to CMakePackage type for all the Krell projects. + # Comments from Pull Request (#4765): + # CMakePackage is completely different from the old Package class. Previously, you had + # a single install() phase to override. Now you have 3 phases: cmake(), build(), and install(). + # By default, cmake() runs cmake ... with some common arguments, which you can add to by + # overriding cmake_args(). build() runs make, and install() runs make install. + # So you need to add the appropriate flags to cmake_args() and remove the calls to make. + # See any other CMakePackage for examples. + # CMakePackage is documented: + # http://spack.readthedocs.io/en/latest/spack.build_systems.html?highlight= \ + # CMakePackage#module-spack.build_systems.cmake + + def build_type(self): + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + spec = self.spec + + # Look for package installation information in the cbtf and cbtf-krell + # prefixes + cmake_prefix_path = join_path( + spec['cbtf'].prefix) + ':' + join_path(spec['cbtf-krell'].prefix) + + cmake_args = [] + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, + '-DCMAKE_PREFIX_PATH=%s' % cmake_prefix_path, + '-DCUDA_DIR=%s' % spec['cuda'].prefix, + '-DCUDA_INSTALL_PATH=%s' % spec['cuda'].prefix, + '-DCUDA_TOOLKIT_ROOT_DIR=%s' % spec['cuda'].prefix, + '-DCUPTI_DIR=%s' % join_path( + spec['cuda'].prefix + '/extras/CUPTI'), + '-DCUPTI_ROOT=%s' % join_path( + spec['cuda'].prefix + '/extras/CUPTI'), + '-DPAPI_ROOT=%s' % spec['papi'].prefix, + '-DCBTF_DIR=%s' % spec['cbtf'].prefix, + '-DCBTF_KRELL_DIR=%s' % spec['cbtf-krell'].prefix, + '-DBOOST_ROOT=%s' % spec['boost'].prefix, + '-DBoost_DIR=%s' % spec['boost'].prefix, + '-DBOOST_LIBRARYDIR=%s' % spec['boost'].prefix.lib, + '-DMRNET_DIR=%s' % spec['mrnet'].prefix, + '-DBoost_NO_SYSTEM_PATHS=ON']) + + # Add in the standard cmake arguments + cmake_args.extend(std_cmake_args) + + # Adjust the standard cmake arguments to what we want the build + # type, etc to be + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + return(cmake_args) + def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): # Sets build type parameters into cmakeOptions the options that will # enable the cbtf-krell built type settings @@ -94,45 +150,3 @@ def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): cmakeOptions.extend(BuildTypeOptions) - def install(self, spec, prefix): - - # Look for package installation information in the cbtf and cbtf-krell - # prefixes - cmake_prefix_path = join_path( - spec['cbtf'].prefix) + ':' + join_path(spec['cbtf-krell'].prefix) - - with working_dir('build', create=True): - - cmakeOptions = [] - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, - '-DCMAKE_PREFIX_PATH=%s' % cmake_prefix_path, - '-DCUDA_DIR=%s' % spec['cuda'].prefix, - '-DCUDA_INSTALL_PATH=%s' % spec['cuda'].prefix, - '-DCUDA_TOOLKIT_ROOT_DIR=%s' % spec['cuda'].prefix, - '-DCUPTI_DIR=%s' % join_path( - spec['cuda'].prefix + '/extras/CUPTI'), - '-DCUPTI_ROOT=%s' % join_path( - spec['cuda'].prefix + '/extras/CUPTI'), - '-DPAPI_ROOT=%s' % spec['papi'].prefix, - '-DCBTF_DIR=%s' % spec['cbtf'].prefix, - '-DCBTF_KRELL_DIR=%s' % spec['cbtf-krell'].prefix, - '-DBOOST_ROOT=%s' % spec['boost'].prefix, - '-DBoost_DIR=%s' % spec['boost'].prefix, - '-DBOOST_LIBRARYDIR=%s' % spec['boost'].prefix.lib, - '-DMRNET_DIR=%s' % spec['mrnet'].prefix, - '-DBoost_NO_SYSTEM_PATHS=ON']) - - # Add in the standard cmake arguments - cmakeOptions.extend(std_cmake_args) - - # Adjust the standard cmake arguments to what we want the build - # type, etc to be - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - # Invoke cmake - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install") diff --git a/var/spack/repos/builtin/packages/cbtf-krell/package.py b/var/spack/repos/builtin/packages/cbtf-krell/package.py index 6f2f604bd94..182ac5f79d9 100644 --- a/var/spack/repos/builtin/packages/cbtf-krell/package.py +++ b/var/spack/repos/builtin/packages/cbtf-krell/package.py @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. @@ -23,7 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## ########################################################################## -# Copyright (c) 2015-2016 Krell Institute. All Rights Reserved. +# Copyright (c) 2015-2017 Krell Institute. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -104,6 +104,20 @@ class CbtfKrell(CMakePackage): parallel = False + build_directory = 'build_cbtf_krell' + + # We have converted from Package type to CMakePackage type for all the Krell projects. + # Comments from Pull Request (#4765): + # CMakePackage is completely different from the old Package class. Previously, you had + # a single install() phase to override. Now you have 3 phases: cmake(), build(), and install(). + # By default, cmake() runs cmake ... with some common arguments, which you can add to by + # overriding cmake_args(). build() runs make, and install() runs make install. + # So you need to add the appropriate flags to cmake_args() and remove the calls to make. + # See any other CMakePackage for examples. + # CMakePackage is documented: + # http://spack.readthedocs.io/en/latest/spack.build_systems.html?highlight= \ + # CMakePackage#module-spack.build_systems.cmake + def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): # Sets build type parameters into cmakeOptions the options that will # enable the cbtf-krell built type settings @@ -157,7 +171,14 @@ def set_mpi_cmakeOptions(self, spec, cmakeOptions): cmakeOptions.extend(MPIOptions) - def install(self, spec, prefix): + def build_type(self): + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + spec = self.spec # Add in paths for finding package config files that tell us # where to find these packages @@ -166,126 +187,36 @@ def install(self, spec, prefix): # join_path(spec['dyninst'].prefix) # '-DCMAKE_PREFIX_PATH=%s' % cmake_prefix_path - # Build cbtf-krell with cmake - with working_dir('build_cbtf_krell', create=True): - cmakeOptions = [] - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, - '-DCBTF_DIR=%s' % spec['cbtf'].prefix, - '-DBINUTILS_DIR=%s' % spec['binutils'].prefix, - '-DLIBMONITOR_DIR=%s' % spec['libmonitor'].prefix, - '-DLIBUNWIND_DIR=%s' % spec['libunwind'].prefix, - '-DPAPI_DIR=%s' % spec['papi'].prefix, - '-DBOOST_DIR=%s' % spec['boost'].prefix, - '-DMRNET_DIR=%s' % spec['mrnet'].prefix, - '-DDYNINST_DIR=%s' % spec['dyninst'].prefix, - '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix]) + cmake_args = [] + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, + '-DCBTF_DIR=%s' % spec['cbtf'].prefix, + '-DBINUTILS_DIR=%s' % spec['binutils'].prefix, + '-DLIBMONITOR_DIR=%s' % spec['libmonitor'].prefix, + '-DLIBUNWIND_DIR=%s' % spec['libunwind'].prefix, + '-DPAPI_DIR=%s' % spec['papi'].prefix, + '-DBOOST_DIR=%s' % spec['boost'].prefix, + '-DMRNET_DIR=%s' % spec['mrnet'].prefix, + '-DDYNINST_DIR=%s' % spec['dyninst'].prefix, + '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix]) - # Add any MPI implementations coming from variant settings - self.set_mpi_cmakeOptions(spec, cmakeOptions) + # Add any MPI implementations coming from variant settings + self.set_mpi_cmakeOptions(spec, cmake_args) - # Add in the standard cmake arguments - cmakeOptions.extend(std_cmake_args) + # Add in the standard cmake arguments + cmake_args.extend(std_cmake_args) - # Adjust the standard cmake arguments to what we want the build - # type, etc to be - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) + # Adjust the standard cmake arguments to what we want the build + # type, etc to be + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) - # Invoke cmake - cmake('..', *cmakeOptions) + return cmake_args - make("clean") - make() - make("install") +# def cmake(self, spec, prefix): +# cmake('..', *cmake_args) - # if '+cray' in spec: - # if 'cray' in self.spec.architecture: - # if '+runtime' in spec: - # with working_dir('build_cbtf_cray_runtime', create=True): - # python_vers='%d.%d' % spec['python'].version[:2] - # cmake .. \ - # -DCMAKE_BUILD_TYPE=Debug \ - # -DTARGET_OS="cray" \ - # -DRUNTIME_ONLY="true" \ - # -DCMAKE_INSTALL_PREFIX=${CBTF_KRELL_PREFIX} \ - # -DCMAKE_PREFIX_PATH=${CBTF_ROOT} \ - # -DCBTF_DIR=${CBTF_ROOT} \ - # -DBOOST_ROOT=${BOOST_INSTALL_PREFIX} \ - # -DXERCESC_DIR=${XERCESC_INSTALL_PREFIX} \ - # -DBINUTILS_DIR=${KRELL_ROOT} \ - # -DLIBMONITOR_DIR=${KRELL_ROOT_COMPUTE} \ - # -DLIBUNWIND_DIR=${KRELL_ROOT_COMPUTE} \ - # -DPAPI_DIR=${PAPI_ROOT} \ - # -DDYNINST_DIR=${DYNINST_CN_ROOT} \ - # -DMRNET_DIR=${MRNET_INSTALL_PREFIX} \ - # -DMPICH2_DIR=/opt/cray/mpt/7.0.1/gni/mpich2-gnu/48 - # else: - # with working_dir('build_cbtf_cray_frontend', create=True): - # python_vers='%d.%d' % spec['python'].version[:2] - # cmake .. \ - # -DCMAKE_BUILD_TYPE=Debug \ - # -DCMAKE_INSTALL_PREFIX=${CBTF_KRELL_PREFIX} \ - # -DCMAKE_PREFIX_PATH=${CBTF_ROOT} \ - # -DCBTF_DIR=${CBTF_ROOT} \ - # -DRUNTIME_TARGET_OS="cray" \ - # -DCBTF_KRELL_CN_RUNTIME_DIR=${CBTF_KRELL_CN_RUNTIME_ROOT} \ - # -DCBTF_CN_RUNTIME_DIR=${CBTF_CN_RUNTIME_ROOT} \ - # -DLIBMONITOR_CN_RUNTIME_DIR=${LIBMONITOR_CN_ROOT} \ - # -DLIBUNWIND_CN_RUNTIME_DIR=${LIBUNWIND_CN_ROOT} \ - # -DPAPI_CN_RUNTIME_DIR=${PAPI_CN_ROOT} \ - # -DXERCESC_CN_RUNTIME_DIR=/${XERCESC_CN_ROOT} \ - # -DMRNET_CN_RUNTIME_DIR=${MRNET_CN_ROOT} \ - # -DBOOST_CN_RUNTIME_DIR=${BOOST_CN_ROOT} \ - # -DDYNINST_CN_RUNTIME_DIR=${DYNINST_CN_ROOT} \ - # -DBOOST_ROOT=/${KRELL_ROOT} \ - # -DXERCESC_DIR=/${KRELL_ROOT} \ - # -DBINUTILS_DIR=/${KRELL_ROOT} \ - # -DLIBMONITOR_DIR=${KRELL_ROOT} \ - # -DLIBUNWIND_DIR=${KRELL_ROOT} \ - # -DPAPI_DIR=${PAPI_ROOT} \ - # -DDYNINST_DIR=${KRELL_ROOT} \ - # -DMRNET_DIR=${KRELL_ROOT} \ - # -DMPICH2_DIR=/opt/cray/mpt/7.0.1/gni/mpich2-gnu/48 - # fi -# -# make("clean") -# make() -# make("install") -# -# elif '+mic' in spec: -# if '+runtime' in spec: -# with working_dir('build_cbtf_mic_runtime', create=True): -# python_vers='%d.%d' % spec['python'].version[:2] -# cmake .. \ -# -# else: -# with working_dir('build_cbtf_cray_frontend', create=True): -# python_vers='%d.%d' % spec['python'].version[:2] -# cmake .. \ -# fi -# -# else: -# # Build cbtf-krell with cmake -# with working_dir('build_cbtf_krell', create=True): -# cmake('..', -# '-DCMAKE_BUILD_TYPE=Debug', -# '-DCMAKE_INSTALL_PREFIX=%s' % prefix, -# '-DCBTF_DIR=%s' % spec['cbtf'].prefix, -# '-DBINUTILS_DIR=%s' % spec['binutils'].prefix, -# '-DLIBMONITOR_DIR=%s' % spec['libmonitor'].prefix, -# '-DLIBUNWIND_DIR=%s'% spec['libunwind'].prefix, -# '-DPAPI_DIR=%s' % spec['papi'].prefix, -# '-DBOOST_DIR=%s' % spec['boost'].prefix, -# '-DMRNET_DIR=%s' % spec['mrnet'].prefix, -# '-DDYNINST_DIR=%s' % spec['dyninst'].prefix, -# '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, -# '-DOPENMPI_DIR=%s' % openmpi_prefix_path, -# '-DCMAKE_PREFIX_PATH=%s' % cmake_prefix_path, -# *std_cmake_args) -# -# make("clean") -# make() -# make("install") -# -# fi -# +# def build(self, spec, prefix): +# make(parallel=False) + +# def install(self, spec, prefix): +# # Install cbtf-krell diff --git a/var/spack/repos/builtin/packages/cbtf-lanl/package.py b/var/spack/repos/builtin/packages/cbtf-lanl/package.py index 74ea448c1b3..033e56d3bdb 100644 --- a/var/spack/repos/builtin/packages/cbtf-lanl/package.py +++ b/var/spack/repos/builtin/packages/cbtf-lanl/package.py @@ -64,6 +64,54 @@ class CbtfLanl(CMakePackage): parallel = False + build_directory = 'build_cbtf_lanl' + + # We have converted from Package type to CMakePackage type for all the Krell projects. + # Comments from Pull Request (#4765): + # CMakePackage is completely different from the old Package class. Previously, you had + # a single install() phase to override. Now you have 3 phases: cmake(), build(), and install(). + # By default, cmake() runs cmake ... with some common arguments, which you can add to by + # overriding cmake_args(). build() runs make, and install() runs make install. + # So you need to add the appropriate flags to cmake_args() and remove the calls to make. + # See any other CMakePackage for examples. + # CMakePackage is documented: + # http://spack.readthedocs.io/en/latest/spack.build_systems.html?highlight= \ + # CMakePackage#module-spack.build_systems.cmake + + def build_type(self): + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + + spec = self.spec + + # Add in paths for finding package config files that tell us where to + # find these packages + cmake_prefix_path = join_path( + spec['cbtf'].prefix) + ':' + join_path(spec['cbtf-krell'].prefix) + + cmake_args = [] + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, + '-DCBTF_DIR=%s' % spec['cbtf'].prefix, + '-DCBTF_KRELL_DIR=%s' % spec['cbtf-krell'].prefix, + '-DMRNET_DIR=%s' % spec['mrnet'].prefix, + '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, + '-DCMAKE_PREFIX_PATH=%s' % cmake_prefix_path, + '-DCMAKE_MODULE_PATH=%s' % join_path( + prefix.share, 'KrellInstitute', 'cmake')]) + + # Add in the standard cmake arguments + cmake_args.extend(std_cmake_args) + + # Adjust the standard cmake arguments to what we want the build + # type, etc to be + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + return(cmake_args) + def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): # Sets build type parameters into cmakeOptions the options that will # enable the cbtf-krell built type settings @@ -90,35 +138,3 @@ def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): cmakeOptions.extend(BuildTypeOptions) - def install(self, spec, prefix): - - # Add in paths for finding package config files that tell us where to - # find these packages - cmake_prefix_path = join_path( - spec['cbtf'].prefix) + ':' + join_path(spec['cbtf-krell'].prefix) - - with working_dir('build', create=True): - cmakeOptions = [] - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, - '-DCBTF_DIR=%s' % spec['cbtf'].prefix, - '-DCBTF_KRELL_DIR=%s' % spec['cbtf-krell'].prefix, - '-DMRNET_DIR=%s' % spec['mrnet'].prefix, - '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, - '-DCMAKE_PREFIX_PATH=%s' % cmake_prefix_path, - '-DCMAKE_MODULE_PATH=%s' % join_path( - prefix.share, 'KrellInstitute', 'cmake')]) - - # Add in the standard cmake arguments - cmakeOptions.extend(std_cmake_args) - - # Adjust the standard cmake arguments to what we want the build - # type, etc to be - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - # Invoke cmake - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install") diff --git a/var/spack/repos/builtin/packages/cbtf/package.py b/var/spack/repos/builtin/packages/cbtf/package.py index 0446acea532..c8adc55416b 100644 --- a/var/spack/repos/builtin/packages/cbtf/package.py +++ b/var/spack/repos/builtin/packages/cbtf/package.py @@ -23,7 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## ########################################################################## -# Copyright (c) 2015-2016 Krell Institute. All Rights Reserved. +# Copyright (c) 2015-2017 Krell Institute. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -72,6 +72,76 @@ class Cbtf(CMakePackage): parallel = False + build_directory = 'build_cbtf' + + # We have converted from Package type to CMakePackage type for all the Krell projects. + # Comments from Pull Request (#4765): + # CMakePackage is completely different from the old Package class. Previously, you had + # a single install() phase to override. Now you have 3 phases: cmake(), build(), and install(). + # By default, cmake() runs cmake ... with some common arguments, which you can add to by + # overriding cmake_args(). build() runs make, and install() runs make install. + # So you need to add the appropriate flags to cmake_args() and remove the calls to make. + # See any other CMakePackage for examples. + # CMakePackage is documented: + # http://spack.readthedocs.io/en/latest/spack.build_systems.html?highlight= \ + # CMakePackage#module-spack.build_systems.cmake + + def build_type(self): + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + + spec = self.spec + + # Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching + # in system paths (or other locations outside of BOOST_ROOT + # or BOOST_INCLUDEDIR). Useful when specifying BOOST_ROOT. + # Defaults to OFF. + + if '+runtime' in spec: + # Install message tag include file for use in Intel MIC + # cbtf-krell build + # FIXME + cmake_args = [] + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, + '-DBoost_NO_SYSTEM_PATHS=TRUE', + '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, + '-DBOOST_ROOT=%s' % spec['boost'].prefix, + '-DMRNET_DIR=%s' % spec['mrnet'].prefix, + '-DCMAKE_MODULE_PATH=%s' % join_path( + prefix.share, 'KrellInstitute', 'cmake')]) + + # Add in the standard cmake arguments + cmake_args.extend(std_cmake_args) + + # Adjust the standard cmake arguments to what we want the build + # type, etc to be + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + + else: + cmake_args = [] + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, + '-DBoost_NO_SYSTEM_PATHS=TRUE', + '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, + '-DBOOST_ROOT=%s' % spec['boost'].prefix, + '-DMRNET_DIR=%s' % spec['mrnet'].prefix, + '-DCMAKE_MODULE_PATH=%s' % join_path( + prefix.share, 'KrellInstitute', 'cmake')]) + + # Add in the standard cmake arguments + cmake_args.extend(std_cmake_args) + + # Adjust the standard cmake arguments to what we want the build + # type, etc to be + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + + return(cmake_args) + def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): # Sets build type parameters into cmakeOptions the options that will # enable the cbtf-krell built type settings @@ -95,59 +165,11 @@ def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): cmakeOptions.extend(BuildTypeOptions) - def install(self, spec, prefix): - with working_dir('build', create=True): - - # Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching - # in system paths (or other locations outside of BOOST_ROOT - # or BOOST_INCLUDEDIR). Useful when specifying BOOST_ROOT. - # Defaults to OFF. - - if '+runtime' in spec: - # Install message tag include file for use in Intel MIC - # cbtf-krell build - # FIXME - cmakeOptions = [] - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, - '-DBoost_NO_SYSTEM_PATHS=TRUE', - '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, - '-DBOOST_ROOT=%s' % spec['boost'].prefix, - '-DMRNET_DIR=%s' % spec['mrnet'].prefix, - '-DCMAKE_MODULE_PATH=%s' % join_path( - prefix.share, 'KrellInstitute', 'cmake')]) - - # Add in the standard cmake arguments - cmakeOptions.extend(std_cmake_args) - - # Adjust the standard cmake arguments to what we want the build - # type, etc to be - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - # Invoke cmake - cmake('..', *cmakeOptions) - - else: - cmakeOptions = [] - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' % prefix, - '-DBoost_NO_SYSTEM_PATHS=TRUE', - '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix, - '-DBOOST_ROOT=%s' % spec['boost'].prefix, - '-DMRNET_DIR=%s' % spec['mrnet'].prefix, - '-DCMAKE_MODULE_PATH=%s' % join_path( - prefix.share, 'KrellInstitute', 'cmake')]) - - # Add in the standard cmake arguments - cmakeOptions.extend(std_cmake_args) - - # Adjust the standard cmake arguments to what we want the build - # type, etc to be - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - # Invoke cmake - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install") +# def install(self, spec, prefix): +# +# # Invoke cmake +# cmake('..', *cmakeOptions) +# +# make("clean") +# make() +# make("install") diff --git a/var/spack/repos/builtin/packages/openspeedshop/package.py b/var/spack/repos/builtin/packages/openspeedshop/package.py index 97d6d9fa851..96809064162 100644 --- a/var/spack/repos/builtin/packages/openspeedshop/package.py +++ b/var/spack/repos/builtin/packages/openspeedshop/package.py @@ -70,8 +70,6 @@ class Openspeedshop(CMakePackage): # url = "file:/home/jeg/OpenSpeedShop_ROOT/SOURCES/openspeedshop-2.3.tar.gz" # version('2.3', '517a7798507241ad8abd8b0626a4d2cf') - parallel = False - variant('offline', default=False, description="build with offline instrumentor enabled.") variant('cbtf', default=True, @@ -140,6 +138,160 @@ class Openspeedshop(CMakePackage): depends_on("cbtf-argonavis", when='+cbtf+cuda') depends_on("mrnet@5.0.1:+lwthreads", when='+cbtf') + parallel = False + + build_directory = 'build_openspeedshop' + + # We have converted from Package type to CMakePackage type for all the Krell projects. + # Comments from Pull Request (#4765): + # CMakePackage is completely different from the old Package class. Previously, you had + # a single install() phase to override. Now you have 3 phases: cmake(), build(), and install(). + # By default, cmake() runs cmake ... with some common arguments, which you can add to by + # overriding cmake_args(). build() runs make, and install() runs make install. + # So you need to add the appropriate flags to cmake_args() and remove the calls to make. + # See any other CMakePackage for examples. + # CMakePackage is documented: + # http://spack.readthedocs.io/en/latest/spack.build_systems.html?highlight= \ + # CMakePackage#module-spack.build_systems.cmake + + def build_type(self): + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + spec = self.spec + + if '+offline' in spec: + instrumentor_setting = "offline" + if '+runtime' in spec: + + cmake_args = [] + cmake_args.extend([ + '-DCMAKE_INSTALL_PREFIX=%s' % prefix, + '-DINSTRUMENTOR=%s' % instrumentor_setting, + '-DLIBMONITOR_DIR=%s' % spec['libmonitor'].prefix, + '-DLIBUNWIND_DIR=%s' % spec['libunwind'].prefix, + '-DPAPI_DIR=%s' % spec['papi'].prefix]) + + # Add any MPI implementations coming from variant settings + self.set_mpi_cmakeOptions(spec, cmake_args) + cmake_args.extend(std_cmake_args) + + # Adjust the build options to the favored + # ones for this build + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + + else: + cmake_prefix_path = join_path(spec['dyninst'].prefix) + cmake_args = [] + + # Appends base options to cmake_args + self.set_defaultbase_cmakeOptions(spec, cmake_args) + + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' + % prefix, + '-DCMAKE_PREFIX_PATH=%s' + % cmake_prefix_path, + '-DINSTRUMENTOR=%s' + % instrumentor_setting, + '-DLIBMONITOR_DIR=%s' + % spec['libmonitor'].prefix, + '-DLIBUNWIND_DIR=%s' + % spec['libunwind'].prefix, + '-DPAPI_DIR=%s' + % spec['papi'].prefix, + '-DSQLITE3_DIR=%s' + % spec['sqlite'].prefix, + '-DQTLIB_DIR=%s' + % spec['qt'].prefix]) + + # Add any MPI implementations coming from variant settings + self.set_mpi_cmakeOptions(spec, cmake_args) + cmake_args.extend(std_cmake_args) + + # Adjust the build options to the favored + # ones for this build + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + + elif '+cbtf' in spec: + instrumentor_setting = "cbtf" + # resolve_symbols = "symtabapi" + cmake_prefix_path = join_path(spec['cbtf'].prefix) \ + + ':' + join_path(spec['cbtf-krell'].prefix)\ + + ':' + join_path(spec['dyninst'].prefix) + + if '+runtime' in spec: + + # Appends base options to cmake_args + self.set_defaultbase_cmakeOptions(spec, cmake_args) + + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' + % prefix, + '-DCMAKE_PREFIX_PATH=%s' + % cmake_prefix_path, + '-DINSTRUMENTOR=%s' + % instrumentor_setting, + '-DCBTF_DIR=%s' + % spec['cbtf'].prefix, + '-DCBTF_KRELL_DIR=%s' + % spec['cbtf-krell'].prefix, + '-DMRNET_DIR=%s' + % spec['mrnet'].prefix]) + + # Adjust the build options to the + # favored ones for this build + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + + else: + cmake_args = [] + + # Appends base options to cmake_args + self.set_defaultbase_cmakeOptions(spec, cmake_args) + + if '+noqt3gui' in self.spec: + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' + % prefix, + '-DCMAKE_PREFIX_PATH=%s' + % cmake_prefix_path, + '-DINSTRUMENTOR=%s' + % instrumentor_setting, + '-DSQLITE3_DIR=%s' + % spec['sqlite'].prefix, + '-DCBTF_DIR=%s' + % spec['cbtf'].prefix, + '-DCBTF_KRELL_DIR=%s' + % spec['cbtf-krell'].prefix, + '-DMRNET_DIR=%s' + % spec['mrnet'].prefix]) + else: + cmake_args.extend( + ['-DCMAKE_INSTALL_PREFIX=%s' + % prefix, + '-DCMAKE_PREFIX_PATH=%s' + % cmake_prefix_path, + '-DINSTRUMENTOR=%s' + % instrumentor_setting, + '-DSQLITE3_DIR=%s' + % spec['sqlite'].prefix, + '-DCBTF_DIR=%s' + % spec['cbtf'].prefix, + '-DCBTF_KRELL_DIR=%s' + % spec['cbtf-krell'].prefix, + '-DQTLIB_DIR=%s' + % spec['qt'].prefix, + '-DMRNET_DIR=%s' + % spec['mrnet'].prefix]) + + # Adjust the build options to the favored + # ones for this build + self.adjustBuildTypeParams_cmakeOptions(spec, cmake_args) + return(cmake_args) + def adjustBuildTypeParams_cmakeOptions(self, spec, cmakeOptions): # Sets build type parameters into cmakeOptions the # options that will enable the cbtf-krell built type settings @@ -272,160 +424,3 @@ def setup_environment(self, spack_env, run_env): if '+openmpi' in self.spec: run_env.set('OPENSS_MPI_IMPLEMENTATION', 'openmpi') - def install(self, spec, prefix): - - if '+offline' in spec: - instrumentor_setting = "offline" - if '+runtime' in spec: - with working_dir('build_runtime', create=True): - - cmakeOptions = [] - cmakeOptions.extend([ - '-DCMAKE_INSTALL_PREFIX=%s' % prefix, - '-DINSTRUMENTOR=%s' % instrumentor_setting, - '-DLIBMONITOR_DIR=%s' % spec['libmonitor'].prefix, - '-DLIBUNWIND_DIR=%s' % spec['libunwind'].prefix, - '-DPAPI_DIR=%s' % spec['papi'].prefix]) - - # Add any MPI implementations coming from variant settings - self.set_mpi_cmakeOptions(spec, cmakeOptions) - cmakeOptions.extend(std_cmake_args) - - # Adjust the build options to the favored - # ones for this build - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install") - else: - cmake_prefix_path = join_path(spec['dyninst'].prefix) - with working_dir('build', create=True): - cmakeOptions = [] - - # Appends base options to cmakeOptions - self.set_defaultbase_cmakeOptions(spec, cmakeOptions) - - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' - % prefix, - '-DCMAKE_PREFIX_PATH=%s' - % cmake_prefix_path, - '-DINSTRUMENTOR=%s' - % instrumentor_setting, - '-DLIBMONITOR_DIR=%s' - % spec['libmonitor'].prefix, - '-DLIBUNWIND_DIR=%s' - % spec['libunwind'].prefix, - '-DPAPI_DIR=%s' - % spec['papi'].prefix, - '-DSQLITE3_DIR=%s' - % spec['sqlite'].prefix, - '-DQTLIB_DIR=%s' - % spec['qt'].prefix]) - - # Add any MPI implementations coming from variant settings - self.set_mpi_cmakeOptions(spec, cmakeOptions) - cmakeOptions.extend(std_cmake_args) - - # Adjust the build options to the favored - # ones for this build - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install") - - elif '+cbtf' in spec: - instrumentor_setting = "cbtf" - # resolve_symbols = "symtabapi" - cmake_prefix_path = join_path(spec['cbtf'].prefix) \ - + ':' + join_path(spec['cbtf-krell'].prefix)\ - + ':' + join_path(spec['dyninst'].prefix) - - if '+runtime' in spec: - with working_dir('build_cbtf_runtime', create=True): - cmakeOptions = [] - - # Appends base options to cmakeOptions - self.set_defaultbase_cmakeOptions(spec, cmakeOptions) - - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' - % prefix, - '-DCMAKE_PREFIX_PATH=%s' - % cmake_prefix_path, - '-DINSTRUMENTOR=%s' - % instrumentor_setting, - '-DCBTF_DIR=%s' - % spec['cbtf'].prefix, - '-DCBTF_KRELL_DIR=%s' - % spec['cbtf-krell'].prefix, - '-DMRNET_DIR=%s' - % spec['mrnet'].prefix]) - - # Adjust the build options to the - # favored ones for this build - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install") - - else: - with working_dir('build_cbtf', create=True): - cmakeOptions = [] - - # Appends base options to cmakeOptions - self.set_defaultbase_cmakeOptions(spec, cmakeOptions) - - if '+noqt3gui' in self.spec: - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' - % prefix, - '-DCMAKE_PREFIX_PATH=%s' - % cmake_prefix_path, - '-DINSTRUMENTOR=%s' - % instrumentor_setting, - '-DSQLITE3_DIR=%s' - % spec['sqlite'].prefix, - '-DCBTF_DIR=%s' - % spec['cbtf'].prefix, - '-DCBTF_KRELL_DIR=%s' - % spec['cbtf-krell'].prefix, - '-DMRNET_DIR=%s' - % spec['mrnet'].prefix]) - else: - cmakeOptions.extend( - ['-DCMAKE_INSTALL_PREFIX=%s' - % prefix, - '-DCMAKE_PREFIX_PATH=%s' - % cmake_prefix_path, - '-DINSTRUMENTOR=%s' - % instrumentor_setting, - '-DSQLITE3_DIR=%s' - % spec['sqlite'].prefix, - '-DCBTF_DIR=%s' - % spec['cbtf'].prefix, - '-DCBTF_KRELL_DIR=%s' - % spec['cbtf-krell'].prefix, - '-DQTLIB_DIR=%s' - % spec['qt'].prefix, - '-DMRNET_DIR=%s' - % spec['mrnet'].prefix]) - - # Adjust the build options to the favored - # ones for this build - self.adjustBuildTypeParams_cmakeOptions(spec, cmakeOptions) - - cmake('..', *cmakeOptions) - - make("clean") - make() - make("install")