Skip to content

Commit

Permalink
Merge pull request #4838 from cms-sw/update-externals-ppc64
Browse files Browse the repository at this point in the history
Update externals for ppc64 build
  • Loading branch information
cmsbuild committed Apr 9, 2019
2 parents cf653c7 + 8bed18d commit 0fcad01
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 29 deletions.
13 changes: 13 additions & 0 deletions dd4hep-add-ppc64-macro-check.patch
@@ -0,0 +1,13 @@
diff --git a/DDCore/src/Primitives.cpp b/DDCore/src/Primitives.cpp
index b319624..bafb16a 100644
--- a/DDCore/src/Primitives.cpp
+++ b/DDCore/src/Primitives.cpp
@@ -25,7 +25,7 @@
#include <cstring>
#include <map>

-#if defined(__linux) || defined(__APPLE__)
+#if defined(__linux) || defined(__APPLE__) || defined(__powerpc64__)
#include <cxxabi.h>
#ifndef __APPLE__
typedef abi::__class_type_info class_t;
10 changes: 7 additions & 3 deletions dd4hep.spec
Expand Up @@ -6,16 +6,20 @@
%define keep_archives true

Source: git+https://github.com/%{github_user}/DD4hep.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
Patch0: dd4hep-build-static

BuildRequires: cmake

Requires: root boost clhep xerces-c geant4

Patch0: dd4hep-build-static
Patch1: dd4hep-add-ppc64-macro-check

%prep

%setup -n %{n}-%{realversion}

%ifarch ppc64le
%patch1 -p1
%endif

%build

export BOOST_ROOT
Expand Down
14 changes: 11 additions & 3 deletions geneva.spec
Expand Up @@ -4,12 +4,20 @@ Source: git+https://stash.desy.de/scm/geneva/geneva-public.git?obj=master/%{real

BuildRequires: cmake gmake

Requires: python py2-setuptools py2-numpy gsl boost lhapdf hepmc openloops pythia8
Requires: python py2-setuptools py2-numpy gsl boost lhapdf hepmc pythia8
%ifnarch ppc64le
Requires: openloops
%endif

%prep
%setup -q -n %{n}-%{realversion}

%build

%ifnarch ppc64le
export OPENLOOPS_FLAG="-Dopenloops_ROOT=${OPENLOOPS_ROOT}"
%endif

rm -rf ../build
mkdir ../build
cd ../build
Expand All @@ -20,8 +28,8 @@ cmake ../%{n}-%{realversion} \
-Dboost_ROOT=${BOOST_ROOT} \
-Dlhapdf_ROOT=${LHAPDF_ROOT} \
-Dhepmc_ROOT=${HEPMC_ROOT} \
-Dopenloops_ROOT=${OPENLOOPS_ROOT} \
-Dpythia8_ROOT=${PYTHIA8_ROOT}
-Dpythia8_ROOT=${PYTHIA8_ROOT} \
${OPENLOOPS_FLAG}

make %{makeprocesses}
make beamfunc-install-data LHAPDF_DATA_PATH=${LHAPDF_ROOT}/share/LHAPDF
Expand Down
10 changes: 3 additions & 7 deletions herwigpp.spec
@@ -1,9 +1,6 @@
### RPM external herwigpp 7.1.4
Source: https://www.hepforge.org/archive/herwig/Herwig-%{realversion}.tar.bz2

%define isamd64 %(case %{cmsplatf} in (*amd64*) echo 1 ;; (*) echo 0 ;; esac)
%define isaarch64 %(case %{cmsplatf} in (*_aarch64_*) echo 1 ;; (*) echo 0 ;; esac)

