Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion abseil-cpp.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### RPM external abseil-cpp 20210324.2
## INCLUDE cpp-standard
Source: https://github.com/abseil/abseil-cpp/archive/%{realversion}.tar.gz

BuildRequires: cmake gmake
Expand All @@ -13,7 +14,7 @@ cd ../build

cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
Expand Down
4 changes: 4 additions & 0 deletions cpp-standard.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# C++ standard to use for CMS externals
# Notice: do not forget to change
# C++ standard flag in professor2-ppc64-flag-change.patch
%define cms_cxx_standard 20
3 changes: 2 additions & 1 deletion dd4hep.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### RPM external dd4hep v01-25x
## INCLUDE compilation_flags
## INCLUDE compilation_flags_lto
## INCLUDE cpp-standard

%define tag b07fa115c59d80d37154cf205cf00dff8137ee36
%define branch master
Expand All @@ -23,7 +24,7 @@ Requires: root boost clhep xerces-c geant4
-DDD4HEP_USE_PYROOT=ON \\\
-DCMAKE_AR=$(which gcc-ar) \\\
-DCMAKE_RANLIB=$(which gcc-ranlib) \\\
-DCMAKE_CXX_STANDARD=17 \\\
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \\\
-DCMAKE_BUILD_TYPE=Release \\\
-DDD4HEP_USE_GEANT4_UNITS=ON \\\
-DXERCESC_ROOT_DIR=${XERCES_C_ROOT} \\\
Expand Down
3 changes: 2 additions & 1 deletion grpc.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### RPM external grpc 1.35.0
## INCLUDE cpp-standard

Source: git+https://github.com/grpc/grpc.git?obj=master/v%{realversion}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Source1: https://patch-diff.githubusercontent.com/raw/grpc/grpc/pull/28212.patch
Expand All @@ -22,7 +23,7 @@ cmake ../%{n}-%{realversion} \
-G Ninja \
-DgRPC_INSTALL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_LIBDIR=lib \
-DgRPC_ABSL_PROVIDER=package \
Expand Down
3 changes: 2 additions & 1 deletion heppdt.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### RPM external heppdt 3.04.01
## INCLUDE cpp-standard
%define tag 2b499cfb4302d48d1fd91911fddec88e94219a44
%define branch cms/%{realversion}
%define github_user cms-externals
Expand All @@ -13,7 +14,7 @@ Requires: tbb
%endif

%if "%{?cms_cxxflags:set}" != "set"
%define cms_cxxflags -O2 -std=c++17
%define cms_cxxflags -O2 -std=c++%{cms_cxx_standard}
%endif

%prep
Expand Down
2 changes: 1 addition & 1 deletion professor2-ppc64-flag-change.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ index adf3b19..fabdbf0 100644
depends=glob("../include/*.h"),
include_dirs=[incdir, os.path.join(srcdir, "pyext", "professor2")],
- extra_compile_args="-std=c++11 -O3 -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(),
+ extra_compile_args="-std=c++20 -O3 -mcpu=native -Wno-unused-but-set-variable -Wno-sign-compare".split(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iarspider , may be for cpp std we just patch the Makefile using perl/sed comamnd e.g.

#Make sure the default c++sdt stand is c++11 in Makefile
grep -q 'std=c++11' Makefile
#Change c++ std to %{cms_cxx_standard}
sed  -e 's|-std=c++11|-std=c++%{cms_cxx_standard}|' Makefile

library_dirs=[libdir],
runtime_library_dirs=[],
libraries=["Professor2"])
3 changes: 2 additions & 1 deletion protobuf.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### RPM external protobuf 3.15.1
## INCLUDE cpp-standard
#============= IMPORTANT NOTE ========================#
# When changing the version of protobuf, remember to regenerate protobuf objects in CMSSW
# current recipe for this is:
Expand All @@ -18,7 +19,7 @@ BuildRequires: cmake ninja
%setup -n %{n}-%{realversion}
patch -p1 <%{_sourcedir}/8741.patch
%patch0 -p1
sed -i -e 's|CMAKE_CXX_STANDARD *11|CMAKE_CXX_STANDARD 17|' cmake/CMakeLists.txt
sed -i -e 's|CMAKE_CXX_STANDARD *11|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' cmake/CMakeLists.txt
%build
rm -rf ../build
mkdir ../build
Expand Down
3 changes: 2 additions & 1 deletion root.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## INITENV +PATH PYTHON3PATH %{i}/lib
## INITENV SET ROOTSYS %{i}
## INCLUDE compilation_flags
## INCLUDE cpp-standard
%define tag db7e72a4eb2cb9207083adfa61f4da5276d4ba7d
%define branch cms/v6-28-00-patches/9248a09753

