spack/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py

78 lines
3.6 KiB
Python
Raw Normal View History

# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class HsaRocrDev(CMakePackage):
"""This repository includes the user mode API nterfaces and libraries
necessary for host applications to launch computer kernels to available
HSA ROCm kernel agents.AMD Heterogeneous System Architecture HSA -
Linux HSA Runtime for Boltzmann (ROCm) platforms."""
homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime"
git = "https://github.com/RadeonOpenCompute/ROCR-Runtime.git"
url = "https://github.com/RadeonOpenCompute/ROCR-Runtime/archive/rocm-4.1.0.tar.gz"
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
maintainers = ['srekolam', 'arjun-raj-kuppala', 'haampie']
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
version('master', branch='master')
version('4.3.0', sha256='2a08657a517971447fc233cb2c8ee2e117c6ab5efc31af147b28b3ef59b3847d')
version('4.2.0', sha256='fa0e7bcd64e97cbff7c39c9e87c84a49d2184dc977b341794770805ec3f896cc')
version('4.1.0', sha256='c223a5f7ccac280520abb6ea49fdd36fa9468718098a9d984be6ef839ccbc6db')
version('4.0.0', sha256='e84c48e80ea38698a5bd5da3940048ad3cab3696d10a53132acad07ca357f17c')
version('3.10.0', sha256='58866d8acdb6cc45227f2412098e37c65908b20ed3dd54901dfb515c15ad5f71')
version('3.9.0', sha256='d722fb61f62037894957856f2c2d17231c4622bdf75db372321ee30206dceeb6')
version('3.8.0', sha256='1dfad4d89d6c099e15073ed38e083bcf6cc463470dcc8a1e1b9e22060c060c72')
version('3.7.0', sha256='0071d14431f73ce74574e61d0786f2b7cf34b14ea898a1f54b6e1b06b2d468c0')
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
version('3.5.0', sha256='52c12eec3e3404c0749c70f156229786ee0c3e6d3c979aed9bbaea500fa1f3b8')
variant('build_type', default='Release', values=("Release", "Debug"), description='CMake build type')
variant('shared', default=True, description='Build shared or static library')
variant('image', default=True, description='build with or without image support')
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
depends_on('cmake@3:', type="build")
# Note, technically only necessary when='@3.7: +image', but added to all
# to work around https://github.com/spack/spack/issues/23951
depends_on('xxd', when='+image', type='build')
depends_on('libelf@0.8:', type='link')
for ver in ['3.5.0', '3.7.0', '3.8.0', '3.9.0', '3.10.0', '4.0.0', '4.1.0',
'4.2.0', '4.3.0', 'master']:
depends_on('hsakmt-roct@' + ver, when='@' + ver)
depends_on('llvm-amdgpu@' + ver, when='@' + ver)
# allow standalone rocm-device-libs (useful for aomp)
depends_on('rocm-device-libs@' + ver, when='@{0} ^llvm-amdgpu ~rocm-device-libs'.format(ver))
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
# Both 3.5.0 and 3.7.0 force INSTALL_RPATH in different ways
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
patch('0001-Do-not-set-an-explicit-rpath-by-default-since-packag.patch', when='@3.5.0')
patch('0002-Remove-explicit-RPATH-again.patch', when='@3.7.0:')
Spack recipes for ROCm software components-Phase1 (#17422) * Spack recipes for ROCm Stage 1 Build components * fix flake8 errors * fixes for flake8 errors * Add a patch for cmake 3.x suport * Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack * Remove inherited cmake args from comgr * Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency * Remove redundant cmake args which is inherited * Fix some dependencies * Fix some python 2.x compatibilities * Add amd gpu targets to rocfft * Make comgr a link dep of rocm-dbgapi and remove redundant cmake args * Remove redundant cmake args * Remove more redundant cmake args * Final redundant args * Use cmake 3.x instead of a fixed version * Remove random variable * Use installed rocclr instead of nonexisting directory * Don't build outside the staging folder * Deploy some missing cmake target file * Formatting * Fix target list * Properly handle the rocclr dependency * Formatting * Fix vermin test * Make all 3.5.0 package depend exactly on eachother * Add a few missing link dependencies * Fix flake8 * Remove some other redundant flags * Add gcc install prefix for gcc builds of llvm-amdgpu * review changes for the spack recipes * Do not hard-code versions * Fix atmi install - no more relative rpaths outside of install directory (required patch) - fix build -> link dependencies - remove unused build dependency * Fix flake8 errors * Remove unused variable and make things python 2.x compatible * Fix flake8 * Move compiler config from rocfft -> hipcc * Remove redundant dependency on fftw-api * Remove redundant import * Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables * Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu * Fix perl shebang and add dep * Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files * fixing build failure due z3 and adding zlib for rocgdb * new changes to add z3,curses dependency for llvm-amdgpu * fix flake8 error Co-authored-by: root <root@localhost.localdomain> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-13 08:36:35 +08:00
root_cmakelists_dir = 'src'
def cmake_args(self):
spec = self.spec
libelf_include = spec['libelf'].prefix.include.libelf
args = [
self.define('LIBELF_INCLUDE_DIRS', libelf_include),
self.define_from_variant('BUILD_SHARED_LIBS', 'shared')
]
if '@3.7.0:' in spec:
args.append(self.define_from_variant('IMAGE_SUPPORT', 'image'))
# device libs is bundled with llvm-amdgpu (default) or standalone
if '^rocm-device-libs' in spec:
bitcode_dir = spec['rocm-device-libs'].prefix.amdgcn.bitcode
else:
bitcode_dir = spec['llvm-amdgpu'].prefix.amdgcn.bitcode
args.append(self.define('BITCODE_DIR', bitcode_dir))
return args