Requires: lhapdf
Requires: boost
Requires: hepmc
Expand All @@ -13,7 +10,7 @@ Requires: gsl
Requires: fastjet
Requires: gosamcontrib gosam
Requires: madgraph5amcatnlo
%if %isamd64
%ifarch x86_64
Requires: openloops
%endif
BuildRequires: autotools
Expand Down Expand Up @@ -44,10 +41,9 @@ PLATF_CONF_OPTS="--enable-shared --disable-static"
--with-gosam=$GOSAM_ROOT \
--with-gosam-contrib=$GOSAMCONTRIB_ROOT \
--with-hepmc=$HEPMC_ROOT \
%if %isamd64
%ifarch x86_64
--with-openloops=$OPENLOOPS_ROOT \
%endif
%if %isaarch64
%else
FCFLAGS="-fno-range-check" \
%endif
$PLATF_CONF_OPTS \
Expand Down
6 changes: 3 additions & 3 deletions pip/py2-pillow.file
@@ -1,3 +1,3 @@
Requires: libjpeg-turbo zlib
%define PipPreBuild export LDFLAGS="-L${LIBJPEG_TURBO_ROOT}/lib64 -L${ZLIB_ROOT}/lib"; \
export CFLAGS="-I${LIBJPEG_TURBO_ROOT}/include -I${ZLIB_ROOT}/include"
Requires: libjpeg-turbo zlib libtiff
%define PipPreBuild export LDFLAGS="-L${LIBJPEG_TURBO_ROOT}/lib64 -L${ZLIB_ROOT}/lib -L${LIBTIFF_ROOT}/lib"; \
export CFLAGS="-I${LIBJPEG_TURBO_ROOT}/include -I${ZLIB_ROOT}/include -I${LIBTIFF_ROOT}/include"
26 changes: 26 additions & 0 deletions professor2-ppc64-flag-change.patch
@@ -0,0 +1,26 @@
diff --git a/Makefile b/Makefile
index cd2ba6d..8fe79fc 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ ifndef CPPFLAGS
endif

ifndef CXXFLAGS
- CXXFLAGS := -O3 -march=native
+ CXXFLAGS := -O3 -mcpu=native
ifdef DEBUG
ifneq ($(DEBUG),0)
CXXFLAGS += -g
diff --git a/pyext/setup.py b/pyext/setup.py
index e93fe3f..8b9ab0e 100644
--- a/pyext/setup.py
+++ b/pyext/setup.py
@@ -14,7 +14,7 @@ ext = Extension("professor2.core",
language="C++",
depends=glob("../include/*.h"),
include_dirs=[incdir, os.path.join(srcdir, "pyext", "professor2")],
- extra_compile_args="-std=c++11 -O3 -march=native -Wno-unused-but-set-variable -Wno-sign-compare".split(),
+ extra_compile_args="-std=c++11 -O3 -mcpu=native -Wno-unused-but-set-variable -Wno-sign-compare".split(),
library_dirs=[libdir],
runtime_library_dirs=[],
libraries=["Professor2"])
8 changes: 7 additions & 1 deletion professor2.spec
@@ -1,13 +1,19 @@
### RPM external professor2 2.2.2
## INITENV +PATH PYTHON27PATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages
Source: http://www.hepforge.org/archive/professor/Professor-%{realversion}.tar.gz

Source: http://www.hepforge.org/archive/professor/Professor-%{realversion}.tar.gz
Requires: py2-numpy py2-matplotlib root yoda eigen
BuildRequires: py2-cython

Patch0: professor2-ppc64-flag-change

%prep
%setup -n Professor-%{realversion}

%ifarch ppc64le
%patch0 -p1
%endif

%build
make CPPFLAGS=-I${EIGEN_ROOT}/include/eigen3

Expand Down
10 changes: 2 additions & 8 deletions py2-tensorflow.spec
Expand Up @@ -14,14 +14,8 @@ Requires: py2-funcsigs py2-protobuf py2-pbr py2-six py2-packaging py2-appdirs py

%build

%ifarch x86_64
%define tensor_build cp27-cp27mu-linux_x86_64
%define tensor_python3_build cp36-cp36m-linux_x86_64
%endif
%ifarch aarch64
%define tensor_build cp27-cp27mu-linux_aarch64
%define tensor_python3_build cp36-cp36m-linux_aarch64
%endif
%define tensor_build cp27-cp27mu-linux_%{_arch}
%define tensor_python3_build cp36-cp36m-linux_%{_arch}

