Skip to content

Commit

Permalink
Use C++17 in O2 (#1293)
Browse files Browse the repository at this point in the history
Relevant changes needed in order to move to C++17:

* Bump FairRoot
* boost: bump to v1.68, disable boost_python, build with C++14
* Vc: bump to patch release to fix `std::for_each_n` issue
* ApMon: bump to v2.2.8-alice2 to fix C++17-incompatible code
* yaml-cpp: bump
* GEANT4: enforce C++14 as C++17 is not yet supported
  • Loading branch information
dberzano authored Oct 4, 2018
1 parent 74f9d18 commit 8d51812
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 28 deletions.
2 changes: 1 addition & 1 deletion apmon-cpp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package: ApMon-CPP
version: "%(tag_basename)s"
tag: v2.2.8-alice1
tag: v2.2.8-alice2
source: https://github.com/alisw/apmon-cpp.git
build_requires:
- autotools
Expand Down
13 changes: 11 additions & 2 deletions boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ build_requires:
prefer_system: (?!slc5)
prefer_system_check: |
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 105900)\n#error \"Cannot use system's boost. Boost > 1.59.00 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
prepend_path:
ROOT_INCLUDE_PATH: "$BOOST_ROOT/include"
---
#!/bin/bash -e

Expand All @@ -18,7 +20,13 @@ python -c 'import sys; sys.exit(1 if sys.version_info < (2, 7) else 0)'
pip --help &> /dev/null && \
printf '#include \"pyconfig.h"' | gcc -c $(python-config --includes) -xc -o /dev/null - || \
unset BOOST_PYTHON
[[ $BOOST_PYTHON ]] || WITHOUT_PYTHON="--without-python"
if [[ $CXXSTD && $CXXSTD -ge 17 ]]; then
# Compile boost with C++14 even if we are using C++17, and disable boost_python.
# See: https://github.com/boostorg/system/issues/26#issuecomment-413631998
CXXSTD=14
unset BOOST_PYTHON
fi
[[ $BOOST_PYTHON ]] || { WITHOUT_PYTHON="--without-python"; unset PYTHON_VERSION; }

