-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
meta.yaml
214 lines (199 loc) · 7.65 KB
/
meta.yaml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
{% set version = "2022.0.0" %}
{% set vmajor = version.split('.')[0]|int %}
{% set vminor = version.split('.')[1]|int %}
{% set vpatch = version.split('.')[2]|int %}
{% set vbinary = vmajor - 2009 %}
{% set vtag = "v" ~ version.replace(".rc", "-rc") %}
# Official patch version for the first release of 2021 is 1,
# but internal patch version is 0, handle it for interface version.
{% set vinterface = "%d" % (vbinary * 1000 + vminor * 10 + (vpatch if vmajor != 2021 or vminor != 1 else 0)) %}
# Libraries on Windows are expected to be installed into LIBRARY_PREFIX.
# tbb4py files should be installed into PREFIX.
# See https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html.
# On non-Windows CMAKE_ARGS already contains CMAKE_INSTALL_PREFIX.
# CMAKE_PREFIX_PATH is needed to discover libhwloc with PkgConfig.
{% if win %}
{% set cmake_args = "%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%" %}
{% set cmake_tbb4py_args = "%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%PREFIX%" %}
{% else %}
{% set cmake_args = "$CMAKE_ARGS" %}
{% set cmake_tbb4py_args = "$CMAKE_ARGS" %}
{% endif %}
# Use specific test list agreed with TBB team to cover core functionality on high level.
# Execution of all tests is too heavy task for packaging CI.
# test_malloc_compliance is temporary excluded from the list since it causes failures that likely appear due to test implementation or env misconfiguration.
# oneTBB issue: https://github.com/oneapi-src/oneTBB/issues/700
# Agreed with oneTBB developers that it is suitable approach since the product is fully tested on oneTBB side.
{% set tests = "test_parallel_for test_tbb_header conformance_version test_flow_graph test_arena_constraints" %}
{% set ctest_regex = "^(%s)$" % (tests.replace(' ', '|')) %}
{% set tbb4py_build_dir = "build_$PKG_HASH" %} # [not win]
{% set tbb4py_build_dir = "build_%PKG_HASH%" %} # [win]
package:
name: tbb
version: {{ version }}
source:
url: https://github.com/oneapi-src/oneTBB/archive/refs/tags/{{ vtag }}.tar.gz
sha256: e8e89c9c345415b17b30a2db3095ba9d47647611662073f7fbf54ad48b7f3c2a
patches:
- patches/0010-fix-build-gcc-13.3.patch
build:
number: 0
requirements:
build:
- python *
- {{ compiler('cxx') }}
- {{ stdlib("c") }}
- ninja # [win]
- make # [not win]
- cmake
- pkg-config
host:
- libhwloc >=2.5
outputs:
- name: tbb
about:
summary: TBB Libraries
license_file:
- LICENSE.txt
- third-party-programs.txt
build:
script:
- set CMAKE_GENERATOR=Ninja # [win]
# unset option that ninja complains about
- set CMAKE_GENERATOR_TOOLSET= # [win]
- set CMAKE_GENERATOR_PLATFORM= # [win]
- cmake {{ cmake_args }} -DTBB_TEST=OFF -S . -B build
- cmake --build build --parallel
- cmake -DCOMPONENT=runtime -P build/cmake_install.cmake
requirements:
host:
- libhwloc >=2.5
test:
requires:
# any python version is ok for sake of testing of shared libraries
- python *
commands:
{% set libname = "libtbb.so." ~ vbinary ~ "." ~ vminor %} # [linux]
{% set libname = "libtbb." ~ vbinary ~ "." ~ vminor ~ ".dylib" %} # [osx]
{% set libname = "tbb" ~ vbinary ~ ".dll" %} # [win]
{% set win_extra = "os.add_dll_directory(os.environ['LIBRARY_BIN']); " if win else "" %}
- python -c "import ctypes, os; {{ win_extra }} assert {{ vinterface }} == ctypes.cdll[r'{{ libname }}']['TBB_runtime_interface_version']()"
- name: tbb-devel
about:
summary: TBB Development files
license_file:
- LICENSE.txt
- third-party-programs.txt
build:
script:
- set CMAKE_GENERATOR=Ninja # [win]
- set CMAKE_GENERATOR_TOOLSET= # [win]
- set CMAKE_GENERATOR_PLATFORM= # [win]
- cmake {{ cmake_args }} -DTBB_TEST=OFF -S . -B build
- cmake --build build --parallel
- cmake -DCOMPONENT=devel -P build/cmake_install.cmake
run_exports:
- tbb >={{ version }}
ignore_run_exports:
- libhwloc
requirements:
build:
- python *
- {{ compiler('cxx') }}
- {{ stdlib("c") }}
- ninja # [win]
- make # [not win]
- cmake >=3.13
- pkg-config
host:
- libhwloc
run:
- {{ pin_subpackage('tbb', exact=True) }} # development package is for specific version of tbb
test:
requires:
- {{ compiler('cxx') }}
- {{ stdlib("c") }}
- ninja # [win]
- make # [not win]
- cmake
- pkg-config
- libhwloc
# When cross-compiling we need to get uname from coreutils so that
# CMAKE_SYSTEM_PROCESSOR is set to the correct value
- coreutils # [build_platform != target_platform]
source_files:
- cmake
- test
- CMakeLists.txt
- include # some tests depend on files from include
- integration # same
- src # some tests depend on files from src
commands:
- set CMAKE_GENERATOR=Ninja # [win]
- set CMAKE_GENERATOR_TOOLSET= # [win]
- set CMAKE_GENERATOR_PLATFORM= # [win]
# Setting TBB_DIR=ON and TBB_FIND_PACKAGE=ON is needed to use libraries from the tested package,
# but do not build them from sources; real path to TBBConfig files is not required,
# because CMake will successfully find installed tested package.
- cmake {{ cmake_args }} -DTBB_TEST=ON -DTBB_DIR=ON -DTBB_FIND_PACKAGE=ON -S . -B test_build
- cmake --build test_build --target {{ tests }} --parallel # build tests
- cd test_build
- ctest -R "{{ ctest_regex }}" --output-on-failure
- name: tbb4py
about:
summary: TBB module for Python
license_file:
- LICENSE.txt
- third-party-programs.txt
build:
skip: true # [py>=312]
script:
- set CMAKE_GENERATOR=Ninja # [win]
- set CMAKE_GENERATOR_TOOLSET= # [win]
- set CMAKE_GENERATOR_PLATFORM= # [win]
- cmake {{ cmake_tbb4py_args }} -DTBB4PY_BUILD=ON -DTBB_TEST=OFF -S . -B {{ tbb4py_build_dir }}
- cmake --build {{ tbb4py_build_dir }} --target python_build --parallel
- cmake -DCOMPONENT=tbb4py -P {{ tbb4py_build_dir }}/cmake_install.cmake
requirements:
build:
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- {{ compiler('cxx') }}
- {{ stdlib("c") }}
- ninja # [win]
- make # [not win]
- cmake
- swig
host:
- python
- {{ pin_subpackage('tbb-devel', exact=True) }}
run:
- tbb >={{ version }} # while python module works with any compatible tbb...
- python
test:
requires:
- python
- {{ pin_subpackage('tbb', exact=True) }} # we want to test with this specific tbb package
imports:
- tbb
- TBB
commands:
- python -m TBB -h
- python -m tbb -h
- python -m tbb test
about:
home: https://github.com/oneapi-src/oneTBB
license: Apache-2.0
license_file:
- LICENSE.txt
- third-party-programs.txt
summary: High level abstract threading library
dev_url: https://github.com/oneapi-src/oneTBB
doc_url: https://software.intel.com/en-us/oneapi-tbb-documentation
extra:
recipe-maintainers:
- anton-malakhov
- jschueller
- AlexVeprev
- isaevil
- ilya-lavrenov