Skip to content

Commit 97b1049

Browse files
author
Malik Shahzad Muzaffar
committed
GCC 11.4; cleanup for cmsplatf/cmsos use
1 parent b2ff161 commit 97b1049

21 files changed

+86
-137
lines changed

archive/python.spec

+4-9
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ sed -ibak "s|LIBFFI_INCLUDEDIR=.*|LIBFFI_INCLUDEDIR=\"${LIBFFI_ROOT}/include\"|g
8585
# in CMSSW and pyconfig.h is not smart enough to detect already defined
8686
# macros on Linux. The following problem does not exists on BSD machines as
8787
# cdefs.h does not define these macros.
88-
case %cmsplatf in
89-
osx*);;
90-
*)
88+
%ifnos darwin
9189
rm -f cms_configtest.cpp
9290
cat <<CMS_EOF > cms_configtest.cpp
9391
#include <features.h>
@@ -106,8 +104,7 @@ CMS_EOF
106104

107105
sed -ibak "s/\(#define _POSIX_C_SOURCE \)\(.*\)/\1${POSIX_C_SOURCE}/g" pyconfig.h
108106
sed -ibak "s/\(#define _XOPEN_SOURCE \)\(.*\)/\1${XOPEN_SOURCE}/g" pyconfig.h
109-
;;
110-
esac
107+
%endif
111108

112109
# Modify pyconfig.h to disable GCC format attribute as it is used incorrectly.
113110
# Triggers an error if -Werror=format is used with GNU GCC 4.8.0+.
@@ -127,8 +124,7 @@ export LIBFFI_ROOT
127124
make install
128125
%define pythonv %(echo %realversion | cut -d. -f 1,2)
129126

130-
case %cmsplatf in
131-
osx*)
127+
%ifos darwin
132128
make install prefix=%i
133129
(cd Misc; /bin/rm -rf RPM)
134130
mkdir -p %i/share/doc/%n
@@ -145,8 +141,7 @@ case %cmsplatf in
145141
perl -p -i -e 's|-fno-common||g' Makefile)
146142

147143
find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv -f {} %i/lib \;
148-
;;
149-
esac
144+
%endif
150145

151146
perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
152147
%{i}/bin/pydoc \

boost.spec

+9-11
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ Requires: python3 bz2lib zlib openmpi xz zstd
1010
%setup -n %{n}-%{realversion}
1111

1212
%build
13-
case %cmsos in
14-
osx*) TOOLSET=darwin ;;
15-
*) TOOLSET=gcc ;;
16-
esac
13+
14+
%ifos darwin
15+
TOOLSET=darwin
16+
%else
17+
TOOLSET=gcc
18+
%endif
1719

1820
%if "%{?arch_build_flags}"
1921
echo 'using gcc : : : <cxxflags>"%{arch_build_flags}" <cflags>"%{arch_build_flags}" ;' > user-config.jam
@@ -67,21 +69,17 @@ b2 -q \
6769
stage
6870

6971
%install
70-
case %{cmsos} in
71-
osx*) so=dylib ;;
72-
*) so=so ;;
73-
esac
7472
mkdir -p %{i}/lib %{i}/include
7573
# copy files around in their final location.
7674
# We use tar to reduce the number of processes required
7775
# and because we need to build the build hierarchy for
7876
# the files that we are copying.
7977
pushd stage/lib
80-
find . -name "*.${so}*" -type f | tar cf - -T - | (cd %{i}/lib; tar xfp -)
78+
find . -name "*.%{dynamic_lib_ext}*" -type f | tar cf - -T - | (cd %{i}/lib; tar xfp -)
8179
popd
8280
find boost -name '*.[hi]*' | tar cf - -T - | ( cd %{i}/include; tar xfp -)
8381

84-
for l in $(find %{i}/lib -name "*.${so}.*")
82+
for l in $(find %{i}/lib -name "*.%{dynamic_lib_ext}.*")
8583
do
86-
ln -s $(basename ${l}) $(echo ${l} | sed -e "s|[.]${so}[.].*|.${so}|")
84+
ln -s $(basename ${l}) $(echo ${l} | sed -e "s|[.]%{dynamic_lib_ext}[.].*|.%{dynamic_lib_ext}|")
8785
done