Expand Down Expand Up @@ -89,7 +90,7 @@ cmake ../%{n}-%{realversion} \
-DGSL_ROOT_DIR="${GSL_ROOT}" \
-DGSL_CBLAS_LIBRARY="${OPENBLAS_ROOT}/lib/libopenblas.%{soext}" \
-DGSL_CBLAS_LIBRARY_DEBUG="${OPENBLAS_ROOT}/lib/libopenblas.%{soext}" \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-Dssl=ON \
-Dpyroot=ON \
-Dxrootd=ON \
Expand Down
5 changes: 4 additions & 1 deletion scram-tools.file/bin/get_tools
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export SCRAM_TOOL_SOURCE_DIR=$(realpath ${SCRAM_TOOLS_BIN_DIR}/../tools)/$4

#setup tools specific env
tool_script=${SCRAM_TOOL_SOURCE_DIR}/env.sh
if [ -f $tool_script ]; then source $tool_script; fi
if [ -f $tool_script ]; then
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' $tool_script
source $tool_script
fi

#Copy all tools and replace the env placeholders @VARIABLES@
[ -d ${TOOLFILES_INSTALL_DIR}/tools/selected ] || mkdir -p ${TOOLFILES_INSTALL_DIR}/tools/selected
Expand Down
2 changes: 2 additions & 0 deletions scram-tools.file/tool-env.file
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## INCLUDE compilation_flags
## INCLUDE compilation_flags_lto
## INCLUDE cuda-flags
## INCLUDE cpp-standard

export ROOT_CXXMODULES="0"
export PKG_VECTORIZATION="%{?package_vectorization}"
export CMSDIST_DIR="%{cmsdist_directory}"
export CMS_CXX_STANDARD=%{cms_cxx_standard}

%ifarch x86_64
export COMPILER_CXXFLAGS="$(%{cmsdist_directory}/vectorization/cmsdist_packages.py)"
Expand Down
2 changes: 1 addition & 1 deletion scram-tools.file/tools/gcc/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ source ${SCRAM_TOOLS_BIN_DIR}/os_libdir.sh
# optimizations as they become available in gcc.

GCC_CXXFLAGS=""
GCC_CXXFLAGS="$GCC_CXXFLAGS -std=c++20 -ftree-vectorize"
GCC_CXXFLAGS="$GCC_CXXFLAGS -std=@CMS_CXX_STANDARD@ -ftree-vectorize"
GCC_CXXFLAGS="$GCC_CXXFLAGS -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits"
GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility-inlines-hidden"
GCC_CXXFLAGS="$GCC_CXXFLAGS -fno-math-errno --param vect-max-version-for-alias-checks=50"
Expand Down
2 changes: 1 addition & 1 deletion starlight-r193-allow-setting-CMAKE_CXX_FLAGS.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 0d6c856..e51b906 100644
message(STATUS "GCC_VERSION>=4.6")
if(CPP11)
- set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -Wno-error=maybe-uninitialized -Wno-error=unused-variable -std=c++11")
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -Wno-error=maybe-uninitialized -Wno-error=unused-variable -std=c++11 ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -Wno-error=maybe-uninitialized -Wno-error=unused-variable ${CMAKE_CXX_FLAGS}")
message(STATUS "Enabling usage of C++11 features")
else()
- set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -Wno-error=maybe-uninitialized -Wno-error=unused-variable")
Expand Down
2 changes: 1 addition & 1 deletion starlight.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir ../build
cd ../build

