Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
36 changes: 31 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 \
Expand All @@ -44,5 +43,32 @@ 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: |
set +e
python3 -m pip install -U 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
9 changes: 7 additions & 2 deletions include/openPMD/RecordComponent.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#include "openPMD/auxiliary/TypeTraits.hpp"
#include "openPMD/auxiliary/UniquePtr.hpp"

#include <memory>


namespace openPMD
{
template< typename T >
Expand Down Expand Up @@ -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<T>(new T[numPoints], [](T *p) { delete[] p; });
loadChunk(newData, offset, extent);
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion include/openPMD/backend/PatchRecordComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "openPMD/auxiliary/ShareRawInternal.hpp"
#include "openPMD/backend/BaseRecordComponent.hpp"

#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
Expand Down Expand Up @@ -144,7 +145,8 @@ template <typename T>
inline std::shared_ptr<T> 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<T>(new T[numPoints], [](T *p) { delete[] p; });
load(newData);
Expand Down