-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build failure on 32 bit architectures: error: conversion from 'hsize_t' {aka 'long long unsigned int'} to 'size_t' {aka 'unsigned int'} may change value [-Werror=conversion] #443
Comments
Hi @sanjayankur31 and thanks for reporting it. |
Hi @ferdonline , thanks for your reply. It isn't on my backlog at the moment. It'll be best to add it to the project backlog, and if/when I do find the time to work on a fix, I'll open a PR. For the time being, we've excluded the 32 bit arches for highfive (and so all the software that depends on it). Our downstream tracker bug is here: |
Explicitly casts long long unsigned int to size_t Fixes BlueBrain#443
Note: I've fixed the issues on i686, but ran into another while testing on armv7hl. I'll have to find a test machine to work on that. |
Explicitly casts long long unsigned int to size_t Fixes BlueBrain#443
I can confirm sanjayankur31@cca2c74 still fixes i686 on the current release. For
The problem is here, in template <typename Derivate>
inline Selection SliceTraits<Derivate>::select(const ElementSet& elements) const {
const auto& slice = static_cast<const Derivate&>(*this);
const hsize_t* data = nullptr;
const DataSpace space = slice.getSpace().clone();
const std::size_t length = elements._ids.size();
if (length % space.getNumberDimensions() != 0) {
throw DataSpaceException("Number of coordinates in elements picking "
"should be a multiple of the dimensions.");
}
const std::size_t num_elements = length / space.getNumberDimensions();
std::vector<hsize_t> raw_elements;
// optimised at compile time
// switch for data conversion on 32bits platforms
if (std::is_same<std::size_t, hsize_t>::value) {
// `if constexpr` can't be used, thus a reinterpret_cast is needed.
data = reinterpret_cast<const hsize_t*>(&(elements._ids[0]));
} else {
raw_elements.resize(length);
std::copy(elements._ids.begin(), elements._ids.end(), raw_elements.begin());
data = raw_elements.data();
}
if (H5Sselect_elements(space.getId(), H5S_SELECT_SET, num_elements, data) < 0) {
HDF5ErrMapper::ToException<DataSpaceException>("Unable to select elements");
}
return Selection(DataSpace(num_elements), space, details::get_dataset(slice));
} While the first branch, with the I was able to fix this in musicinmybrain@8b379f7 by introducing an unsightly helper function and using SFINAE to ensure the Now the problem on
I haven’t looked into this deeply enough to propose a fix yet. |
(I can work around this last problem by just not enabling |
Explicitly casts long long unsigned int to size_t Fixes BlueBrain#443
We need to take care of new problems |
Hi, It runs for me on PPC32 with the following changes against 4d29dee. I don't know if it introduced new problems as mentioned above, but (some) examples seem to run fine.
|
Describe the bug
While building HighFive for inclusion in NeuroFedora, we're seeing builds fail on 32 bit architectures: i686 and armv7hl
To Reproduce
Steps to reproduce the behavior:
Attempt to build on a 32 bit platform
Expected behavior
Build should pass (or if 32 bit architectures aren't supported, this should be documented)
Stacktrace
Complete build log attached:
highfive-b8998c6b90f3b1411f4c91f0c5491d738a5f611d-build-log.txt
Desktop (please complete the following information):
Additional context
Here's the test build on the Fedora builders where only armv7hl and i686 fail:
https://koji.fedoraproject.org/koji/taskinfo?taskID=66124517
The text was updated successfully, but these errors were encountered: