Skip to content

Commit

Permalink
Merge pull request #196 from bluescarni/pr/clang17_fix
Browse files Browse the repository at this point in the history
clang 17 fix
  • Loading branch information
bluescarni authored Sep 28, 2024
2 parents 008161a + d7e0c12 commit 78648f1
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 12 deletions.
22 changes: 20 additions & 2 deletions cmake/yacma/YACMACompilerLinkerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ if(NOT _YACMACompilerLinkerSettingsRun)
# Configuration bits specific for GCC.
if(YACMA_COMPILER_IS_GNUCXX)
_YACMA_CHECK_ENABLE_CXX_FLAG(-fdiagnostics-color=auto)
_YACMA_CHECK_ENABLE_CXX_FLAG(-Woverloaded-virtual)
# New in GCC 9.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Waddress-of-packed-member)
endif()
Expand Down Expand Up @@ -109,7 +110,6 @@ if(NOT _YACMACompilerLinkerSettingsRun)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wc99-designator)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wreorder-init-list)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-pointer-div)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class)
# New warnings in clang 11.
Expand All @@ -122,13 +122,31 @@ if(NOT _YACMACompilerLinkerSettingsRun)
# NOTE: this is a new flag in Clang 13 which seems to give
# incorrect warnings for UDLs.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-bounds-pointer-arithmetic)
# New warnings in clang 14.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-parameter)
# NOTE: clang 17 enables by default a new compiler flag called "-fassume-unique-vtables":
#
# https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html#c-language-changes
#
# This flag however seems to be buggy:
#
# https://github.com/llvm/llvm-project/issues/71196
#
# On our part, in several projects we are experiencing Boost.serialization failures when
# (de)serialising derived objects through pointers to bases. Thus, we forcibly disable
# this new flag.
_YACMA_CHECK_ENABLE_CXX_FLAG(-fno-assume-unique-vtables)
endif()

# Common configuration for GCC, clang and Intel.
if(YACMA_COMPILER_IS_CLANGXX OR YACMA_COMPILER_IS_INTELXX OR YACMA_COMPILER_IS_GNUCXX)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wall)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
# NOTE: this flag has been superseded by "-Wdelete-non-virtual-dtor"
# (enabled by "-Wall"). See:
# https://gcc.gnu.org/pipermail/gcc-cvs/2022-November/374730.html
# _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
# NOTE: this flag is a bit too chatty, let's disable it for the moment.
#_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnoexcept)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wlogical-op)
Expand Down
10 changes: 10 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
Changelog
=========

6.0.1 (unreleased)
------------------

Fix
~~~

- Workaround for a clang 17 issue that would result in
runtime exceptions during (de)serialisation
(`#196 <https://github.com/bluescarni/heyoka.py/pull/196>`__).

6.0.0 (2024-09-21)
------------------

Expand Down
2 changes: 1 addition & 1 deletion tools/circleci_conda_heyoka_head_310.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bash miniforge.sh -b -p $HOME/miniforge
# using deprecated scipy functions.
conda create -y -p $deps_dir python=3.10 c-compiler cxx-compiler git pybind11 'numpy<2' \
mpmath cmake llvmdev tbb-devel tbb astroquery libboost-devel 'mppp=1.*' \
sleef 'fmt<11' skyfield spdlog myst-nb matplotlib sympy 'scipy<1.14' pykep cloudpickle \
sleef fmt skyfield spdlog myst-nb matplotlib sympy 'scipy<1.14' pykep cloudpickle \
'sphinx=7.*' 'sphinx-book-theme=1.*'
source activate $deps_dir

Expand Down
2 changes: 1 addition & 1 deletion tools/circleci_conda_heyoka_head_312.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
export deps_dir=$HOME/local
export PATH="$HOME/miniforge/bin:$PATH"
bash miniforge.sh -b -p $HOME/miniforge
conda create -y -p $deps_dir python=3.12 c-compiler cxx-compiler git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef 'fmt<11' skyfield spdlog sympy cloudpickle
conda create -y -p $deps_dir python=3.12 c-compiler cxx-compiler git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef fmt skyfield spdlog sympy cloudpickle
source activate $deps_dir

# Checkout, build and install heyoka's HEAD.
Expand Down
2 changes: 1 addition & 1 deletion tools/circleci_conda_heyoka_head_39.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
export deps_dir=$HOME/local
export PATH="$HOME/miniforge/bin:$PATH"
bash miniforge.sh -b -p $HOME/miniforge
conda create -y -p $deps_dir python=3.9 c-compiler cxx-compiler git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb astroquery libboost-devel 'mppp=1.*' sleef 'fmt<11' skyfield spdlog myst-nb matplotlib sympy scipy pykep cloudpickle 'sphinx=7.*' 'sphinx-book-theme=1.*'
conda create -y -p $deps_dir python=3.9 c-compiler cxx-compiler git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb astroquery libboost-devel 'mppp=1.*' sleef fmt skyfield spdlog myst-nb matplotlib sympy scipy pykep cloudpickle 'sphinx=7.*' 'sphinx-book-theme=1.*'
source activate $deps_dir

