Skip to content

Commit

Permalink
PPC - remove -mlong-double-64 flag and use the default
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodozov committed May 22, 2021
1 parent 7e1fcfa commit a290a82
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 30 deletions.
17 changes: 4 additions & 13 deletions OpenBLAS-fix-dynamic-arch.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
diff --git a/Makefile.x86_64 b/Makefile.x86_64
index f2de51e..e1c348a 100644
index f62ab9e..f23a65b 100644
--- a/Makefile.x86_64
+++ b/Makefile.x86_64
@@ -9,7 +9,7 @@ endif
endif

ifeq ($(CORE), SKYLAKEX)
-ifndef DYNAMIC_ARCH
+ifneq ($(DYNAMIC_ARCH), 1)
ifndef NO_AVX512
CCOMMON_OPT += -march=skylake-avx512
FCOMMON_OPT += -march=skylake-avx512
@@ -28,7 +28,7 @@ endif
endif

ifeq ($(CORE), HASWELL)
-ifndef DYNAMIC_ARCH
+ifneq ($(DYNAMIC_ARCH), 1)
ifndef NO_AVX2
ifeq ($(C_COMPILER), GCC)
CCOMMON_OPT += -mavx2
ADD_CPUFLAGS = 1
else
ifdef TARGET_CORE
4 changes: 2 additions & 2 deletions OpenBLAS.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external OpenBLAS 0.3.9
### RPM external OpenBLAS 0.3.15
## INCLUDE compilation_flags
Source: https://github.com/xianyi/OpenBLAS/archive/v%{realversion}.tar.gz
Patch0: OpenBLAS-fix-dynamic-arch
Expand All @@ -20,7 +20,7 @@ make FC=gfortran BINARY=64 TARGET=CORE2 NUM_THREADS=256 DYNAMIC_ARCH=0
%ifarch aarch64
make FC=gfortran BINARY=64 TARGET=ARMV8 NUM_THREADS=256 DYNAMIC_ARCH=0
%else
make FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 CFLAGS="%{ppc64le_build_flags}"
make FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 CFLAGS="%{ppc64le_build_flags_no_longdouble}"
%endif # aarch64
%endif # x86_64

Expand Down
3 changes: 3 additions & 0 deletions compilation_flags.file
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
%if "%{?ppc64le_build_flags:set}" != "set"
%define ppc64le_build_flags -mlong-double-64 -mcpu=power8 -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512
%endif
%if "%{?ppc64le_build_flags_no_longdouble:set}" != "set"
%define ppc64le_build_flags_no_longdouble -mcpu=powerpc64le -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512
%endif

2 changes: 1 addition & 1 deletion fastjet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CXXFLAGS="-O3 -Wall -ffast-math -ftree-vectorize"

case %{cmsplatf} in
*_amd64_*) CXXFLAGS="${CXXFLAGS} -msse3" ;;
*_ppc64le_*) CXXFLAGS="${CXXFLAGS} %{ppc64le_build_flags}" ;;
*_ppc64le_*) CXXFLAGS="${CXXFLAGS} %{ppc64le_build_flags_no_longdouble}" ;;
esac

./configure \
Expand Down
4 changes: 0 additions & 4 deletions fftjet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ 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 -mlong-double-64" \
%else
CXXFLAGS="-O2" \
%endif
DEPS_LIBS="-L$FFTW3_ROOT/lib -lfftw3" PKG_CONFIG=$PWD/pkg-config
make %makeprocesses

Expand Down
3 changes: 0 additions & 3 deletions fmt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ 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="-mlong-double-64" \
%endif
-DBUILD_SHARED_LIBS=TRUE

make %{makeprocesses}
Expand Down
2 changes: 1 addition & 1 deletion gcc-toolfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -Xassembler --compress-debug-sections"
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -fsigned-char -fsigned-bitfields"
%endif
%ifarch ppc64le
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -fsigned-char -fsigned-bitfields %{ppc64le_build_flags}"
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -fsigned-char -fsigned-bitfields %{ppc64le_build_flags_no_longdouble}"
%endif

export COMPILER_CXXFLAGS
Expand Down
6 changes: 3 additions & 3 deletions geant4.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export VecGeom_DIR=${VECGEOM_ROOT}/lib/cmake/VecGeom
cmake ../%{n}.%{realversion} \
-DCMAKE_CXX_COMPILER="g++" \
%ifarch ppc64le
-DCMAKE_CXX_FLAGS="-fPIC -mlong-double-64" \
-DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC -mlong-double-64" \
-DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC -mlong-double-64" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC" \
-DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC" \
%else
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC" \
Expand Down
1 change: 0 additions & 1 deletion llvm-gcc-toolfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/llvm-cxxcompiler.xml
<flags REM_CXXFLAGS="-mrecip"/>
<flags REM_CXXFLAGS="-fno-crossjumping"/>
<flags REM_CXXFLAGS="-fno-aggressive-loop-optimizations"/>
<flags REM_CXXFLAGS="-mlong-double-64"/>
<flags REM_CXXFLAGS="-funroll-all-loops"/>
<flags CXXFLAGS="-Wno-c99-extensions"/>
<flags CXXFLAGS="-Wno-c++11-narrowing"/>
Expand Down
2 changes: 1 addition & 1 deletion mkfit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BUILD_ARGS=VEC_GCC="-msse3"
BUILD_ARGS=VEC_GCC="-march=native"
%endif
%ifarch ppc64le
BUILD_ARGS=VEC_GCC="%{ppc64le_build_flags}"
BUILD_ARGS=VEC_GCC="%{ppc64le_build_flags_no_longdouble}"
%endif
make %{makeprocesses} TBB_PREFIX=$TBB_ROOT "${BUILD_ARGS}"

Expand Down
2 changes: 1 addition & 1 deletion vecgeom.spec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cmake ../%{n}-%{realversion} \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCMAKE_CXX_STANDARD=17 \
%ifarch ppc64le
-DCMAKE_CXX_FLAGS="%{ppc64le_build_flags}" \
-DCMAKE_CXX_FLAGS="%{ppc64le_build_flags_no_longdouble}" \
%endif
-DGEANT4=OFF

Expand Down

0 comments on commit a290a82

Please sign in to comment.