Skip to content

Commit

Permalink
Merge pull request #68 from megaserg/patch-1
Browse files Browse the repository at this point in the history
chore(build): fix wheels build actions
  • Loading branch information
doublethefish authored Nov 27, 2024
2 parents 7f7f689 + 918a1a1 commit afbcaa6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ jobs:
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install cibuildwheel
run: pipx install cibuildwheel==2.12.0
run: pipx install cibuildwheel==2.22.0
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64 \
| jq -nRc '{"only": inputs, "os": "macos-13"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch arm64 \
| jq -nRc '{"only": inputs, "os": "macos-14"}' \
&& cibuildwheel --print-build-identifiers --platform windows \
| jq -nRc '{"only": inputs, "os": "windows-latest"}'
} | jq -sc
Expand All @@ -35,21 +37,14 @@ jobs:
matrix:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
steps:
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.11.2
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
uses: pypa/cibuildwheel@v2.22.0
with:
package-dir: ./
output-dir: ./wheelhouse
only: ${{ matrix.only }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.only }}
path: ./wheelhouse/*.whl

16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /permissive /std:c++17")
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /permissive /std:c++17 /wd4068 /wd4305 /wd4267 /wd4244")

if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(OpenMP_C_FLAGS "-Wno-unused-command-line-argument")
set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(OpenMP_CXX_FLAGS "-Wno-unused-command-line-argument")
set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
endif()
else()
# Set O2 optimisations, the more stable option
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
Expand Down
4 changes: 2 additions & 2 deletions src/_tmap/cereal/types/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace cereal
template <class Archive, class ... Types> inline
static void apply( Archive & ar, std::tuple<Types...> & tuple )
{
serialize<Height - 1>::template apply( ar, tuple );
serialize<Height - 1>::template apply<>( ar, tuple );
ar( CEREAL_NVP_(tuple_element_name<Height - 1>::c_str(),
std::get<Height - 1>( tuple )) );
}
Expand All @@ -116,7 +116,7 @@ namespace cereal
template <class Archive, class ... Types> inline
void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::tuple<Types...> & tuple )
{
tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply( ar, tuple );
tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply<>( ar, tuple );
}
} // namespace cereal

Expand Down

0 comments on commit afbcaa6

Please sign in to comment.