bootstrap-driver.spec

+2-9
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,9 @@ packagesWithBuildProvides=""
5151
platformSeeds+=" libaio"
5252
%endif
5353

54-
case %cmsplatf in
55-
slc*)
56-
# platformBuildSeeds+=" perl-Switch"
57-
true
58-
;;
59-
*)
60-
#platformSeeds+=" perl-IO"
54+
%if "%{rhel}" != "7"
6155
platformSeeds+=" libxcrypt perl-libs"
62-
;;
63-
esac
56+
%endif
6457

6558
defaultPkgs="cms+cms-common+1.0 cms+fakesystem+1.0"
6659

bz2lib.spec

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
### RPM external bz2lib 1.0.6
22
Source: http://www.bzip.org/%{realversion}/bzip2-%{realversion}.tar.gz
3-
%define cpu %(echo "%{cmsplatf}" | cut -f2 -d_)
4-
53

64
%prep
75
%setup -n bzip2-%{realversion}

cmake.spec

+5-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ EOF
2929
export CMAKE_PREFIX_PATH=$CURL_ROOT:$ZLIB_ROOT:$EXPAT_ROOT:$BZ2LIB_ROOT
3030
# For OS X 10.8 ("Mountain Lion") do not use Objective-C in
3131
# C and C++ code.
32-
case %cmsplatf in
33-
osx108_*)
34-
CXXFLAGS="-DOS_OBJECT_USE_OBJC=0" CFLAGS="-DOS_OBJECT_USE_OBJC=0" \
35-
./configure --prefix=%i --init=build-flags.cmake --parallel=%compiling_processes
36-
;;
37-
*)
38-
./configure --prefix=%i --init=build-flags.cmake --parallel=%compiling_processes
39-
;;
40-
esac
32+
%ifos darwin
33+
CXXFLAGS="-DOS_OBJECT_USE_OBJC=0" CFLAGS="-DOS_OBJECT_USE_OBJC=0" \
34+
%endif
35+
./configure --prefix=%{i} --init=build-flags.cmake --parallel=%{compiling_processes}
36+
4137
make %makeprocesses
4238

4339
%install

cuda.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
### RPM external cuda 11.5.2
1+
### RPM external cuda 11.8.0
22
## INITENV +PATH LD_LIBRARY_PATH %i/lib64
33

44
%define runpath_opts -m compute-sanitizer -m drivers -m nvvm
5-
%define driversversion 495.29.05
5+
%define driversversion 520.61.05
66

77
%ifarch x86_64
88
Source0: https://developer.download.nvidia.com/compute/cuda/%{realversion}/local_installers/%{n}_%{realversion}_%{driversversion}_linux.run

curl.spec

+5-8
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Requires: zlib
66
%setup -n %{n}-%{realversion}
77

88
%build
9-
case %{cmsplatf} in
10-
osx*) KERBEROS_ROOT=/usr/heimdal ;;
11-
*) KERBEROS_ROOT=/usr ;;
12-
esac
9+
%ifos darwin
10+
KERBEROS_ROOT=/usr/heimdal
11+
%else
12+
KERBEROS_ROOT=/usr
13+
%endif
1314

1415
./configure \
1516
--prefix=%{i} \
@@ -27,10 +28,6 @@ make %{makeprocesses}
2728

2829
%install
2930
make install
30-
case %{cmsos} in
31-
osx*) SONAME=dylib ;;
32-
*) SONAME=so ;;
33-
esac
3431

3532
# Trick to get our version of curl pick up our version of its associated shared
3633
# library (which is different from the one coming from the system!).

evtgen.spec

+3-11
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,16 @@ rm -rf ../build
3030
mkdir ../build
3131
cd ../build
3232

33-
34-
case %cmsplatf in
35-
osx*)
36-
;;
37-
esac
38-
3933
cmake -DCMAKE_INSTALL_PREFIX:PATH=%{i} ../%{n}-%{realversion} \
4034
-DEVTGEN_HEPMC3:BOOL=OFF -DHEPMC2_ROOT_DIR:PATH=$HEPMC_ROOT \
4135
-DEVTGEN_PYTHIA:BOOL=ON -DPYTHIA8_ROOT_DIR:PATH=$PYTHIA8_ROOT \
4236
-DEVTGEN_PHOTOS:BOOL=ON -DPHOTOSPP_ROOT_DIR:PATH=$PHOTOSPP_ROOT \
4337
-DEVTGEN_TAUOLA:BOOL=ON -DTAUOLAPP_ROOT_DIR:PATH=$TAUOLAPP_ROOT
4438