mkdir -p %{i}
export PYTHONUSERBASE=%i
Expand Down
4 changes: 4 additions & 0 deletions tensorflow-sources.spec
Expand Up @@ -67,7 +67,9 @@ bazel --output_user_root ../build build -s --verbose_failures -c opt --cxxopt=$C
bazel --output_user_root ../build build -s --verbose_failures -c opt --cxxopt=$CXX_OPT_FLAGS //tensorflow/tools/graph_transforms:transform_graph
bazel --output_user_root ../build build -s --verbose_failures -c opt --cxxopt=$CXX_OPT_FLAGS //tensorflow/compiler/aot:tf_aot_runtime
bazel --output_user_root ../build build -s --verbose_failures -c opt --cxxopt=$CXX_OPT_FLAGS //tensorflow/compiler/tf2xla:xla_compiled_cpu_function
%ifnarch ppc64le
bazel --output_user_root ../build build -s --verbose_failures -c opt --cxxopt=$CXX_OPT_FLAGS //tensorflow/compiler/aot:tfcompile
%endif

bazel shutdown

Expand All @@ -84,7 +86,9 @@ cp -v $PWD/bazel-bin/tensorflow/libtensorflow_cc.so $libdir
cp -v $PWD/bazel-bin/tensorflow/libtensorflow_framework.so $libdir
cp -v $PWD/bazel-bin/tensorflow/compiler/aot/libtf_aot_runtime.so $libdir
cp -v $PWD/bazel-bin/tensorflow/compiler/tf2xla/libxla_compiled_cpu_function.so $libdir
%ifnarch ppc64le
cp -v $PWD/bazel-bin/tensorflow/compiler/aot/tfcompile $bindir
%endif

#Download depencies used by tensorflow and copy to include dir
tensorflow/contrib/makefile/download_dependencies.sh
Expand Down
14 changes: 14 additions & 0 deletions vecgeom-add-ppc64-cmake-fix.patch
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3014e9..e3604be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -372,6 +372,9 @@ elseif (${_arch_lo} MATCHES native)
if (Intel)
set(VECGEOM_CXX_FLAGS "${VECGEOM_CXX_FLAGS} -xHost")
set(VECGEOM_COMPILATION_FLAGS "${VECGEOM_COMPILATION_FLAGS} -xHost")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le")
+ set(VECGEOM_CXX_FLAGS "${VECGEOM_CXX_FLAGS} -mcpu=${_arch_lo} -mtune=${_arch_lo}")
+ set(VECGEOM_COMPILATION_FLAGS "${VECGEOM_COMPILATION_FLAGS} -mcpu=${_arch_lo} -mtune=${_arch_lo}")
else()
set(VECGEOM_CXX_FLAGS "${VECGEOM_CXX_FLAGS} -march=${_arch_lo}")
set(VECGEOM_COMPILATION_FLAGS "${VECGEOM_COMPILATION_FLAGS} -march=${_arch_lo}")
9 changes: 5 additions & 4 deletions vecgeom.spec
Expand Up @@ -3,17 +3,18 @@ Source: git+https://gitlab.cern.ch/VecGeom/VecGeom.git?obj=master/%{realversion}
BuildRequires: cmake gmake
%define keep_archives true

%define isamd64 %(case %{cmsplatf} in (*amd64*) echo 1 ;; (*) echo 0 ;; esac)
%define isaarch64 %(case %{cmsplatf} in (*_aarch64_*) echo 1 ;; (*) echo 0 ;; esac)

Patch0: vecgeom-fix-for-arm64
Patch1: vecgeom-uninit-fix
Patch2: vecgeom-add-ppc64-cmake-fix

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

%patch0 -p1
%patch1 -p1
%ifarch ppc64le
%patch2 -p1
%endif

%build
rm -rf ../build
Expand All @@ -28,7 +29,7 @@ cmake ../%{n}-%{realversion} \
-DBACKEND=Scalar \
-DUSOLIDS=ON \
-DUSOLIDS_VECGEOM=ON \
%if %isamd64
%ifarch x86_64
-DVECGEOM_VECTOR=sse3 \
%else
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
Expand Down

0 comments on commit 0fcad01

Please sign in to comment.