export HEYOKA_PY_PROJECT_DIR=`pwd`
Expand Down
2 changes: 1 addition & 1 deletion tools/circleci_ubuntu_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
export deps_dir=$HOME/local
export PATH="$HOME/miniforge/bin:$PATH"
bash miniforge.sh -b -p $HOME/miniforge
conda create -y -q -p $deps_dir cxx-compiler c-compiler cmake llvmdev tbb-devel tbb astroquery libboost-devel 'mppp=1.*' sleef 'fmt<11' skyfield spdlog python=3.10 pybind11 'numpy<2' mpmath sympy scipy cloudpickle myst-nb matplotlib 'sphinx=7.*' 'sphinx-book-theme=1.*'
conda create -y -q -p $deps_dir cxx-compiler c-compiler cmake llvmdev tbb-devel tbb astroquery libboost-devel 'mppp=1.*' sleef fmt skyfield spdlog python=3.10 pybind11 'numpy<2' mpmath sympy scipy cloudpickle myst-nb matplotlib 'sphinx=7.*' 'sphinx-book-theme=1.*'
source activate $deps_dir

# Checkout, build and install heyoka's HEAD.
Expand Down
2 changes: 1 addition & 1 deletion tools/gha_conda_asan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create -y -q -p $deps_dir python=3.10 git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef 'fmt<11' skyfield spdlog sympy cloudpickle c-compiler cxx-compiler
conda create -y -q -p $deps_dir python=3.10 git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef fmt skyfield spdlog sympy cloudpickle c-compiler cxx-compiler
source activate $deps_dir

export CXXFLAGS="$CXXFLAGS -fsanitize=address"
Expand Down
2 changes: 1 addition & 1 deletion tools/gha_conda_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bash miniforge.sh -b -p $HOME/miniforge
# using deprecated scipy functions.
conda create -y -p $deps_dir c-compiler cxx-compiler python=3.10 git pybind11 \
ninja 'numpy<2' mpmath cmake llvmdev tbb-devel tbb astroquery libboost-devel \
'mppp=1.*' sleef 'fmt<11' skyfield spdlog myst-nb matplotlib sympy 'scipy<1.14' pykep cloudpickle \
'mppp=1.*' sleef fmt skyfield spdlog myst-nb matplotlib sympy 'scipy<1.14' pykep cloudpickle \
'sphinx=7.*' 'sphinx-book-theme=1.*'
source activate $deps_dir

Expand Down
2 changes: 1 addition & 1 deletion tools/gha_conda_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create -y -q -p $deps_dir python=3.10 git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef 'fmt<11' skyfield spdlog sympy cloudpickle c-compiler cxx-compiler numba zlib
conda create -y -q -p $deps_dir python=3.10 git pybind11 'numpy<2' mpmath cmake llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef fmt skyfield spdlog sympy cloudpickle c-compiler cxx-compiler numba zlib
source activate $deps_dir

# Checkout, build and install heyoka's HEAD.
Expand Down
2 changes: 1 addition & 1 deletion tools/gha_osx_heyoka_head.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir python=3.11 'c-compiler<1.8' 'cxx-compiler<1.8' git pybind11 'numpy<2' cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef 'fmt<11' skyfield spdlog sympy cloudpickle 'mppp=1.*'
conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield spdlog sympy cloudpickle 'mppp=1.*'
source activate $deps_dir

# Checkout, build and install heyoka's HEAD.
Expand Down
2 changes: 1 addition & 1 deletion tools/gha_osx_heyoka_head_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir python=3.11 'c-compiler<1.8' 'cxx-compiler<1.8' git pybind11 'numpy<2' cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef 'fmt<11' skyfield spdlog sympy cloudpickle 'mppp=1.*' numba
conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield spdlog sympy cloudpickle 'mppp=1.*' numba
source activate $deps_dir

# Checkout, build and install heyoka's HEAD.
Expand Down
2 changes: 1 addition & 1 deletion tools/travis_ubuntu_ppc64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ curl -L -o miniconda.sh https://github.com/conda-forge/miniforge/releases/latest
export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -q -p $deps_dir cxx-compiler c-compiler cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef xtensor xtensor-blas blas blas-devel 'fmt<11' skyfield spdlog python pybind11 'numpy<2' mpmath sympy cloudpickle mppp git make
conda create -y -q -p $deps_dir cxx-compiler c-compiler cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef xtensor xtensor-blas blas blas-devel fmt skyfield spdlog python pybind11 'numpy<2' mpmath sympy cloudpickle mppp git make
source activate $deps_dir

# Checkout, build and install heyoka's HEAD.
Expand Down

0 comments on commit 78648f1

Please sign in to comment.