4539
# One more fix-up for OSX (in addition to the patch above)
46-
case %cmsplatf in
47-
osx*)
48-
perl -p -i -e "s|-shared|-dynamiclib -undefined dynamic_lookup|" make.inc
49-
;;
50-
esac
40+
%ifos darwin
41+
perl -p -i -e "s|-shared|-dynamiclib -undefined dynamic_lookup|" make.inc
42+
%endif
5143

5244
make
5345

gcc.spec

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
### RPM external gcc 11.2.1
1+
### RPM external gcc 11.4.1
22
## USE_COMPILER_VERSION
33
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64
44
# Use the git repository for fetching the sources. This gives us more control while developing
55
# a new platform so that we can compile yet to be released versions of the compiler.
66
# See: https://gcc.gnu.org/viewcvs/gcc/branches/gcc-8-branch/?view=log
7-
%define gccTag a0a0499b8bb920fdd98e791804812f001f0b4fe8
7+
%define gccTag d41085966d842e54fd4b528c719ed5af2e51c473
88
%define gccBranch releases/gcc-11
99

1010
%define moduleName %{n}-%{realversion}
@@ -13,20 +13,22 @@ Source0: git+https://github.com/gcc-mirror/%{n}.git?obj=%{gccBranch}/%{gccTag}&e
1313
%define keep_archives true
1414

1515
%define gmpVersion 6.2.1
16-
%define mpfrVersion 4.1.0
17-
%define mpcVersion 1.2.1
18-
%define islVersion 0.24
19-
%define zlibVersion 1.2.11
16+
%define mpfrVersion 4.2.0
17+
%define mpcVersion 1.3.1
18+
%define islVersion 0.26
19+
%define zlibVersion 1.2.13
20+
%define zstdVersion 1.4.5
2021
Source1: https://gmplib.org/download/gmp/gmp-%{gmpVersion}.tar.bz2
2122
Source2: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
2223
Source3: https://ftp.gnu.org/gnu/mpc/mpc-%{mpcVersion}.tar.gz
23-
Source4: http://isl.gforge.inria.fr/isl-%{islVersion}.tar.bz2
24+
Source4: https://libisl.sourceforge.io/isl-%{islVersion}.tar.bz2
2425
Source12: http://zlib.net/zlib-%{zlibVersion}.tar.gz
26+
Source13: https://github.com/facebook/zstd/releases/download/v%{zstdVersion}/zstd-%{zstdVersion}.tar.gz
2527

2628
%ifos linux
27-
%define bisonVersion 3.7.6
28-
%define binutilsVersion 2.36.1
29-
%define elfutilsVersion 0.183
29+
%define bisonVersion 3.8.2
30+
%define binutilsVersion 2.40
31+
%define elfutilsVersion 0.189
3032
%define m4Version 1.4.19
3133
%define flexVersion 2.6.4
3234
Source7: http://ftp.gnu.org/gnu/bison/bison-%{bisonVersion}.tar.gz
@@ -38,12 +40,10 @@ Source11: https://github.com/westes/flex/releases/download/v%{flexVersion}/flex-
3840

3941
Patch0: gcc-flex-nonfull-path-m4
4042
Patch1: gcc-flex-disable-doc
41-
Patch2: gcc-03af8492bee6243a9d10e78fea1a3e423bd5f9cd
4243

4344
%prep
4445

4546
%setup -T -b 0 -n %{moduleName}
46-
%patch2 -p1
4747

4848
# Filter out private stuff from RPM requires headers.
4949
cat << \EOF > %{name}-req
@@ -96,6 +96,7 @@ EOF_CMS_H
9696
%setup -D -T -b 3 -n mpc-%{mpcVersion}
9797
%setup -D -T -b 4 -n isl-%{islVersion}
9898
%setup -D -T -b 12 -n zlib-%{zlibVersion}
99+
%setup -D -T -b 13 -n zstd-%{zstdVersion}
99100

