New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade gnu-compilers to GCC 12.2 #1439
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,11 @@ | |
|
||
%include %{_sourcedir}/OHPC_macros | ||
|
||
%global gnu_version 9.5.0 | ||
%global gnu_major_ver 9 | ||
%global pname gnu9-compilers | ||
%global gnu_version 12.2.0 | ||
%global gnu_major_ver gnu12 | ||
%global pname %{gnu_major_ver}-compilers | ||
|
||
# Define subcomponent versions required for build | ||
|
||
%global gmp_version 6.2.1 | ||
%global mpc_version 1.2.1 | ||
%global mpfr_version 4.1.0 | ||
|
@@ -24,63 +23,68 @@ Summary: The GNU C Compiler and Support Files | |
Name: %{pname}%{PROJ_DELIM} | ||
Version: %{gnu_version} | ||
Release: 1%{?dist} | ||
License: GNU GPL | ||
License: GPLv3 and GPLv3+ with exceptions and LGPLv3 and GPLv2 and LGPLv2+ | ||
Group: %{PROJ_NAME}/compiler-families | ||
URL: http://gcc.gnu.org/ | ||
Source0: https://ftp.gnu.org/gnu/gcc/gcc-%{gnu_version}/gcc-%{gnu_version}.tar.xz | ||
Source1: https://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2 | ||
Source2: https://ftp.gnu.org/gnu/mpc/mpc-%{mpc_version}.tar.gz | ||
Source3: https://ftp.gnu.org/gnu/mpfr/mpfr-%{mpfr_version}.tar.gz | ||
|
||
BuildRequires: bison | ||
BuildRequires: flex | ||
BuildRequires: gettext-devel | ||
BuildRequires: perl | ||
# Requirements from https://gcc.gnu.org/install/prerequisites.htmlzypper | ||
BuildRequires: gcc-c++ | ||
%if 0%{?suse_version} > 1220 | ||
BuildRequires: makeinfo | ||
%else | ||
BuildRequires: texinfo | ||
%endif | ||
BuildRequires: zlib-devel | ||
%if 0%{?sles_version} || 0%{?suse_version} | ||
BuildRequires: binutils >= 2.30 | ||
BuildRequires: make >= 3.80 | ||
BuildRequires: gettext-devel >= 0.14.5 | ||
BuildRequires: flex >= 2.5.4 | ||
BuildRequires: texinfo >= 4.7 | ||
BuildRequires: m4 >= 1.4.6 | ||
%if 0%{?sle_version} || 0%{?suse_version} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should line 79 below also be updated from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I've updated it to sle_version. sles_version is the older macro. |
||
BuildRequires: fdupes | ||
%endif | ||
Requires: glibc-devel | ||
Requires: binutils | ||
|
||
Requires: glibc >= 2.10.90 | ||
|
||
%define install_path %{OHPC_COMPILERS}/gcc/%{version} | ||
%global install_path %{OHPC_COMPILERS}/gcc/%{version} | ||
%global module_path %{OHPC_MODULES}/%{gnu_major_ver} | ||
|
||
%description | ||
|
||
Core package for the GNU Compiler Collection, including the C language | ||
frontend. | ||
|
||
|
||
%prep | ||
%setup -q -n gcc-%{version} -a1 -a2 -a3 | ||
|
||
ln -s gmp-%{gmp_version} gmp | ||
ln -s mpc-%{mpc_version} mpc | ||
ln -s mpfr-%{mpfr_version} mpfr | ||
|
||
%build | ||
|
||
%{__mkdir} obj | ||
%build | ||
mkdir obj | ||
cd obj | ||
../configure --disable-multilib --enable-languages="c,c++,fortran" --prefix=%{install_path} --disable-static --enable-shared | ||
../configure --disable-multilib \ | ||
--enable-languages="c,c++,fortran" \ | ||
--prefix=%{install_path} \ | ||
--disable-static \ | ||
--enable-shared | ||
make %{?_smp_mflags} | ||
|
||
|
||
%install | ||
cd obj | ||
make %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install | ||
|
||
%if 0%{?sles_version} || 0%{?suse_version} | ||
%if 0%{?sle_version} || 0%{?suse_version} | ||
%fdupes -s $RPM_BUILD_ROOT/%{install_path}/include | ||
%fdupes -s $RPM_BUILD_ROOT/%{install_path}/lib | ||
%fdupes -s $RPM_BUILD_ROOT/%{install_path}/install-tools | ||
%fdupes -s $RPM_BUILD_ROOT/%{install_path}/share | ||
%endif | ||
|
||
mkdir -p ${RPM_BUILD_ROOT}/%{_docdir} | ||
|
||
# Based on https://git.centos.org/rpms/gcc/blob/c8/f/SPECS/gcc.spec | ||
ln -sf gcc %{buildroot}%{install_path}/bin/cc | ||
ln -sf gfortran %{buildroot}%{install_path}/bin/f95 | ||
|
@@ -92,7 +96,7 @@ for opt; do | |
case "$opt" in | ||
-ansi|-std=c89|-std=iso9899:1990) fl="";; | ||
-std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2 | ||
exit 1;; | ||
exit 1;; | ||
esac | ||
done | ||
exec gcc $fl ${1+"$@"} | ||
|
@@ -104,69 +108,55 @@ for opt; do | |
case "$opt" in | ||
-std=c99|-std=iso9899:1999) fl="";; | ||
-std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2 | ||
exit 1;; | ||
exit 1;; | ||
esac | ||
done | ||
exec gcc $fl ${1+"$@"} | ||
EOF | ||
chmod 755 %{buildroot}%{install_path}/bin/c?9 | ||
|
||
# OpenHPC module file | ||
%{__mkdir_p} %{buildroot}/%{OHPC_MODULES}/gnu%{gnu_major_ver} | ||
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULES}/gnu%{gnu_major_ver}/%{version} | ||
#%Module1.0##################################################################### | ||
# OpenHPC module files | ||
mkdir -p %{buildroot}%{module_path} | ||
|
||
proc ModulesHelp { } { | ||
cat << EOF > %{buildroot}%{module_path}/%{version}.lua | ||
help([[ | ||
This module loads the GNU compiler collection" | ||
|
||
puts stderr " " | ||
puts stderr "This module loads the GNU compiler collection" | ||
puts stderr " " | ||
puts stderr "See the man pages for gcc, g++, and gfortran for detailed information" | ||
puts stderr "on available compiler options and command-line syntax." | ||
puts stderr " " | ||
See the man pages for gcc, g++, and gfortran for detailed information | ||
on available compiler options and command-line syntax. | ||
|
||
puts stderr "\nVersion %{version}\n" | ||
Version %{version} | ||
]]) | ||
|
||
} | ||
module-whatis "Name: GNU Compiler Collection" | ||
module-whatis "Version: %{version}" | ||
module-whatis "Category: compiler, runtime support" | ||
module-whatis "Description: GNU Compiler Family (C/C++/Fortran for x86_64)" | ||
module-whatis "URL: http://gcc.gnu.org/" | ||
whatis("Name: GNU Compiler Collection") | ||
whatis("Version: %{version}") | ||
whatis("Category: compiler, runtime support") | ||
whatis("Description: GNU Compiler Family (C/C++/Fortran for x86_64)") | ||
whatis("URL: http://gcc.gnu.org/") | ||
|
||
set version %{version} | ||
local version = "%{version}" | ||
|
||
prepend-path PATH %{install_path}/bin | ||
prepend-path MANPATH %{install_path}/share/man | ||
prepend-path INCLUDE %{install_path}/include | ||
prepend-path LD_LIBRARY_PATH %{install_path}/lib64 | ||
prepend-path MODULEPATH %{OHPC_MODULEDEPS}/gnu%{gnu_major_ver} | ||
prepend_path("PATH", "%{install_path}/bin") | ||
prepend_path("MANPATH", "%{install_path}/share/man") | ||
prepend_path("INCLUDE", "%{install_path}/include") | ||
prepend_path("LD_LIBRARY_PATH", "%{install_path}/lib64") | ||
prepend_path("MODULEPATH", "%{OHPC_MODULEDEPS}/%{gnu_major_ver}") | ||
|
||
family "compiler" | ||
family("compiler") | ||
EOF | ||
|
||
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULES}/gnu%{gnu_major_ver}/.version.%{version} | ||
#%Module1.0##################################################################### | ||
## | ||
## version file for %{pname}-%{version} | ||
## | ||
set ModulesVersion "%{version}" | ||
EOF | ||
ln -s %{version}.lua %{buildroot}%{module_path}/default | ||
|
||
%{__mkdir_p} ${RPM_BUILD_ROOT}/%{_docdir} | ||
|
||
%files | ||
%{OHPC_MODULES}/gnu%{gnu_major_ver}/ | ||
%{module_path} | ||
%dir %{OHPC_COMPILERS}/gcc | ||
%{install_path} | ||
%doc COPYING | ||
%doc COPYING3 | ||
%doc COPYING3.LIB | ||
%license COPYING | ||
%license COPYING.LIB | ||
%license COPYING.RUNTIME | ||
%license COPYING3 | ||
%license COPYING3.LIB | ||
%doc README | ||
%doc ChangeLog.tree-ssa | ||
%doc ChangeLog | ||
%doc COPYING.LIB | ||
%doc COPYING.RUNTIME | ||
%if "%{compiler_family}" != "gnu7" | ||
%doc NEWS | ||
%endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,11 +45,6 @@ check_exe() { | |
# export python family variables | ||
get_python_vars() { | ||
local __python_family=$1 | ||
if [ "x$__python_family" == "xpython2" ]; then | ||
export _python=python | ||
export python_module_prefix=py2 | ||
export python_package_prefix=python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is Python2 no more needed/supported ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python2 is no longer available in the latest SUSE 15 and deprecated in RHEL 8. Good time to drop it. |
||
fi | ||
if [ "x$__python_family" == "xpython3" ]; then | ||
export _python=python3 | ||
export python_module_prefix=py3 | ||
|
@@ -158,11 +153,7 @@ check_compiler_family() | |
myCC=gcc | ||
myCXX=g++ | ||
myFC=gfortran | ||
elif [ $LMOD_FAMILY_COMPILER == "gnu7" ];then | ||
myCC=gcc | ||
myCXX=g++ | ||
myFC=gfortran | ||
elif [ $LMOD_FAMILY_COMPILER == "gnu8" ];then | ||
elif [ $LMOD_FAMILY_COMPILER == "gnu12" ];then | ||
myCC=gcc | ||
myCXX=g++ | ||
myFC=gfortran | ||
|
@@ -174,10 +165,6 @@ check_compiler_family() | |
myCC=clang | ||
myCXX=clang++ | ||
myFC=gfortran | ||
elif [[ $LMOD_FAMILY_COMPILER == "llvm5" ]];then | ||
myCC=clang | ||
myCXX=clang++ | ||
myFC=flang | ||
else | ||
ERROR "Unknown compiler family" | ||
exit 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# gnu12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I also need to move it off the same line. The RPM developers have indicated they may turn end-of-line comments into errors.