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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# Copyright 2013-2022 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 *
class Bricks(CMakePackage):
"""Bricks is a data layout and code generation framework,
enabling performance-portable stencil computations across
a multitude of architectures."""
# url for your package's homepage here.
homepage = "https://bricks.run/"
git = 'https://github.com/CtopCsUtahEdu/bricklib.git'
test_requires_compiler = True
# List of GitHub accounts to notify when the package is updated.
maintainers = ['ztuowen', 'drhansj']
version('r0.1', branch='r0.1')
variant('cuda', default=False, description='Build bricks with CUDA enabled')
# Building a variant of cmake without openssl is to match how the
# ECP E4S project builds cmake in their e4s-base-cuda Docker image
depends_on('cmake', type='build')
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('opencl-clhpp', when='+cuda')
depends_on('cuda', when='+cuda')
depends_on('mpi')
def cmake_args(self):
"""CMake arguments for configure stage"""
args = []
return args
def flag_handler(self, name, flags):
"""Set build flags as needed"""
if name in ['cflags', 'cxxflags', 'cppflags']:
# There are many vector instrinsics used in this package. If
# the package is built on a native architecture, then it likely
# will not run (illegal instruction fault) on a less feature-
# rich architecture.
# If you intend to use this package in an architecturally-
# heterogeneous environment, then the package should be build
# with "target=x86_64". This will ensure that all Intel
# architectures can use the libraries and tests in this
# project by forceing the AVX2 flag in gcc.
if name == 'cxxflags' and self.spec.target == 'x86_64':
flags.append('-mavx2')
return (None, flags, None)
return(flags, None, None)
@run_after('install')
def copy_test_sources(self):
"""Files to copy into test cache"""
srcs = [join_path('examples', 'external', 'CMakeLists.txt'),
join_path('examples', 'external', 'main.cpp'),
join_path('examples', 'external', '7pt.py')]
self.cache_extra_test_sources(srcs)
def test(self):
"""Test bricklib package"""
# Test prebuilt binary
source_dir = join_path(self.test_suite.current_test_cache_dir,
'examples', 'external')
self.run_test(exe='cmake',
options=['.'],
purpose='Configure bricklib example',
work_dir=source_dir)
self.run_test(exe='cmake',
options=['--build', '.'],
purpose='Build bricklib example',
work_dir=source_dir)
self.run_test(exe=join_path(source_dir, 'example'),
options=[],
purpose='Execute bricklib example',
work_dir=source_dir)
|