From 61ea8f5d4f5f277b88e10fdf972eb2a19cf8766f Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Fri, 12 Jan 2024 09:09:47 +0100 Subject: [PATCH 1/4] Try to see where Windows breaks --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c5ce56a4d..90c7a9bee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,6 +15,7 @@ jobs: include: - os: ubuntu-20.04 - os: macos-11 + - os: windows-2019 steps: - uses: actions/checkout@v3 From be376547a3998325e666d4fc4dab9e46b1b8f037 Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Fri, 12 Jan 2024 09:12:15 +0100 Subject: [PATCH 2/4] Also add to build-wheels --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index bbe38839a..80d32f26d 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: # TODO: add windows builder - os: [ubuntu-20.04, macos-11] + os: [ubuntu-20.04, macos-11, windows-2019] steps: - uses: actions/checkout@v3 From 2b627cb85a391728b5be17458958ff56c2e4a0b1 Mon Sep 17 00:00:00 2001 From: Luthaf Date: Thu, 18 Jan 2024 14:04:13 +0100 Subject: [PATCH 3/4] Fix build with MSVC --- sphericart/include/templates.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sphericart/include/templates.hpp b/sphericart/include/templates.hpp index f620b69ae..18a3f4b0b 100644 --- a/sphericart/include/templates.hpp +++ b/sphericart/include/templates.hpp @@ -15,7 +15,14 @@ */ #include -#include + +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 +#endif + +#ifndef M_SQRT1_2 +#define M_SQRT1_2 0.707106781186547524400844362104849039 +#endif #ifdef _OPENMP @@ -303,7 +310,8 @@ void hardcoded_sph( T *ddsph_i = nullptr; #pragma omp for - for (size_t i_sample = 0; i_sample < n_samples; i_sample++) { + for (int64_t i_sample = 0; i_sample < static_cast(n_samples); + i_sample++) { // gets pointers to the current sample input and output arrays xyz_i = xyz + i_sample * 3; sph_i = sph + i_sample * size_y; @@ -1058,7 +1066,8 @@ void generic_sph(const T *xyz, T *sph, [[maybe_unused]] T *dsph, T *ddsph_i = nullptr; #pragma omp for - for (size_t i_sample = 0; i_sample < n_samples; i_sample++) { + for (int64_t i_sample = 0; i_sample < static_cast(n_samples); + i_sample++) { auto xyz_i = xyz + i_sample * 3; // pointer to the segment that should store the i_sample sph sph_i = sph + i_sample * size_y; From 67ba83782c3cabe2b7f5ad412bfe886811cbb84e Mon Sep 17 00:00:00 2001 From: Luthaf Date: Thu, 18 Jan 2024 14:06:29 +0100 Subject: [PATCH 4/4] Fix warnings about unused parameters --- sphericart/src/sphericart_cuda_stub.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sphericart/src/sphericart_cuda_stub.cpp b/sphericart/src/sphericart_cuda_stub.cpp index 2f1090de1..8cf213c62 100644 --- a/sphericart/src/sphericart_cuda_stub.cpp +++ b/sphericart/src/sphericart_cuda_stub.cpp @@ -10,10 +10,11 @@ SphericalHarmonics::SphericalHarmonics(size_t l_max, bool normalized) {} template SphericalHarmonics::~SphericalHarmonics() {} template -void SphericalHarmonics::compute(const T *xyz, const size_t nsamples, - bool compute_with_gradients, - bool compute_with_hessian, T *sph, T *dsph, - T *ddsph, void *cuda_stream) { +void SphericalHarmonics::compute(const T * /*xyz*/, size_t /*nsamples*/, + bool /*compute_with_gradients*/, + bool /*compute_with_hessian*/, T * /*sph*/, + T * /*dsph*/, T * /*ddsph*/, + void * /*cuda_stream*/) { throw std::runtime_error("sphericart was not compiled with CUDA support"); }