diff --git a/OpenBLAS.spec b/OpenBLAS.spec index 852296995d5..0de8bf4fa4c 100644 --- a/OpenBLAS.spec +++ b/OpenBLAS.spec @@ -19,10 +19,10 @@ Patch1: OpenBLAS-disable-tests make %{build_opts} TARGET=CORE2 %endif %ifarch aarch64 -make %{build_opts} TARGET=ARMV8 +make %{build_opts} TARGET=ARMV8 CFLAGS="%{arch_build_flags}" %endif %ifarch ppc64le -make %{build_opts} CFLAGS="%{ppc64le_build_flags}" +make %{build_opts} CFLAGS="%{arch_build_flags}" %endif %install diff --git a/boost.spec b/boost.spec index 190535163ac..70b01d2515a 100644 --- a/boost.spec +++ b/boost.spec @@ -1,5 +1,5 @@ ### RPM external boost 1.75.0 - +## INCLUDE compilation_flags %define tag 3defebd61ecb0970c0046c85384bb34ec9572ac3 %define branch cms/v%realversion %define github_user cms-externals @@ -17,6 +17,10 @@ case %cmsos in *) TOOLSET=gcc ;; esac +%if "%{?arch_build_flags:set}" == "set" +echo 'using gcc : : : "%{arch_build_flags}" "%{arch_build_flags}" ;' > user-config.jam +%endif + pushd tools/build sh bootstrap.sh ${TOOLSET} mkdir ./tmp-boost-build @@ -27,7 +31,7 @@ popd PYTHONV3=$(echo $PYTHON3_VERSION | cut -f1,2 -d.) # enable boost::mpi -echo "using mpi ;" > user-config.jam +echo "using mpi ;" >> user-config.jam echo "using python : ${PYTHONV3} : ${PYTHON3_ROOT}/bin/python3 : ${PYTHON3_ROOT}/include/python${PYTHONV3} : ${PYTHON3_ROOT}/lib ;" >> user-config.jam b2 -q \ diff --git a/compilation_flags.file b/compilation_flags.file index dac80c9f392..da0e66519ac 100644 --- a/compilation_flags.file +++ b/compilation_flags.file @@ -1,4 +1,11 @@ -%if "%{?ppc64le_build_flags:set}" != "set" -%define ppc64le_build_flags -mcpu=power8 -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512 +%if "%{?arch_build_flags:set}" != "set" +%ifarch ppc64le +%define arch_build_flags -mcpu=power8 -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512 +%endif +%ifarch aarch64 +%define arch_build_flags -march=armv8-a -mno-outline-atomics +%endif +%ifarch x86_64 +%define arch_build_flags %{nil} +%endif %endif - diff --git a/fastjet.spec b/fastjet.spec index 00a08571713..a9b6154fe50 100644 --- a/fastjet.spec +++ b/fastjet.spec @@ -26,8 +26,8 @@ CXXFLAGS="-O3 -Wall -ffast-math -ftree-vectorize" %ifarch x86_64 CXXFLAGS="${CXXFLAGS} -msse3" %endif -%ifarch ppc64le -CXXFLAGS="${CXXFLAGS} %{ppc64le_build_flags}" +%if "%{?arch_build_flags:set}" == "set" +CXXFLAGS="${CXXFLAGS} %{arch_build_flags}" %endif PYTHON=$(which python3) \ diff --git a/fftjet.spec b/fftjet.spec index 9c51500b526..5c724862207 100644 --- a/fftjet.spec +++ b/fftjet.spec @@ -25,8 +25,8 @@ chmod +x ./config.{sub,guess} touch pkg-config ; chmod +x pkg-config ./configure $PLATF_CONF_OPTS --disable-dependency-tracking --enable-threads \ --prefix=%i F77="$F77" CXX="$CXX" DEPS_CFLAGS=-I$FFTW3_ROOT/include \ -%ifarch ppc64le - CXXFLAGS="-O2 %{ppc64le_build_flags}" \ +%if "%{?arch_build_flags:set}" == "set" + CXXFLAGS="-O2 %{arch_build_flags}" \ %else CXXFLAGS="-O2" \ %endif diff --git a/fmt.spec b/fmt.spec index dd384fbf1b1..2753e0bb5f6 100644 --- a/fmt.spec +++ b/fmt.spec @@ -14,8 +14,8 @@ rm -rf build && mkdir build && cd build cmake ../%{n}-%{realversion} \ -DCMAKE_INSTALL_PREFIX:STRING=%{i} \ -DCMAKE_INSTALL_LIBDIR:STRING=lib \ -%ifarch ppc64le - -DCMAKE_CXX_FLAGS="%{ppc64le_build_flags}" \ +%if "%{?arch_build_flags:set}" == "set" + -DCMAKE_CXX_FLAGS="%{arch_build_flags}" \ %endif -DBUILD_SHARED_LIBS=TRUE diff --git a/geant4.spec b/geant4.spec index 75c0d911ee2..226b138a068 100644 --- a/geant4.spec +++ b/geant4.spec @@ -32,10 +32,10 @@ export VecGeom_DIR=${VECGEOM_ROOT}/lib/cmake/VecGeom cmake ../%{n}.%{realversion} \ -DCMAKE_CXX_COMPILER="g++" \ -%ifarch ppc64le - -DCMAKE_CXX_FLAGS="-fPIC %{ppc64le_build_flags}" \ - -DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC %{ppc64le_build_flags}" \ - -DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC %{ppc64le_build_flags}" \ +%if "%{?arch_build_flags:set}" == "set" + -DCMAKE_CXX_FLAGS="-fPIC %{arch_build_flags}" \ + -DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC %{arch_build_flags}" \ + -DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC %{arch_build_flags}" \ %else -DCMAKE_CXX_FLAGS="-fPIC" \ -DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC" \ diff --git a/grpc-gcc11.patch b/grpc-gcc11.patch index beec63ccf9a..83f6fca50d5 100644 --- a/grpc-gcc11.patch +++ b/grpc-gcc11.patch @@ -10,3 +10,15 @@ index 19f9aab..27fec21 100644 #include "absl/base/internal/hide_ptr.h" #include "absl/base/internal/raw_logging.h" #include "absl/base/internal/spinlock.h" +diff --git a/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake b/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake +index 97bd283..40d66ea 100644 +--- a/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake ++++ b/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake +@@ -205,6 +205,7 @@ list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS + + list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS + "-march=armv8-a+crypto" ++ "-mno-outline-atomics" + ) + + list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS diff --git a/mkfit.spec b/mkfit.spec index f72cc1fdef4..2c9a9236748 100644 --- a/mkfit.spec +++ b/mkfit.spec @@ -22,11 +22,8 @@ sed -i -e 's|-std=c++14|-std=c++1z|' Makefile.config %ifarch x86_64 BUILD_ARGS=SSE3="1" %endif -%ifarch aarch64 -BUILD_ARGS=VEC_GCC="-march=native" -%endif -%ifarch ppc64le -BUILD_ARGS=VEC_GCC="%{ppc64le_build_flags}" +%if "%{?arch_build_flags:set}" == "set" +BUILD_ARGS=VEC_GCC="%{arch_build_flags}" %endif make %{makeprocesses} TBB_PREFIX=$TBB_ROOT "${BUILD_ARGS}" diff --git a/root.spec b/root.spec index 6307b2c86a3..d4aafc0f46b 100644 --- a/root.spec +++ b/root.spec @@ -1,7 +1,7 @@ ### RPM lcg root 6.24.07 ## INITENV +PATH PYTHON3PATH %{i}/lib ## INITENV SET ROOTSYS %{i} - +## INCLUDE compilation_flags %define tag 11009abdb2a84fb354cea142c16bf27963053db6 %define branch cms/v6-24-00-patches/292e441 @@ -31,8 +31,8 @@ rm -rf ../build mkdir ../build cd ../build -export CFLAGS=-D__ROOFIT_NOBANNER -export CXXFLAGS=-D__ROOFIT_NOBANNER +export CFLAGS="-D__ROOFIT_NOBANNER %{arch_build_flags}" +export CXXFLAGS="-D__ROOFIT_NOBANNER %{arch_build_flags}" cmake ../%{n}-%{realversion} \ -G Ninja \ diff --git a/scram-tools.file/tool-env.file b/scram-tools.file/tool-env.file index 4097765e6df..3ebe9cda131 100644 --- a/scram-tools.file/tool-env.file +++ b/scram-tools.file/tool-env.file @@ -10,8 +10,8 @@ export CMSDIST_DIR=%cmsdist_directory %ifarch x86_64 export COMPILER_CXXFLAGS="$(%{cmsdist_directory}/vectorization/cmsdist_packages.py)" %endif -%ifarch ppc64le -export COMPILER_CXXFLAGS="%{ppc64le_build_flags}" +%if "%{?arch_build_flags:set}" == "set" +export COMPILER_CXXFLAGS="%{arch_build_flags}" %endif export ORACLE_ENV_ROOT="" export CUDA_FLAGS="%{nvcc_cuda_flags}" diff --git a/tensorflow-sources.file b/tensorflow-sources.file index c52fc2605ed..1f2b1a3ef2d 100644 --- a/tensorflow-sources.file +++ b/tensorflow-sources.file @@ -34,8 +34,8 @@ BAZEL_OPTS="--batch --output_user_root ../build build -s --verbose_failures --di %ifarch x86_64 BAZEL_OPTS="$BAZEL_OPTS --copt=%{vectorize_flag}" %else -%ifarch ppc64le -BAZEL_OPTS="$BAZEL_OPTS $(echo %{ppc64le_build_flags} | tr ' ' '\n' | grep -v '^$' | sed -e 's|^|--copt=|' | tr '\n' ' ')" +%if "%{?arch_build_flags:set}" == "set" +BAZEL_OPTS="$BAZEL_OPTS $(echo %{arch_build_flags} | tr ' ' '\n' | grep -v '^$' | sed -e 's|^|--copt=|' | tr '\n' ' ')" %else BAZEL_OPTS="$BAZEL_OPTS --copt=-mcpu=native --copt=-mtune=native" %endif diff --git a/vecgeom.spec b/vecgeom.spec index 0addf94798e..badc8b2bbaa 100644 --- a/vecgeom.spec +++ b/vecgeom.spec @@ -29,8 +29,8 @@ cmake ../%{n}-%{realversion} \ %endif -DCMAKE_VERBOSE_MAKEFILE=TRUE \ -DCMAKE_CXX_STANDARD=17 \ -%ifarch ppc64le - -DCMAKE_CXX_FLAGS="%{ppc64le_build_flags}" \ +%if "%{?arch_build_flags:set}" == "set" + -DCMAKE_CXX_FLAGS="%{arch_build_flags}" \ %endif -DGEANT4=OFF