100101
%ifos linux
101102
%setup -D -T -b 7 -n bison-%{bisonVersion}
@@ -139,6 +140,10 @@ CFLAGS="${CONF_FLAGS}" ./configure --static --prefix=%{i}/tmp/sw
139140
make %{makeprocesses}
140141
make install
141142

143+
#Build and install zstd static library
144+
make -C ../zstd-%{zstdVersion}/lib %{makeprocesses} \
145+
install-static install-includes prefix=%{i}/tmp/sw \
146+
CPPFLAGS="-fPIC" CFLAGS="-fPIC"
142147
%ifos linux
143148
CONF_BINUTILS_OPTS="--enable-ld=default --enable-lto --enable-plugins --enable-threads"
144149
CONF_GCC_WITH_LTO="--enable-ld=default --enable-lto"
@@ -166,20 +171,13 @@ make install
166171
# Build Flex (for building)
167172
cd ../flex-%{flexVersion}
168173
./configure --disable-nls --prefix=%{i}/tmp/sw \
174+
--enable-static --disable-shared \
169175
--build=%{_build} --host=%{_host} \
170176
CC="$CC" CXX="$CXX"
171177
make %{makeprocesses}
172178
make install
173179
hash -r
174180

175-
# Build Flex
176-
cd ../flex-%{flexVersion}
177-
./configure --disable-nls --prefix=%{i} \
178-
--build=%{_build} --host=%{_host} \
179-
CC="$CC" CXX="$CXX"
180-
make %{makeprocesses}
181-
make install
182-
183181
# Build elfutils
184182
cd ../elfutils-%{elfutilsVersion}
185183
./configure --disable-static --with-zlib --without-bzlib --without-lzma \
@@ -263,13 +261,15 @@ export LD_LIBRARY_PATH=%{i}/lib64:%{i}/lib:$LD_LIBRARY_PATH
263261
$CONF_GCC_OS_SPEC $CONF_GCC_WITH_LTO --with-gmp=%{i} --with-mpfr=%{i} --enable-bootstrap \
264262
--with-mpc=%{i} --with-isl=%{i} --enable-checking=release \
265263
--build=%{_build} --host=%{_host} --enable-libstdcxx-time=rt $CONF_GCC_ARCH_SPEC \
266-
--enable-shared --disable-libgcj CC="$CC" CXX="$CXX" CPP="$CPP" CXXCPP="$CXXCPP" \
264+
--enable-shared --disable-libgcj \
265+
--with-zstd=%{i}/tmp/sw \
266+
CC="$CC" CXX="$CXX" CPP="$CPP" CXXCPP="$CXXCPP" \
267267
CFLAGS="-I%{i}/tmp/sw/include" CXXFLAGS="-I%{i}/tmp/sw/include" LDFLAGS="-L%{i}/tmp/sw/lib"
268268

269269
make %{makeprocesses} profiledbootstrap
270270

271271
%install
272-
cd %_builddir/%{moduleName}/obj && make install
272+
cd %_builddir/%{moduleName}/obj && make install
273273

274274
ln -s gcc %{i}/bin/cc
275275
find %{i}/lib %{i}/lib64 -name '*.la' -exec rm -f {} \; || true

gdbm.spec

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### RPM external gdbm 1.10
22
Source: http://ftp.gnu.org/gnu/%{n}/%{n}-%{realversion}.tar.gz
3+
BuildRequires: gmake
34

45
%prep
56
%setup -n %{n}-%{realversion}

gnuplot.spec

+3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
### RPM external gnuplot 5.2.8
22
Source: http://downloads.sourceforge.net/project/gnuplot/gnuplot/%{realversion}/gnuplot-%{realversion}.tar.gz
3+
Requires: zlib
34

45
%prep
56
%setup -n %{n}-%{realversion}
67

78
%build
9+
CFLAGS=-I${ZLIB_ROOT}/include \
10+
LDFLAGS=-L${ZLIB_ROOT}/lib \
811
./configure \
912
--prefix %{i} \
1013
--disable-wxt \

