From fd0f1506f80333cd7b926cf30d26b66e41c3f673 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sat, 25 Mar 2023 20:43:01 -0700 Subject: [PATCH 1/3] CI: macOS AppleClang12 Fixes CI already runs on macOS-12. Adds an older runner. --- .github/workflows/macos.yml | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 56603c4c8a..86b1799194 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,7 +12,7 @@ jobs: # appleclang10_py37_h5_ad2_libcpp # appleclang11_nopy_nompi_h5_ad2 - appleclang12_py_mpi_h5_ad2: + appleclang14_py_mpi_h5_ad2: runs-on: macos-latest if: github.event.pull_request.draft == false steps: @@ -28,11 +28,10 @@ jobs: python3 -m pip install -U mpi4py numpy pandas set -e - name: Build - env: {CXXFLAGS: -Werror -DTOML11_DISABLE_STD_FILESYSTEM, MACOSX_DEPLOYMENT_TARGET: 10.13} - # C++11 & 14 support in macOS 10.9+ - # C++17 support in macOS 10.13+/10.14+ + env: {CXXFLAGS: -Werror, MACOSX_DEPLOYMENT_TARGET: 10.15} + # 10.14+ due to std::visit + # 10.15+ due to std::filesystem in toml11 # https://cibuildwheel.readthedocs.io/en/stable/cpp_standards/#macos-and-deployment-target-versions - # std::filesystem needs macOS 10.15 run: | share/openPMD/download_samples.sh build cmake -S . -B build \ @@ -44,5 +43,33 @@ jobs: cmake --build build --parallel 2 ctest --test-dir build --verbose + appleclang12_py: + runs-on: macos-10.15 + # next: macOS-11 + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + - name: Install + run: | + rm -rf /usr/local/bin/2to3 + set +e + python3 -m pip install -U mpi4py numpy pandas + set -e + - name: Build + env: {CXXFLAGS: -Werror -DTOML11_DISABLE_STD_FILESYSTEM, MACOSX_DEPLOYMENT_TARGET: 10.14} + # 10.14+ due to std::visit + # std::filesystem in toml11 needs macOS 10.15 + # https://cibuildwheel.readthedocs.io/en/stable/cpp_standards/#macos-and-deployment-target-versions + run: | + share/openPMD/download_samples.sh build + cmake -S . -B build \ + -DopenPMD_USE_PYTHON=ON \ + -DopenPMD_USE_MPI=OFF \ + -DopenPMD_USE_HDF5=OFF \ + -DopenPMD_USE_ADIOS2=OFF \ + -DopenPMD_USE_INVASIVE_TESTS=ON + cmake --build build --parallel 2 + ctest --test-dir build --verbose + # TODO: apple_conda_ompi_all (similar to conda_ompi_all on Linux) # both OpenMPI and MPICH cause startup (MPI_Init) issues on GitHub Actions From a1aac530dbc8261656cf6a07900374bc6ac6fcab Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sat, 25 Mar 2023 21:00:09 -0700 Subject: [PATCH 2/3] Fix: Older AppleClang Issue seen with AppleClang 12.0 and not seen with 14.0. Assume 13 might be affected, too. --- include/openPMD/RecordComponent.tpp | 9 +++++++-- include/openPMD/backend/PatchRecordComponent.hpp | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/openPMD/RecordComponent.tpp b/include/openPMD/RecordComponent.tpp index 1df93875b5..2f12a5cf2d 100644 --- a/include/openPMD/RecordComponent.tpp +++ b/include/openPMD/RecordComponent.tpp @@ -28,6 +28,9 @@ #include "openPMD/auxiliary/TypeTraits.hpp" #include "openPMD/auxiliary/UniquePtr.hpp" +#include + + namespace openPMD { template< typename T > @@ -80,7 +83,8 @@ inline std::shared_ptr< T > RecordComponent::loadChunk( for( auto const& dimensionSize : extent ) numPoints *= dimensionSize; -#if defined(__clang_major__) && __clang_major__ < 7 +#if (defined(__clang_major__) && __clang_major__ < 7) || \ + (defined(__apple_build_version__) && __clang_major__ < 14) auto newData = std::shared_ptr(new T[numPoints], [](T *p) { delete[] p; }); loadChunk(newData, offset, extent); @@ -374,7 +378,8 @@ RecordComponent::storeChunk( Offset offset, Extent extent ) std::move( extent ), []( size_t size ) { -#if defined(__clang_major__) && __clang_major__ < 7 +#if (defined(__clang_major__) && __clang_major__ < 7) || \ + (defined(__apple_build_version__) && __clang_major__ < 14) return std::shared_ptr< T >{ new T[ size ], []( auto * ptr ) { delete[] ptr; } }; #else diff --git a/include/openPMD/backend/PatchRecordComponent.hpp b/include/openPMD/backend/PatchRecordComponent.hpp index 51537b0071..dfed6107d8 100644 --- a/include/openPMD/backend/PatchRecordComponent.hpp +++ b/include/openPMD/backend/PatchRecordComponent.hpp @@ -23,6 +23,7 @@ #include "openPMD/auxiliary/ShareRawInternal.hpp" #include "openPMD/backend/BaseRecordComponent.hpp" +#include #include #include #include @@ -144,7 +145,8 @@ template inline std::shared_ptr PatchRecordComponent::load() { uint64_t numPoints = getExtent()[0]; -#if defined(__clang_major__) && __clang_major__ < 7 +#if (defined(__clang_major__) && __clang_major__ < 7) || \ + (defined(__apple_build_version__) && __clang_major__ < 14) auto newData = std::shared_ptr(new T[numPoints], [](T *p) { delete[] p; }); load(newData); From 2f9ed527e1a9138346b19a22b5f89a4954bebf9b Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sat, 25 Mar 2023 23:03:20 -0700 Subject: [PATCH 3/3] macOS CI: Numpy Install --- .github/workflows/macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 86b1799194..d1ab637f3e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -51,9 +51,8 @@ jobs: - uses: actions/checkout@v3 - name: Install run: | - rm -rf /usr/local/bin/2to3 set +e - python3 -m pip install -U mpi4py numpy pandas + python3 -m pip install -U numpy pandas set -e - name: Build env: {CXXFLAGS: -Werror -DTOML11_DISABLE_STD_FILESYSTEM, MACOSX_DEPLOYMENT_TARGET: 10.14}