Skip to content

Commit

Permalink
Merge pull request #462 from bluescarni/pr/mppp_update
Browse files Browse the repository at this point in the history
Enable support for mp++ 2
bluescarni authored Dec 16, 2024
2 parents 5c7e804 + b4a355d commit ecdf999
Showing 24 changed files with 124 additions and 84 deletions.
10 changes: 0 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -2,15 +2,6 @@
version: 2.1

jobs:
conda_asan:
docker:
- image: cimg/base:current
resource_class: large
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_conda_asan.sh
ubuntu_arm64:
machine:
image: ubuntu-2204:current
@@ -25,5 +16,4 @@ workflows:
version: 2.1
all_builds:
jobs:
- conda_asan
- ubuntu_arm64
13 changes: 12 additions & 1 deletion .github/workflows/gha_ci.yml
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ jobs:
- name: Build
shell: pwsh
run: |
conda install -y cmake llvmdev tbb-devel tbb libboost-devel xtensor xtensor-blas blas blas-devel fmt spdlog sleef zlib libzlib 'mppp=1.*'
conda install -y cmake llvmdev tbb-devel tbb libboost-devel xtensor xtensor-blas blas blas-devel fmt spdlog sleef zlib libzlib mppp
mkdir build
cd build
cmake ../ -G "Visual Studio 17 2022" -A x64 -DHEYOKA_BUILD_TESTS=yes -DHEYOKA_WITH_MPPP=yes -DHEYOKA_BUILD_TUTORIALS=ON -DHEYOKA_ENABLE_IPO=yes -DHEYOKA_WITH_SLEEF=yes
@@ -81,6 +81,17 @@ jobs:
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_conda_ubsan.sh
conda_asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_conda_asan.sh
# Upload the docs.
- uses: actions/upload-artifact@v4
with:
name: docs
path: doc/_build/html
conda_llvm18_asan:
runs-on: ubuntu-latest
steps:
52 changes: 52 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and upload docs

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Make this workflow depend on the other one.
workflow_run:
workflows:
- "GitHub CI"
types:
- success

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs
- name: Upload docs
uses: actions/upload-pages-artifact@v3
with:
path: './doc/_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
34 changes: 15 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

project(heyoka VERSION 6.1.0 LANGUAGES CXX C)
project(heyoka VERSION 7.0.0 LANGUAGES CXX C)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma")

@@ -130,16 +130,6 @@ if(YACMA_COMPILER_IS_MSVC)
list(APPEND HEYOKA_CXX_FLAGS_DEBUG "/wd4459" "/wd4127" "/wd4251" "/wd4661")
list(APPEND HEYOKA_CXX_FLAGS_RELEASE "/wd4459" "/wd4127" "/wd4251" "/wd4661")
endif()
# Enable strict conformance mode, if supported.
set(CMAKE_REQUIRED_QUIET TRUE)
check_cxx_compiler_flag("/permissive-" _HEYOKA_MSVC_SUPPORTS_STRICT_CONFORMANCE)
unset(CMAKE_REQUIRED_QUIET)
if(_HEYOKA_MSVC_SUPPORTS_STRICT_CONFORMANCE)
message(STATUS "The '/permissive-' flag is supported, enabling it.")
list(APPEND HEYOKA_CXX_FLAGS_DEBUG "/permissive-")
list(APPEND HEYOKA_CXX_FLAGS_RELEASE "/permissive-")
endif()
unset(_HEYOKA_MSVC_SUPPORTS_STRICT_CONFORMANCE)
endif()

# Mandatory dependency on LLVM.
@@ -162,6 +152,9 @@ if(${LLVM_VERSION_MAJOR} LESS 15 OR ${LLVM_VERSION_MAJOR} GREATER 19)
message(FATAL_ERROR "LLVM >= 15 and <= 19 is required.")
endif()

message(STATUS "LLVM definitions: ${LLVM_DEFINITIONS}")
message(STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}")