TMPB2=$BUILDDIR/tmp-boost-build
case $ARCHITECTURE in
Expand Down Expand Up @@ -53,7 +61,7 @@ b2 -q \
link=shared \
threading=multi \
variant=release \
$EXTRA_CXXFLAGS \
${CXXSTD:+cxxstd=$CXXSTD} \
install
[[ $BOOST_PYTHON ]] && ls -1 "$INSTALLROOT"/lib/*boost_python* > /dev/null

Expand Down Expand Up @@ -83,5 +91,6 @@ module load BASE/1.0 ${GCC_TOOLCHAIN_VERSION:+GCC-Toolchain/$GCC_TOOLCHAIN_VERSI
# Our environment
setenv BOOST_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path LD_LIBRARY_PATH \$::env(BOOST_ROOT)/lib
prepend-path ROOT_INCLUDE_PATH \$::env(BOOST_ROOT)/include
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(BOOST_ROOT)/lib")
EoF
8 changes: 4 additions & 4 deletions defaults-alo.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package: defaults-alo
version: v1
env:
CXXFLAGS: "-fPIC -O2 -std=c++14"
CXXFLAGS: "-fPIC -O2 -std=c++17"
CFLAGS: "-fPIC -O2"
CMAKE_BUILD_TYPE: "RELWITHDEBINFO"
CXXSTD: "14"
CXXSTD: "17"
CMAKE_GENERATOR: "Ninja"
disable:
- AliEn-Runtime
Expand All @@ -24,12 +24,12 @@ overrides:
autotools:
tag: v1.5.0
boost:
tag: "v1.66.0"
tag: "v1.68.0"
requires:
- "GCC-Toolchain:(?!osx)"
- Python-modules
prefer_system_check: |
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106600 || BOOST_VERSION > 106699)\n#error \"Cannot use system's boost: boost 1.66 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106800 || BOOST_VERSION > 106899)\n#error \"Cannot use system's boost: boost 1.68 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
GCC-Toolchain:
tag: v7.3.0-alice1
prefer_system_check: |
Expand Down
8 changes: 4 additions & 4 deletions defaults-o2-dataflow.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package: defaults-o2-dataflow
version: v1
env:
CXXFLAGS: "-fPIC -O2 -std=c++14"
CXXFLAGS: "-fPIC -O2 -std=c++17"
CFLAGS: "-fPIC -O2"
CMAKE_BUILD_TYPE: "RELWITHDEBINFO"
CXXSTD: "14"
CXXSTD: "17"
disable:
- AliEn-Runtime
- AliRoot
Expand All @@ -22,14 +22,14 @@ overrides:
autotools:
tag: v1.5.0
boost:
tag: "v1.66.0"
tag: "v1.68.0"
requires:
- "GCC-Toolchain:(?!osx)"
- Python-modules
- libpng
- lzma
prefer_system_check: |
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106600 || BOOST_VERSION > 106699)\n#error \"Cannot use system's boost: boost 1.66 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106800 || BOOST_VERSION > 106899)\n#error \"Cannot use system's boost: boost 1.68 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
GCC-Toolchain:
tag: v7.3.0-alice1
prefer_system_check: |
Expand Down
8 changes: 4 additions & 4 deletions defaults-o2-dev-fairroot.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package: defaults-o2-dev-fairroot
version: v1
env:
CXXFLAGS: "-fPIC -O2 -std=c++14"
CXXFLAGS: "-fPIC -O2 -std=c++17"
CFLAGS: "-fPIC -O2"
CMAKE_BUILD_TYPE: "RELWITHDEBINFO"
CXXSTD: "14"
CXXSTD: "17"
CMAKE_GENERATOR: "Ninja"
disable:
- AliEn-Runtime
Expand All @@ -13,14 +13,14 @@ overrides:
autotools:
tag: v1.5.0
boost:
tag: "v1.66.0"
tag: "v1.68.0"
requires:
- "GCC-Toolchain:(?!osx)"
- Python-modules
- libpng
- lzma
prefer_system_check: |
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106600 || BOOST_VERSION > 106699)\n#error \"Cannot use system's boost: boost 1.66 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106800 || BOOST_VERSION > 106899)\n#error \"Cannot use system's boost: boost 1.68 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
GCC-Toolchain:
tag: v7.3.0-alice1
prefer_system_check: |
Expand Down
8 changes: 4 additions & 4 deletions defaults-o2-ninja.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package: defaults-o2-ninja
version: v1
env:
CXXFLAGS: "-fPIC -O2 -std=c++14"
CXXFLAGS: "-fPIC -O2 -std=c++17"
CFLAGS: "-fPIC -O2"
CMAKE_BUILD_TYPE: "RELWITHDEBINFO"
CXXSTD: "14"
CXXSTD: "17"
CMAKE_GENERATOR: "Ninja"
disable:
- AliEn-Runtime
Expand All @@ -14,12 +14,12 @@ overrides:
autotools:
tag: v1.5.0
boost:
tag: "v1.66.0"
tag: "v1.68.0"
requires:
- "GCC-Toolchain:(?!osx)"
- Python-modules
prefer_system_check: |
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106600 || BOOST_VERSION > 106699)\n#error \"Cannot use system's boost: boost 1.66 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106800 || BOOST_VERSION > 106899)\n#error \"Cannot use system's boost: boost 1.68 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
GCC-Toolchain:
tag: v7.3.0-alice1
prefer_system_check: |
Expand Down
8 changes: 4 additions & 4 deletions defaults-o2.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package: defaults-o2
version: v1
env:
CXXFLAGS: "-fPIC -O2 -std=c++14"
CXXFLAGS: "-fPIC -O2 -std=c++17"
CFLAGS: "-fPIC -O2"
CMAKE_BUILD_TYPE: "RELWITHDEBINFO"
CXXSTD: "14"
CXXSTD: "17"
disable:
- AliEn-Runtime
- grpc
Expand All @@ -13,12 +13,12 @@ overrides:
autotools:
tag: v1.5.0
boost:
tag: "v1.66.0"
tag: "v1.68.0"
requires:
- "GCC-Toolchain:(?!osx)"
- Python-modules
prefer_system_check: |
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106600 || BOOST_VERSION > 106699)\n#error \"Cannot use system's boost: boost 1.66 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
printf "#include \"boost/version.hpp\"\n# if (BOOST_VERSION < 106800 || BOOST_VERSION > 106899)\n#error \"Cannot use system's boost: boost 1.68 required.\"\n#endif\nint main(){}" | gcc -I$(brew --prefix boost)/include -xc++ - -o /dev/null
GCC-Toolchain:
tag: v7.3.0-alice1
prefer_system_check: |
Expand Down
2 changes: 1 addition & 1 deletion fairroot.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package: FairRoot
version: "%(short_hash)s"
tag: "717dccd866ec07af10db1e021d189e9ff2ce0209"
tag: "acbd45f9d7626b39827953e8c2d6e373700e6c23"
source: https://github.com/FairRootGroup/FairRoot
requires:
- generators
Expand Down
2 changes: 2 additions & 0 deletions geant4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ env:
---
#!/bin/bash -e

[[ $CXXSTD > 14 ]] && CXXSTD=14 || true # Only C++14 is supported at the moment

cmake $SOURCEDIR \
-DGEANT4_INSTALL_DATA_TIMEOUT=2000 \
-DCMAKE_CXX_FLAGS="-fPIC" \
Expand Down
4 changes: 2 additions & 2 deletions vc.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: Vc
version: "%(tag_basename)s"
tag: 1.3.3
source: https://github.com/VcDevel/Vc.git
tag: 1.3.3-alice2
source: https://github.com/alisw/Vc.git
requires:
- "GCC-Toolchain:(?!osx)"
build_requires:
Expand Down
4 changes: 2 additions & 2 deletions yaml-cpp.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: yaml-cpp
version: "v0.5.2"
version: "%(tag_basename)s"
tag: yaml-cpp-0.6.2
source: https://github.com/jbeder/yaml-cpp
tag: release-0.5.2
requires:
- boost
build_requires:
Expand Down

0 comments on commit 8d51812

Please sign in to comment.