hector.spec

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ mkdir -p obj lib
1313
%build
1414
# Correct link path for root.
1515
#perl -p -i -e "s|^ROOTLIBS.*$|ROOTLIBS=-L$ROOT_ROOT/lib -lCore -lRint -lMatrix -lPhysics -lCling -lMathCore -pthread -lm -ldl -rdynamic|" Makefile
16-
case %cmsplatf in
17-
osx*) perl -p -i -e 's|-rdynamic||g' Makefile ;;
18-
esac
16+
%ifos darwin
17+
perl -p -i -e 's|-rdynamic||g' Makefile
18+
%endif
1919

2020
# Add CXX and CXXFLAGS to Makefile and increase output versbose level
2121
sed -ibak "s/@g++/\$(CXX) \$(CXXFLAGS)/g" Makefile

pip/pillow.file

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
%define PipBuildOptions --global-option="build_ext" --global-option="--disable-xcb"
2-
Requires: libjpeg-turbo zlib libtiff
3-
%define PipPreBuild export LDFLAGS="-L${LIBJPEG_TURBO_ROOT}/lib64 -L${ZLIB_ROOT}/lib -L${LIBTIFF_ROOT}/lib"; \
4-
export CFLAGS="-I${LIBJPEG_TURBO_ROOT}/include -I${ZLIB_ROOT}/include -I${LIBTIFF_ROOT}/include"
2+
Requires: libjpeg-turbo zlib libtiff freetype
3+
%define PipPreBuild export LDFLAGS="-L${LIBJPEG_TURBO_ROOT}/lib64 -L${ZLIB_ROOT}/lib -L${LIBTIFF_ROOT}/lib -L${FREETYPE_ROOT}/lib"; \
4+
export CFLAGS="-I${LIBJPEG_TURBO_ROOT}/include -I${ZLIB_ROOT}/include -I${LIBTIFF_ROOT}/include -I${FREETYPE_ROOT}/include"

pythia6.spec

+4-26
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ Source: http://cern.ch/service-spi/external/MCGenerators/distribution/%{n}/%{n}-
44
%define keep_archives true
55

66
%prep
7-
PLATF_CONF_OPTS="--disable-shared --enable-static"
8-
F77="$(which gfortran) -fPIC"
9-
10-
# Notice we need to define LDFLAGS like this to avoid dropping
11-
# the dynamic linker options on slc5_amd64_gcc434
12-
case %cmsplatf in
13-
osx*)
14-
PLATF_LDFLAGS="LDFLAGS='-Wl,-commons,use_dylibs -Wl,-flat_namespace'"
15-
PLATF_LDFLAGS=""
16-
PLATF_LD="LD='$(which gcc)'" ;;
17-
*)
18-
PLATF_LD="" ;;
19-
esac
20-
217
%setup -q -n %{n}/%{realversion}
228

239
# Update to detect aarch64 and ppc64le
@@ -26,18 +12,10 @@ rm -f ./config/config.{sub,guess}
2612
%get_config_guess ./config/config.guess
2713
chmod +x ./config/config.{sub,guess}
2814

29-
# Unfortunately we need the two cases because LDFLAGS= does not work on linux
30-
# and I couldn't get the space between use_dylibs and -Wl, preseved if
31-
# I tried to have the whole "LDFLAGS=foo" in a variable.
32-
case %cmsplatf in
33-
osx*)
34-
./configure $PLATF_CONF_OPTS --with-hepevt=4000 F77="$F77" \
35-
LD='$(which gcc)' LDFLAGS='-Wl,-commons,use_dylibs -Wl,-flat_namespace'
36-
;;
37-
*)
38-
./configure $PLATF_CONF_OPTS --with-hepevt=4000 F77="$F77"
39-
;;
40-
esac
15+
%ifos darwin
16+
LD="$(which gcc)" LDFLAGS='-Wl,-commons,use_dylibs -Wl,-flat_namespace' \
17+
%endif
18+
./configure --disable-shared --enable-static --with-hepevt=4000 F77="$(which gfortran) -fPIC"
4119

4220
perl -p -i -e 's|^CC=.*$|CC="gcc -fPIC"|' libtool
4321

0 commit comments

Comments
 (0)