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