export CLHEP_PARAM_PATH=${CLHEP_ROOT}
CXXFLAGS="-Wno-error=deprecated-declarations -Wno-error=deprecated-copy"
CXXFLAGS="-Wno-error=deprecated-declarations -Wno-error=deprecated-copy -std=c++%{cms_cxx_standard}"

cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX:PATH="%{i}" \
Expand Down
3 changes: 2 additions & 1 deletion tbb.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### RPM external tbb v2021.9.0
## INCLUDE cpp-standard

%define tag %{realversion}
%define branch onetbb_2021
Expand All @@ -19,7 +20,7 @@ cd %{_builddir}/build
cmake ../%{n}-%{realversion} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=address -Wno-error=uninitialized " \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_HWLOC_2_5_INCLUDE_PATH=$HWLOC_ROOT/include \
Expand Down
3 changes: 2 additions & 1 deletion tensorflow-sources.file
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BuildRequires: bazel java-env git
#Keep all requires in separate file, so that can be included in py-tensorflow too
## INCLUDE tensorflow-requires
## INCLUDE compilation_flags
## INCLUDE cpp-standard

Source: git+https://github.com/%{github_user}/tensorflow.git?obj=%{branch}/%{tag}&export=tensorflow-%{realversion}&output=/tensorflow-%{realversion}.tgz

Expand Down Expand Up @@ -37,7 +38,7 @@ BAZEL_OPTS="$BAZEL_OPTS $(echo %{arch_build_flags} | tr ' ' '\n' | grep -v '^$'
BAZEL_OPTS="$BAZEL_OPTS --copt=-mcpu=native --copt=-mtune=native"
%endif
%endif
BAZEL_OPTS="$BAZEL_OPTS --config=%{build_type} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 %{makeprocesses}"
BAZEL_OPTS="$BAZEL_OPTS --config=%{build_type} --cxxopt=-std=c++%{cms_cxx_standard} --host_cxxopt=-std=c++%{cms_cxx_standard} %{makeprocesses}"
BAZEL_OPTS="$BAZEL_OPTS --config=noaws --config=nogcp --config=nohdfs --config=nonccl"

%if %{enable_gpu}
Expand Down
4 changes: 3 additions & 1 deletion triton-inference-client.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### RPM external triton-inference-client 2.25.0
## INCLUDE cpp-standard

%define branch r22.08
%define github_user triton-inference-server
%define client_tag b4f10a4650a6c3acd0065f063fd1b9c258f10b73
Expand Down Expand Up @@ -40,7 +42,7 @@ cmake ${PROJ_DIR} \
-DCMAKE_INSTALL_PREFIX="%{i}" \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-DTRITON_ENABLE_CC_HTTP=OFF \
-DTRITON_ENABLE_CC_GRPC=ON \
-DTRITON_ENABLE_PYTHON_HTTP=OFF \
Expand Down
4 changes: 3 additions & 1 deletion vecgeom.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
### RPM external vecgeom v1.2.1
## INCLUDE compilation_flags
## INCLUDE compilation_flags_lto
## INCLUDE cpp-standard

%define tag 12fc8ba12efe93de5aaa9ff8e51e093ae93a1633
Source: git+https://gitlab.cern.ch/VecGeom/VecGeom.git?obj=master/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
BuildRequires: cmake gmake
Expand All @@ -22,7 +24,7 @@ cd ../build

cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_CXX_STANDARD:STRING="17" \
-DCMAKE_CXX_STANDARD:STRING="%{cms_cxx_standard}" \
-DCMAKE_AR=$(which gcc-ar) \
-DCMAKE_RANLIB=$(which gcc-ranlib) \
-DCMAKE_BUILD_TYPE=Release \
Expand Down