File _service:extract_file:OHPC_macros of Package openmpi-intel (Revision 6f50bca4c952627f27de3d791d7f3e2e)
Currently displaying revision 6f50bca4c952627f27de3d791d7f3e2e , Show latest
246
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}" == "gnu14"
90
BuildRequires: gnu14-compilers%{PROJ_DELIM} >= 14.1.0
91
Requires: gnu14-compilers%{PROJ_DELIM} >= 14.1.0
92
%global gnu_family gnu14
93
%endif
94
%if "%{compiler_family}" == "gnu13"
95
BuildRequires: gnu13-compilers%{PROJ_DELIM} >= 13.1.0
96
Requires: gnu13-compilers%{PROJ_DELIM} >= 13.1.0
97
%global gnu_family gnu13
98
%endif
99
%if "%{compiler_family}" == "gnu12"
100
BuildRequires: gnu12-compilers%{PROJ_DELIM} >= 12.1.0
101
Requires: gnu12-compilers%{PROJ_DELIM} >= 12.1.0
102
%global gnu_family gnu12
103
%endif
104
%if "%{compiler_family}" == "gnu9"
105
BuildRequires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0
106
Requires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0
107
%global gnu_family gnu9
108
%endif
109
110
111
%if "%{compiler_family}" == "intel"
112
BuildRequires: gcc-c++ intel-compilers-devel%{PROJ_DELIM}
113
Requires: gcc-c++ intel-compilers-devel%{PROJ_DELIM}
114
115
%global __requires_exclude ^lib(cilkrts|ifcoremt|ifport|imf|intlc|iomp5|irc|irng|mkl_.*|svml)\\.so(\\.[25])?\\(.*\\)\\(64bit\\)$
116
%endif
117
118
%if "%{compiler_family}" == "arm1"
119
BuildRequires: arm1-compilers-devel%{PROJ_DELIM}
120
Requires: arm1-compilers-devel%{PROJ_DELIM}
121
%endif
122
123
%if "%{compiler_family}" == "llvm"
124
BuildRequires: llvm-compilers%{PROJ_DELIM} >= 9.0.0
125
Requires: llvm-compilers%{PROJ_DELIM} >= 9.0.0
126
%endif
127
128
# Disable annobin on RHEL based systems
129
%if 0%{?rhel} >= 8
130
%undefine _annotated_build
131
%endif
132
133
%endif
134
135
# Disable generation of .build-id links
136
%global _build_id_links none
137
138
# Disable RPM symlink analysis on files in %%{OHPC_HOME}.
139
%global __libsymlink_exclude_path %{OHPC_HOME}/.*$
140
141
# MPI dependencies
142
%if 0%{?ohpc_mpi_dependent} == 1
143
%if "%{mpi_family}" == "impi"
144
BuildRequires: intel-mpi-devel%{PROJ_DELIM}
145
Requires: intel-mpi-devel%{PROJ_DELIM}
146
%if "0%{?__requires_exclude}" == "0"
147
%global __requires_exclude ^libmpi\\.so.*$|^libmpifort\\.so.*$|^libmpicxx\\.so.*$
148
%else
149
%global __requires_exclude %{__requires_exclude}|^libmpi\\.so.*$|^libmpifort\\.so.*$|^libmpicxx\\.so.*$
150
%endif
151
%endif
152
%if "%{mpi_family}" == "mpich"
153
BuildRequires: mpich-%{compiler_family}%{PROJ_DELIM}
154
Requires: mpich-%{compiler_family}%{PROJ_DELIM}
155
%endif
156
%if "%{mpi_family}" == "mvapich2"
157
BuildRequires: mvapich2-%{compiler_family}%{PROJ_DELIM}
158
Requires: mvapich2-%{compiler_family}%{PROJ_DELIM}
159
%endif
160
%if "%{mpi_family}" == "openmpi3"
161
BuildRequires: openmpi3-%{compiler_family}%{PROJ_DELIM}
162
Requires: openmpi3-%{compiler_family}%{PROJ_DELIM}
163
%endif
164
%if "%{mpi_family}" == "openmpi4"
165
BuildRequires: openmpi4-%{compiler_family}%{PROJ_DELIM}
166
Requires: openmpi4-%{compiler_family}%{PROJ_DELIM}
167
%endif
168
%if "%{mpi_family}" == "openmpi5"
169
BuildRequires: openmpi5-%{compiler_family}%{PROJ_DELIM}
170
Requires: openmpi5-%{compiler_family}%{PROJ_DELIM}
171
%endif
172
%endif
173
174
# Python dependencies and macros
175
%if 0%{?ohpc_python_dependent} == 1
176
%global python_module_prefix py3-
177
%if 0%{?rhel} == 9
178
%global python_prefix python3.11
179
%global __python /usr/bin/python3.11
180
%global python3_pkgversion 3.11
181
%global python_lib_dir python%{python3_pkgversion}
182
BuildRequires: %{python_prefix}-rpm-macros
183
%else
184
%if 0%{?sle_version} >= 150500
185
%global python_prefix python311
186
%global __python /usr/bin/python3.11
187
%global python3_pkgversion 3.11
188
%global python3_version %{python311_version}
189
%global python3_sitearch %{python311_sitearch}
190
%global python_lib_dir python%{python3_pkgversion}
191
BuildRequires: python3-rpm-macros
192
%else
193
%global python_prefix python3
194
%global __python %__python3
195
%global python_lib_dir python%{python3_version}
196
BuildRequires: %{python_prefix}-rpm-macros
197
%endif
198
%endif
199
%global python_site_dir %{python3_sitearch}
200
BuildRequires: %{python_prefix}-devel
201
BuildRequires: %{python_prefix}-setuptools
202
Requires: %{python_prefix}
203
%endif
204
205
# Single-line macro for running compiler/MPI setup scripts
206
# Script bodies are evaluated and stored in this macro definition
207
%global ohpc_setup_compiler %{expand:
208
%{?OHPC_CFLAGS:export OHPC_CFLAGS=%{OHPC_CFLAGS}}
209
%{?OHPC_CXXFLAGS:export OHPC_CXXFLAGS=%{OHPC_CXXFLAGS}}
210
%{?OHPC_FCFLAGS:"export OHPC_FCFLAGS=%{OHPC_FCFLAGS}}
211
%{?OHPC_F77FLAGS:"export OHPC_F77FLAGS=%{OHPC_F77FLAGS}}
212
. %{OHPC_ADMIN}/ohpc/OHPC_setup_compiler %{compiler_family}}
213
214
%if 0%{?ohpc_mpi_dependent} == 01
215
%global ohpc_setup_compiler %{expand:
216
%{ohpc_setup_compiler}
217
. %{OHPC_ADMIN}/ohpc/OHPC_setup_mpi %{mpi_family}}
218
%endif
219
220
# Lua version
221
%if 0%{!?luaver:1}
222
# Set luaver to lua_version if it exists
223
%if 0%{?lua_version:1}
224
%global luaver %{lua_version}
225
%else
226
# Set default Lua version to 5.1, the version used by CentOS 7
227
%global luaver 5.1
228
# Lua 5.2 is used by older SUSE
229
%if 0%{?suse_version} >= 1200 && 0%{?suse_version} < 1350
230
%global luaver 5.2
231
%endif
232
# Lua 5.3 is used by OpenSUSE/SLES 15 and RHEL/CentOS 8
233
%if 0%{?sle_version} >= 150000 || 0%{?rhel_version} >=800
234
%global luaver 5.3
235
%endif
236
%endif
237
%endif
238
239
# check if user desires to override package and modulefile naming with
240
# custom delimiter (e.g optimized micro-architecture build)
241
242
%global OHPC_CUSTOM_PKG_DELIM %{nil}
243
244
%{?OHPC_CUSTOM_DELIM: %global OHPC_CUSTOM_PKG_DELIM -%{OHPC_CUSTOM_DELIM}}
245
%{?OHPC_CUSTOM_DELIM: %global PROJ_DELIM -%{OHPC_CUSTOM_DELIM}%{PROJ_DELIM}}
246