Dev/win compile (#402)
Build on RHEL9 / build (push) Successful in 3m13s
Build on RHEL8 / build (push) Successful in 3m48s
Run tests using data on local RHEL8 / build (push) Failing after 4m38s
Build on local RHEL8 / build (push) Successful in 3m18s

Collection of fixes to make aare build on Windows. Requires the previous
PRs for compilation to succeed.

- Replaced `or` keyword with ||
- updated cmake file
- fix for 32 bit long in fseek

closes #395 
closes #396
This commit is contained in:
Erik Fröjdh
2026-10-05 19:13:45 +02:00
committed by GitHub
parent 060a0ec9e7
commit 7e1b8a765d
12 changed files with 85 additions and 45 deletions
+6 -6
View File
@@ -124,7 +124,7 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
.def_property_readonly(
"fmt",
[typestr](ClusterVector<ClusterType> &self) {
return fmt_format<ClusterType>;
return fmt_format<ClusterType>();
},
"PEP 3118 format string for one stored cluster.")
@@ -145,11 +145,11 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
.def_buffer(
[typestr](ClusterVector<ClusterType> &self) -> py::buffer_info {
return py::buffer_info(
self.data(), /* Pointer to buffer */
self.item_size(), /* Size of one scalar */
fmt_format<ClusterType>, /* Format descriptor */
1, /* Number of dimensions */
{self.size()}, /* Buffer dimensions */
self.data(), /* Pointer to buffer */
self.item_size(), /* Size of one scalar */
fmt_format<ClusterType>(), /* Format descriptor */
1, /* Number of dimensions */
{self.size()}, /* Buffer dimensions */
{self.item_size()} /* Strides (in bytes) for each index */
);
});
+7 -2
View File
@@ -112,8 +112,13 @@ struct fmt_format_trait<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> {
}
};
template <typename ClusterType>
auto fmt_format = fmt_format_trait<ClusterType>::value();
// Function-local static rather than a variable template: MSVC does not run
// the dynamic initializer of a variable template instantiated from inside
// another template, which left the format string empty.
template <typename ClusterType> const std::string &fmt_format() {
static const std::string value = fmt_format_trait<ClusterType>::value();
return value;
}
/**
* Helper function to allocate image data given item size and shape