File _service:extract_file:OHPC_macros of Package netcdf-cxx-intel (Revision f81cf2b7605b9b6107aea65b28c3afbb)
Currently displaying revision f81cf2b7605b9b6107aea65b28c3afbb , Show latest
xxxxxxxxxx
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 gnu12}
83
%{!?mpi_family: %global mpi_family openmpi4}
84
%{!?python_family: %global python_family python3}
85
86
# Compiler dependencies
87
%if 0%{?ohpc_compiler_dependent} == 1
88
89
%if "%{compiler_family}" == "gnu12"
90
BuildRequires: gnu12-compilers%{PROJ_DELIM} >= 12.1.0
91
Requires: gnu12-compilers%{PROJ_DELIM} >= 12.1.0
92
%global gnu_family gnu12
93
%endif
94
%if "%{compiler_family}" == "gnu9"
95
BuildRequires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0
96
Requires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0
97
%global gnu_family gnu9
98
%endif
99
100
101
%if "%{compiler_family}" == "intel"
102
BuildRequires: gcc-c++ intel-compilers-devel%{PROJ_DELIM}
103
Requires: gcc-c++ intel-compilers-devel%{PROJ_DELIM}
104
%endif
105
106
%if "%{compiler_family}" == "arm1"
107
BuildRequires: arm1-compilers-devel%{PROJ_DELIM}
108
Requires: arm1-compilers-devel%{PROJ_DELIM}
109
%endif
110
111
%if "%{compiler_family}" == "llvm"
112
BuildRequires: llvm-compilers%{PROJ_DELIM} >= 9.0.0
113
Requires: llvm-compilers%{PROJ_DELIM} >= 9.0.0
114
%endif
115
116
# Disable annobin on RHEL based systems
117
%if 0%{?rhel} >= 8
118
%undefine _annotated_build
119
%endif
120
121
%endif
122
123
# Disable generation of .build-id links
124
%global _build_id_links none
125
126
# Disable RPM symlink analysis on files in %%{OHPC_HOME}.
127
%global __libsymlink_exclude_path %{OHPC_HOME}/.*$
128
129
# MPI dependencies
130
%if 0%{?ohpc_mpi_dependent} == 1
131
%if "%{mpi_family}" == "impi"
132
BuildRequires: intel-mpi-devel%{PROJ_DELIM}
133
Requires: intel-mpi-devel%{PROJ_DELIM}
134
%global __requires_exclude ^libmpi\\.so.*$|^libmpifort\\.so.*$|^libmpicxx\\.so.*$
135
%endif
136
%if "%{mpi_family}" == "mpich"
137
BuildRequires: mpich-%{compiler_family}%{PROJ_DELIM}
138
Requires: mpich-%{compiler_family}%{PROJ_DELIM}
139
%endif
140
%if "%{mpi_family}" == "mvapich2"
141
BuildRequires: mvapich2-%{compiler_family}%{PROJ_DELIM}
142
Requires: mvapich2-%{compiler_family}%{PROJ_DELIM}
143
%endif
144
%if "%{mpi_family}" == "openmpi3"
145
BuildRequires: openmpi3-%{compiler_family}%{PROJ_DELIM}
146
Requires: openmpi3-%{compiler_family}%{PROJ_DELIM}
147
%endif
148
%if "%{mpi_family}" == "openmpi4"
149
BuildRequires: openmpi4-%{compiler_family}%{PROJ_DELIM}
150
Requires: openmpi4-%{compiler_family}%{PROJ_DELIM}
151
%endif
152
%endif
153
154
# Python dependencies and macros
155
%if 0%{?ohpc_python_dependent} == 1
156
%global __python %__python3
157
%global python_module_prefix py3-
158
%global python_site_dir %{python3_sitearch}
159
%global python_prefix python3
160
%global python_lib_dir python%{python3_version}
161
BuildRequires: %{python_prefix}-devel
162
BuildRequires: %{python_prefix}-setuptools
163
BuildRequires: %{python_prefix}-rpm-macros
164
Requires: %{python_prefix}
165
%endif
166
167
# Single-line macro for running compiler/MPI setup scripts
168
# Script bodies are evaluated and stored in this macro definition
169
%global ohpc_setup_compiler %{expand:
170
%{?OHPC_CFLAGS:export OHPC_CFLAGS=%{OHPC_CFLAGS}}
171
%{?OHPC_CXXFLAGS:export OHPC_CXXFLAGS=%{OHPC_CXXFLAGS}}
172
%{?OHPC_FCFLAGS:"export OHPC_FCFLAGS=%{OHPC_FCFLAGS}}
173
%{?OHPC_F77FLAGS:"export OHPC_F77FLAGS=%{OHPC_F77FLAGS}}
174
. %{OHPC_ADMIN}/ohpc/OHPC_setup_compiler %{compiler_family}}
175
176
%if 0%{?ohpc_mpi_dependent} == 01
177
%global ohpc_setup_compiler %{expand:
178
%{ohpc_setup_compiler}
179
. %{OHPC_ADMIN}/ohpc/OHPC_setup_mpi %{mpi_family}}
180
%endif
181
182
# Lua version
183
%if 0%{!?luaver:1}
184
# Set luaver to lua_version if it exists
185
%if 0%{?lua_version:1}
186
%global luaver %{lua_version}
187
%else
188
# Set default Lua version to 5.1, the version used by CentOS 7
189
%global luaver 5.1
190
# Lua 5.2 is used by older SUSE
191
%if 0%{?suse_version} >= 1200 && 0%{?suse_version} < 1350
192
%global luaver 5.2
193
%endif
194
# Lua 5.3 is used by OpenSUSE/SLES 15 and RHEL/CentOS 8
195
%if 0%{?sle_version} >= 150000 || 0%{?rhel_version} >=800
196
%global luaver 5.3
197
%endif
198
%endif
199
%endif
200
201
# check if user desires to override package and modulefile naming with
202
# custom delimiter (e.g optimized micro-architecture build)
203
204
%global OHPC_CUSTOM_PKG_DELIM %{nil}
205
206
%{?OHPC_CUSTOM_DELIM: %global OHPC_CUSTOM_PKG_DELIM -%{OHPC_CUSTOM_DELIM}}
207
%{?OHPC_CUSTOM_DELIM: %global PROJ_DELIM -%{OHPC_CUSTOM_DELIM}%{PROJ_DELIM}}
208