File _service:extract_file:OHPC_macros of Package omb-intel-openmpi5
251
1
# OpenHPC build script/utilities
2
#
3
#-----------------------------------------------------------------------
4
# Licensed under the Apache License, Version 2.0 (the "License"); you
5
# may not use this file except in compliance with the License. You may
6
# obtain a copy of the License at
7
#
8
# http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
# implied. See the License for the specific language governing
14
# permissions and limitations under the License.
15
#-----------------------------------------------------------------------
16
17
# Top-level OpenHPC installation paths
18
%global PROJ_NAME ohpc
19
%global OHPC_HOME /opt/%{PROJ_NAME}
20
%global OHPC_ADMIN %{OHPC_HOME}/admin
21
%global OHPC_PUB %{OHPC_HOME}/pub
22
%global OHPC_APPS %{OHPC_PUB}/apps
23
%global OHPC_COMPILERS %{OHPC_PUB}/compiler
24
%global OHPC_LIBS %{OHPC_PUB}/libs
25
%global OHPC_MODULES %{OHPC_PUB}/modulefiles
26
%global OHPC_MODULEDEPS %{OHPC_PUB}/moduledeps
27
%global OHPC_MPI_STACKS %{OHPC_PUB}/mpi
28
%global OHPC_UTILS %{OHPC_PUB}/utils
29
%global debug_package %{nil}
30
31
%if 0%{?rhel} >= 9 || 0%{?openEuler}
32
%{!?dist: %global dist 320.ohpc}
33
%else
34
%{!?dist: %global dist 27.ohpc}
35
%endif
36
%{!?PROJ_DELIM: %global PROJ_DELIM -ohpc}
37
38
# Update package docs location to include version info (to allow
39
# possibility of coinstall of multiple package versions)
40
DocDir: %{OHPC_PUB}/doc/contrib
41
%global _docdir_fmt %{name}-%{version}
42
43
# Define PNAME which can be used in modulefile generation for env vars (derived
44
# from pname defined in each component .spec file)
45
%define PNAME %(echo %{pname} | tr [a-z] [A-Z] | tr - _)
46
47
# Definition to replace dots in %%version with underscores
48
%define version_exp %(tr "." "_" <<< %{version})
49
50
# Instead of having Source[1-9]: OHPC_macros in every SPEC file,
51
# this sets Source42 for all SPEC files which include OHPC_macros.
52
Source42: OHPC_macros
53
54
# Pre-process global OS version macros for operation outside OBS
55
# Supports build on clone distros without requiring distro-specific
56
# macros defined in each specfile.
57
%if 0%{!?rhel_version:1}
58
%{?centos_version:%global rhel_version %{centos_version}}
59
%{?scientificlinux_version:%global rhel_version %{scientific_version}}
60
%if 0%{?rhel} == 7
61
# OBS defines rhel_version to 700 for RHEL7
62
%global rhel_version 700
63
%endif
64
%if 0%{?rhel} == 8
65
# OBS defines rhel_version to 800 for RHEL8
66
%global rhel_version 800
67
%endif
68
%endif
69
70
# OpenHPC packages also require ohpc-buildroot to access macros used to define
71
# compiler and MPI families
72
%if 0%{!?ohpc_bootstrap:1}
73
Requires: ohpc-filesystem
74
BuildRequires: ohpc-buildroot
75
%endif
76
77
# OpenHPC convention: the default build configuration for compiler/MPI
78
# dependent packages assumes the gnu compiler and openmpi family; however,
79
# these choices can be overridden by specifing the compiler_family/mpi_family
80
# variables via rpmbuild or other mechanisms.
81
82
%{!?compiler_family: %global compiler_family gnu14}
83
%{!?mpi_family: %global mpi_family openmpi5}
84
%{!?python_family: %global python_family python3}
85
86
# Compiler dependencies
87
%if 0%{?ohpc_compiler_dependent} == 1
88
89
%if "%{compiler_family}" == "gnu15"
90
BuildRequires: gnu15-compilers%{PROJ_DELIM} >= 14.1.0
91
Requires: gnu15-compilers%{PROJ_DELIM} >= 14.1.0
92
%global gnu_family gnu15
93
%endif
94
%if "%{compiler_family}" == "gnu14"
95
BuildRequires: gnu14-compilers%{PROJ_DELIM} >= 14.1.0
96
Requires: gnu14-compilers%{PROJ_DELIM} >= 14.1.0
97
%global gnu_family gnu14
98
%endif
99
%if "%{compiler_family}" == "gnu13"
100
BuildRequires: gnu13-compilers%{PROJ_DELIM} >= 13.1.0
101
Requires: gnu13-compilers%{PROJ_DELIM} >= 13.1.0
102
%global gnu_family gnu13
103
%endif
104
%if "%{compiler_family}" == "gnu12"
105
BuildRequires: gnu12-compilers%{PROJ_DELIM} >= 12.1.0
106
Requires: gnu12-compilers%{PROJ_DELIM} >= 12.1.0
107
%global gnu_family gnu12
108
%endif
109
%if "%{compiler_family}" == "gnu9"
110
BuildRequires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0
111
Requires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0
112
%global gnu_family gnu9
113
%endif
114
115
116
%if "%{compiler_family}" == "intel"
117
BuildRequires: gcc-c++ intel-compilers-devel%{PROJ_DELIM}
118
Requires: gcc-c++ intel-compilers-devel%{PROJ_DELIM}
119
120
%global __requires_exclude ^lib(cilkrts|ifcoremt|ifport|imf|intlc|iomp5|irc|irng|mkl_.*|svml)\\.so(\\.[25])?\\(.*\\)\\(64bit\\)$
121
%endif
122
123
%if "%{compiler_family}" == "arm1"
124
BuildRequires: arm1-compilers-devel%{PROJ_DELIM}
125
Requires: arm1-compilers-devel%{PROJ_DELIM}
126
%endif
127
128
%if "%{compiler_family}" == "llvm"
129
BuildRequires: llvm-compilers%{PROJ_DELIM} >= 9.0.0
130
Requires: llvm-compilers%{PROJ_DELIM} >= 9.0.0
131
%endif
132
133
# Disable annobin on RHEL based systems
134
%if 0%{?rhel} >= 8
135
%undefine _annotated_build
136
%endif
137
138
%endif
139
140
# Disable generation of .build-id links
141
%global _build_id_links none
142
143
# Disable RPM symlink analysis on files in %%{OHPC_HOME}.
144
%global __libsymlink_exclude_path %{OHPC_HOME}/.*$
145
146
# MPI dependencies
147
%if 0%{?ohpc_mpi_dependent} == 1
148
%if "%{mpi_family}" == "impi"
149
BuildRequires: intel-mpi-devel%{PROJ_DELIM}
150
Requires: intel-mpi-devel%{PROJ_DELIM}
151
%if "0%{?__requires_exclude}" == "0"
152
%global __requires_exclude ^libmpi\\.so.*$|^libmpifort\\.so.*$|^libmpicxx\\.so.*$
153
%else
154
%global __requires_exclude %{__requires_exclude}|^libmpi\\.so.*$|^libmpifort\\.so.*$|^libmpicxx\\.so.*$
155
%endif
156
%endif
157
%if "%{mpi_family}" == "mpich"
158
BuildRequires: mpich-%{compiler_family}%{PROJ_DELIM}
159
Requires: mpich-%{compiler_family}%{PROJ_DELIM}
160
%endif
161
%if "%{mpi_family}" == "mvapich2"
162
BuildRequires: mvapich2-%{compiler_family}%{PROJ_DELIM}
163
Requires: mvapich2-%{compiler_family}%{PROJ_DELIM}
164
%endif
165
%if "%{mpi_family}" == "openmpi3"
166
BuildRequires: openmpi3-%{compiler_family}%{PROJ_DELIM}
167
Requires: openmpi3-%{compiler_family}%{PROJ_DELIM}
168
%endif
169
%if "%{mpi_family}" == "openmpi4"
170
BuildRequires: openmpi4-%{compiler_family}%{PROJ_DELIM}
171
Requires: openmpi4-%{compiler_family}%{PROJ_DELIM}
172
%endif
173
%if "%{mpi_family}" == "openmpi5"
174
BuildRequires: openmpi5-%{compiler_family}%{PROJ_DELIM}
175
Requires: openmpi5-%{compiler_family}%{PROJ_DELIM}
176
%endif
177
%endif
178
179
# Python dependencies and macros
180
%if 0%{?ohpc_python_dependent} == 1
181
%global python_module_prefix py3-
182
%if 0%{?rhel} == 9
183
%global python_prefix python3.11
184
%global __python /usr/bin/python3.11
185
%global python3_pkgversion 3.11
186
%global python_lib_dir python%{python3_pkgversion}
187
BuildRequires: %{python_prefix}-rpm-macros
188
%else
189
%if 0%{?sle_version} >= 150500
190
%global python_prefix python311
191
%global __python /usr/bin/python3.11
192
%global python3_pkgversion 3.11
193
%global python3_version %{python311_version}
194
%global python3_sitearch %{python311_sitearch}
195
%global python_lib_dir python%{python3_pkgversion}
196
BuildRequires: python3-rpm-macros
197
%else
198
%global python_prefix python3
199
%global __python %__python3
200
%global python_lib_dir python%{python3_version}
201
BuildRequires: %{python_prefix}-rpm-macros
202
%endif
203
%endif
204
%global python_site_dir %{python3_sitearch}
205
BuildRequires: %{python_prefix}-devel
206
BuildRequires: %{python_prefix}-setuptools
207
Requires: %{python_prefix}
208
%endif
209
210
# Single-line macro for running compiler/MPI setup scripts
211
# Script bodies are evaluated and stored in this macro definition
212
%global ohpc_setup_compiler %{expand:
213
%{?OHPC_CFLAGS:export OHPC_CFLAGS=%{OHPC_CFLAGS}}
214
%{?OHPC_CXXFLAGS:export OHPC_CXXFLAGS=%{OHPC_CXXFLAGS}}
215
%{?OHPC_FCFLAGS:"export OHPC_FCFLAGS=%{OHPC_FCFLAGS}}
216
%{?OHPC_F77FLAGS:"export OHPC_F77FLAGS=%{OHPC_F77FLAGS}}
217
. %{OHPC_ADMIN}/ohpc/OHPC_setup_compiler %{compiler_family}}
218
219
%if 0%{?ohpc_mpi_dependent} == 01
220
%global ohpc_setup_compiler %{expand:
221
%{ohpc_setup_compiler}
222
. %{OHPC_ADMIN}/ohpc/OHPC_setup_mpi %{mpi_family}}
223
%endif
224
225
# Lua version
226
%if 0%{!?luaver:1}
227
# Set luaver to lua_version if it exists
228
%if 0%{?lua_version:1}
229
%global luaver %{lua_version}
230
%else
231
# Set default Lua version to 5.1, the version used by CentOS 7
232
%global luaver 5.1
233
# Lua 5.2 is used by older SUSE
234
%if 0%{?suse_version} >= 1200 && 0%{?suse_version} < 1350
235
%global luaver 5.2
236
%endif
237
# Lua 5.3 is used by OpenSUSE/SLES 15 and RHEL/CentOS 8
238
%if 0%{?sle_version} >= 150000 || 0%{?rhel_version} >=800
239
%global luaver 5.3
240
%endif
241
%endif
242
%endif
243
244
# check if user desires to override package and modulefile naming with
245
# custom delimiter (e.g optimized micro-architecture build)
246
247
%global OHPC_CUSTOM_PKG_DELIM %{nil}
248
249
%{?OHPC_CUSTOM_DELIM: %global OHPC_CUSTOM_PKG_DELIM -%{OHPC_CUSTOM_DELIM}}
250
%{?OHPC_CUSTOM_DELIM: %global PROJ_DELIM -%{OHPC_CUSTOM_DELIM}%{PROJ_DELIM}}
251