# List of source files.
set(HEYOKA_SRC_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/src/taylor_00.cpp"
@@ -337,7 +330,7 @@ if(HEYOKA_WITH_SLEEF)
endif()

# Setup the heyoka ABI version number.
set(HEYOKA_ABI_VERSION 31)
set(HEYOKA_ABI_VERSION 32)

if(HEYOKA_BUILD_STATIC_LIBRARY)
# Setup of the heyoka static library.
@@ -362,7 +355,7 @@ target_compile_options(heyoka PRIVATE

# Ensure that C++20 is employed when both compiling and consuming heyoka.
target_compile_features(heyoka PUBLIC cxx_std_20)
# Enforce vanilla C++17 when compiling heyoka.
# Enforce vanilla C++ when compiling heyoka.
set_property(TARGET heyoka PROPERTY CXX_EXTENSIONS NO)

target_include_directories(heyoka PUBLIC
@@ -387,9 +380,6 @@ endif()
# Add a define to signal that we are building the library.
target_compile_definitions(heyoka PRIVATE HEYOKA_BUILD_LIBRARY)

message(STATUS "LLVM definitions: ${LLVM_DEFINITIONS}")
message(STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}")

# Define an interface target for linking to the LLVM bits.
add_library(heyoka_llvm_internal INTERFACE)
# Add the definitions required by LLVM.
@@ -536,9 +526,14 @@ if(APPLE AND Boost_VERSION VERSION_LESS "1.81.0")
endif()

# Optional dependency on mp++.
set(_HEYOKA_MPPP_VERSION "1.0.0")
set(_HEYOKA_MIN_SUPPORTED_MPPP_VERSION 2)
set(_HEYOKA_MAX_SUPPORTED_MPPP_VERSION 2)
if(HEYOKA_WITH_MPPP)
find_package(mp++ ${_HEYOKA_MPPP_VERSION} REQUIRED CONFIG)
find_package(mp++ REQUIRED CONFIG)
if(${mp++_VERSION_MAJOR} VERSION_LESS ${_HEYOKA_MIN_SUPPORTED_MPPP_VERSION} OR
${mp++_VERSION_MAJOR} VERSION_GREATER ${_HEYOKA_MAX_SUPPORTED_MPPP_VERSION})
message(FATAL_ERROR "The supported mp++ versions are in the range [${_HEYOKA_MIN_SUPPORTED_MPPP_VERSION}, ${_HEYOKA_MAX_SUPPORTED_MPPP_VERSION}], but version ${mp++_VERSION_MAJOR} was found instead.")
endif()
message(STATUS "mp++ version: ${mp++_VERSION}")

# NOTE: this is necessary for the serialisation of several classes.
@@ -602,7 +597,8 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/heyoka-config-version.cmake" DESTINAT

# Cleanup.
unset(_HEYOKA_MIN_BOOST_VERSION)
unset(_HEYOKA_MPPP_VERSION)
unset(_HEYOKA_MIN_SUPPORTED_MPPP_VERSION)
unset(_HEYOKA_MAX_SUPPORTED_MPPP_VERSION)
unset(_HEYOKA_WITH_REAL128)
unset(_HEYOKA_WITH_REAL)
unset(_HEYOKA_LLVM_STATIC_LINK)
4 changes: 4 additions & 0 deletions cmake/yacma/YACMACompilerLinkerSettings.cmake
Original file line number Diff line number Diff line change
@@ -210,6 +210,10 @@ if(NOT _YACMACompilerLinkerSettingsRun)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)
# Treat warnings as errors.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)
# Strict conformance mode.
_YACMA_CHECK_ENABLE_CXX_FLAG(/permissive-)
# Strict preprocessor conformance mode.
_YACMA_CHECK_ENABLE_CXX_FLAG(/Zc:preprocessor)
endif()

# Set the cache variables.
10 changes: 10 additions & 0 deletions doc/breaking_changes.rst
Original file line number Diff line number Diff line change
@@ -3,6 +3,16 @@
Breaking changes
================

.. _bchanges_7_0_0:

7.0.0
-----

General
~~~~~~~

heyoka now requires mp++ version 2.

.. _bchanges_6_0_0:

6.0.0
10 changes: 10 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
=========

7.0.0 (unreleased)
------------------

Changes
~~~~~~~

- **BREAKING**: heyoka now requires mp++ version 2
(`#462 <https://github.com/bluescarni/heyoka/pull/462>`__).
This is a :ref:`breaking change <bchanges_7_0_0>`.

6.1.0 (2024-10-10)
------------------

2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ Additionally, heyoka has the following **optional** dependencies:
an mp++ installation with support for Boost.serialization and for the
{fmt} library
(see the :ref:`mp++ installation instructions <mppp:installation>`).
heyoka currently requires mp++ 1.x;
heyoka currently requires mp++ 2.x;
* the `SLEEF <https://sleef.org/>`__ vectorized math library (improves the performance
of integrations in batch mode),
* the `xtensor and xtensor-blas <https://xtensor.readthedocs.io/en/latest/>`__
6 changes: 5 additions & 1 deletion heyoka-config.cmake.in
Original file line number Diff line number Diff line change
@@ -37,7 +37,11 @@ endif()

# Optional public dependency on mp++.
if(${heyoka_WITH_MPPP})
find_package(mp++ @_HEYOKA_MPPP_VERSION@ REQUIRED CONFIG)
find_package(mp++ REQUIRED CONFIG)
if(${mp++_VERSION_MAJOR} VERSION_LESS @_HEYOKA_MIN_SUPPORTED_MPPP_VERSION@ OR
${mp++_VERSION_MAJOR} VERSION_GREATER @_HEYOKA_MAX_SUPPORTED_MPPP_VERSION@)
message(FATAL_ERROR "The supported mp++ versions are in the range [@_HEYOKA_MIN_SUPPORTED_MPPP_VERSION@, @_HEYOKA_MAX_SUPPORTED_MPPP_VERSION@], but version ${mp++_VERSION_MAJOR} was found instead.")
endif()

# NOTE: this is necessary for the serialisation of several classes.
if(NOT mp++_WITH_BOOST_S11N)
2 changes: 1 addition & 1 deletion src/detail/llvm_helpers.cpp
Original file line number Diff line number Diff line change
@@ -437,7 +437,7 @@ llvm::CallInst *llvm_add_vfabi_attrs(llvm_state &s, llvm::CallInst *call, const

// Ensure that the variant is not optimised out because it is not
// explicitly used in the code.
detail::llvm_append_used(s, vf_ptr);
llvm_append_used(s, vf_ptr);
}

// Restore the original insertion block.
2 changes: 1 addition & 1 deletion tools/circleci_ubuntu_arm64.sh
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir cxx-compiler c-compiler cmake \
ninja llvmdev tbb-devel tbb libboost-devel sleef xtensor \
xtensor-blas blas blas-devel fmt spdlog 'mppp=1.*'
xtensor-blas blas blas-devel fmt spdlog mppp
source activate $deps_dir

# Create the build dir and cd into it.
39 changes: 1 addition & 38 deletions tools/circleci_conda_asan.sh → tools/gha_conda_asan.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler cmake \
llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor \
llvmdev tbb-devel tbb libboost-devel mppp sleef xtensor \
xtensor-blas blas blas-devel fmt spdlog ninja \
'sphinxcontrib-bibtex=2.6.*' 'sphinx=7.*' 'sphinx-book-theme=1.*'
source activate $deps_dir
@@ -55,42 +55,5 @@ if [[ "${SPHINX_OUTPUT}" != "" ]]; then
fi
echo "Sphinx ran successfully";

if [[ ! -z "${CI_PULL_REQUEST}" ]]; then
echo "Testing a pull request, the generated documentation will not be uploaded.";
exit 0;
fi

if [[ "${CIRCLE_BRANCH}" != "master" ]]; then
echo "Branch is not master, the generated documentation will not be uploaded.";
exit 0;
fi

# Check out the gh_pages branch in a separate dir.
cd ../
git config --global push.default simple
git config --global user.name "CircleCI"
git config --global user.email "bluescarni@gmail.com"
set +x
git clone "https://${GH_TOKEN}@github.com/bluescarni/heyoka.git" heyoka_gh_pages -q
set -x
cd heyoka_gh_pages
git checkout -b gh-pages --track origin/gh-pages;
git rm -fr *;
mv ../doc/_build/html/* .;
git add *;
# We assume here that a failure in commit means that there's nothing
# to commit.
git commit -m "Update Sphinx documentation, commit ${CIRCLE_SHA1} [skip ci]." || exit 0
PUSH_COUNTER=0
until git push -q
do
git pull -q
PUSH_COUNTER=$((PUSH_COUNTER + 1))
if [ "$PUSH_COUNTER" -gt 3 ]; then
echo "Push failed, aborting.";
exit 1;
fi
done

set +e
set +x
2 changes: 1 addition & 1 deletion tools/gha_conda_clang_tidy.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir cmake c-compiler cxx-compiler clang clangxx \
clang-tools llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef fmt spdlog ninja
clang-tools llvmdev tbb-devel tbb libboost-devel mppp sleef fmt spdlog ninja
source activate $deps_dir

# Create the build dir and cd into it.
2 changes: 1 addition & 1 deletion tools/gha_conda_coverage.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler ninja cmake \
llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor \
llvmdev tbb-devel tbb libboost-devel mppp sleef xtensor \
xtensor-blas blas blas-devel fmt spdlog lcov
source activate $deps_dir

2 changes: 1 addition & 1 deletion tools/gha_conda_release.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler ninja cmake \
llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor \
llvmdev tbb-devel tbb libboost-devel mppp sleef xtensor \
xtensor-blas blas blas-devel fmt spdlog
source activate $deps_dir

2 changes: 1 addition & 1 deletion tools/gha_conda_release_static.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler ninja cmake \
llvmdev tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor xtensor-blas \
llvmdev tbb-devel tbb libboost-devel mppp sleef xtensor xtensor-blas \
blas blas-devel fmt spdlog zlib
source activate $deps_dir

2 changes: 1 addition & 1 deletion tools/gha_conda_ubsan.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler cmake llvmdev \
tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor xtensor-blas \
tbb-devel tbb libboost-devel mppp sleef xtensor xtensor-blas \
blas blas-devel fmt spdlog ninja
source activate $deps_dir

2 changes: 1 addition & 1 deletion tools/gha_llvm15_conda_asan.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler cmake ninja 'llvmdev=15.*' \
tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor xtensor-blas blas \
tbb-devel tbb libboost-devel mppp sleef xtensor xtensor-blas blas \
blas-devel fmt spdlog
source activate $deps_dir

2 changes: 1 addition & 1 deletion tools/gha_llvm16_conda_asan.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda create -y -p $deps_dir c-compiler cxx-compiler cmake ninja 'llvmdev=16.*' \
tbb-devel tbb libboost-devel 'mppp=1.*' sleef xtensor xtensor-blas blas \
tbb-devel tbb libboost-devel mppp sleef xtensor xtensor-blas blas \
blas-devel fmt spdlog
source activate $deps_dir

Loading

0 comments on commit ecdf999

Please sign in to comment.