-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.py
More file actions
61 lines (50 loc) · 2.42 KB
/
package.py
File metadata and controls
61 lines (50 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class GpgpuSim(MakefilePackage):
homepage = "https://github.com/gpgpu-sim/gpgpu-sim_distribution"
git = homepage + ".git"
version('4.0.1',branch='master')
# url = "https://github.com/gpgpu-sim/gpgpu-sim_distribution/archive/refs/tags/v4.0.1.tar.gz"
# version('4.0.1', tag='v4.0.1')
# version(
# '4.0.1', sha256='9c7d6e42af507dc7d7572cfe0d5179fa41b90bf3299522e438034a1aaad06f81')
depends_on('makedepend', type=('build'))
depends_on('sed', type=('build'))
depends_on('bison', type=('build'))
depends_on('flex', type=('build'))
depends_on('zlib', type=('link'))
depends_on('cuda', type=('build', 'link', 'run'))
depends_on('gl', type=('link'))
conflicts("%"+"gcc@8:")
def edit(self, spec, prefix):
# fix <https://github.com/gpgpu-sim/gpgpu-sim_distribution/issues/221>
cuda_sim_Makefile = FileFilter('src/cuda-sim/Makefile')
cuda_sim_Makefile.filter(
'> \$\(OUTPUT_DIR\)/ptx_parser_decode\.def',
' | sed \'s/"end of file"/end of file/\' ' +
' | sed \'s/"invalid token"/invalid token/\' ' +
'> $(OUTPUT_DIR)/ptx_parser_decode.def')
for mf in ['setup_environment']+glob.glob("**/*akefile", recursive=True)+glob.glob("**/*.mk", recursive=True):
print(mf, flush=True)
m = FileFilter(mf)
m.filter('gcc-\$\(CC_VERSION\)/cuda-\$\(CUDART_VERSION\)/', '')
m.filter('gcc-\$CC_VERSION/cuda-\$CUDA_VERSION_NUMBER/', '')
m.filter('gcc', 'cc')
m.filter('g\+\+', 'c++')
m.filter('CC_VERSION.*', '')
def install(self, spec, prefix):
mkdirp(join_path(prefix, 'gpgpu-sim_distribution'))
install_tree(self.stage.source_path, join_path(
prefix, 'gpgpu-sim_distribution'))
def setup_build_environment(self, env):
env.set('CUDA_INSTALL_PATH', self.spec['cuda'].prefix)
env.set('GPGPUSIM_ROOT', self.stage.source_path)
env.set('GPGPUSIM_POWER_MODEL',
self.stage.source_path+'/src/gpuwattch/')
env.set('GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN', '1')
def setup_run_environment(self, env):
env.set('CUDA_INSTALL_PATH', self.spec['cuda'].prefix)