gnu-compilers-hpc/macros.hpc-gnu
Nicolas Morey-Chaisemartin 1373f6ef54 Accepting request 523741 from science:HPC:EnvMod
- Update spec_fix.pl: It is now able to produce multiple spec files
  from one replacement file.
- Remove ohpc-isms.
- Add support for gcc update versions.
- Pick correct compiler version.
- Fix group of devel package: Development/Languages
- Add gcc-c++ into requires of the devel package
- Make the devel package to require the exact version of the main one
- Modified package to use a spec file template.
- Initial version of gnu compiler selection module
  FATE#321705.

OBS-URL: https://build.opensuse.org/request/show/523741
OBS-URL: https://build.opensuse.org/package/show/science:HPC/gnu-compilers-hpc?expand=0&rev=1
2017-09-12 14:34:49 +00:00

40 lines
1.4 KiB
Plaintext

#
# GNU Toolchain
#
# Version extension on binaries - GNU specific
# Use an init function to set these globally. This gets us around the arbitrary
# recursion limit of 16 in RPM.
%hpc_gnu_init(v:) \
%{-v: %define _cf_ver %{-v*}} \
%{echo: hpc_gnu_init %{?_cf_ver:version: %_cf_ver}} \
%{expand: %%global hpc_gnu_bin_version %{?_cf_ver:-%(\\\
echo %_cf_ver | \\\
sed -e "s@\\([0-9]\\)@\\1.@g" \\\
-e "s@\\([0-9]\\)\\.\\$@\\1@g")}%{!?_cf_ver:%%{nil}}} \
%{expand: %%global hpc_gnu_full_version %(\\\
gcc%{hpc_gnu_bin_version} --version |\\\
head -1 |\\\
sed -e "s#.* \\([0-9]\\+\\.[0-9.]\\+\\)\\(\$\\| .*\\)#\\1#")}\
# FIXME: We may just want to pick the major.minor or major version only \
%{expand: %%global hpc_gnu_dep_version %(\\\
FULL_VERSION=%hpc_gnu_full_version; \\\
echo ${FULL_VERSION%.*})} \
%{expand: %%global hpc_gnu_pack_version %{?_cf_ver}%{!?_cf_ver:%%{nil}}} \
%{expand: %%global hpc_gnu_dir gnu%{hpc_gnu_dep_version}}
%hpc_setup_gnu \
export CC=gcc%{hpc_gnu_bin_version} \
export CXX=g++%{hpc_gnu_bin_version} \
export FC=gfortran%{hpc_gnu_bin_version} \
export F77=gfortran%{hpc_gnu_bin_version} \
module load gnu/%hpc_cf_full_version
# Requires:
%hpc_gnu_requires \
Requires: gnu%{?hpc_cf_pack_version}-compilers-hpc
%hpc_gnu_requires_devel \
Requires: gnu%{?hpc_cf_pack_version}-compilers-hpc-devel