Skip to content

Commit

Permalink
Merge pull request #7592 from cms-sw/g10-aarch64-build-for-armv8-a
Browse files Browse the repository at this point in the history
[AARCH64][GCC10] Build with -march=armv8-a
  • Loading branch information
smuzaffar committed Feb 4, 2022
2 parents 0307083 + c4b8212 commit a822596
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 29 deletions.
4 changes: 2 additions & 2 deletions OpenBLAS.spec
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions 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
Expand All @@ -17,6 +17,10 @@ case %cmsos in
*) TOOLSET=gcc ;;
esac

%if "%{?arch_build_flags}"
echo 'using gcc : : : <cxxflags>"%{arch_build_flags}" <cflags>"%{arch_build_flags}" ;' > user-config.jam
%endif

pushd tools/build
sh bootstrap.sh ${TOOLSET}
mkdir ./tmp-boost-build
Expand All @@ -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 \
Expand Down
13 changes: 10 additions & 3 deletions 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

4 changes: 2 additions & 2 deletions fastjet.spec
Expand Up @@ -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}"
CXXFLAGS="${CXXFLAGS} %{arch_build_flags}"
%endif

PYTHON=$(which python3) \
Expand Down
4 changes: 2 additions & 2 deletions fftjet.spec
Expand Up @@ -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}"
CXXFLAGS="-O2 %{arch_build_flags}" \
%else
CXXFLAGS="-O2" \
%endif
Expand Down
4 changes: 2 additions & 2 deletions fmt.spec
Expand Up @@ -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}"
-DCMAKE_CXX_FLAGS="%{arch_build_flags}" \
%endif
-DBUILD_SHARED_LIBS=TRUE

Expand Down
8 changes: 4 additions & 4 deletions geant4.spec
Expand Up @@ -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}"
-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" \
Expand Down
12 changes: 12 additions & 0 deletions grpc-gcc11.patch
Expand Up @@ -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
7 changes: 2 additions & 5 deletions mkfit.spec
Expand Up @@ -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}"
BUILD_ARGS=VEC_GCC="%{arch_build_flags}"
%endif
make %{makeprocesses} TBB_PREFIX=$TBB_ROOT "${BUILD_ARGS}"

Expand Down
6 changes: 5 additions & 1 deletion 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

Expand Down Expand Up @@ -33,6 +33,10 @@ cd ../build

export CFLAGS=-D__ROOFIT_NOBANNER
export CXXFLAGS=-D__ROOFIT_NOBANNER
%if "%{?arch_build_flags}"
export CFLAGS="${CFLAGS} %{arch_build_flags}"
export CXXFLAGS="${CXXFLAGS} %{arch_build_flags}"
%endif

cmake ../%{n}-%{realversion} \
-G Ninja \
Expand Down
4 changes: 2 additions & 2 deletions scram-tools.file/tool-env.file
Expand Up @@ -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}"
export COMPILER_CXXFLAGS="%{arch_build_flags}"
%endif
export ORACLE_ENV_ROOT=""
export CUDA_FLAGS="%{nvcc_cuda_flags}"
Expand Down
4 changes: 2 additions & 2 deletions tensorflow-sources.file
Expand Up @@ -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}"
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
Expand Down
4 changes: 2 additions & 2 deletions vecgeom.spec
Expand Up @@ -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}"
-DCMAKE_CXX_FLAGS="%{arch_build_flags}" \
%endif
-DGEANT4=OFF

Expand Down

0 comments on commit a822596

Please sign in to comment.