-
Notifications
You must be signed in to change notification settings - Fork 280
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
BLD: 4.0.1 fails on i386 systems: call to 'countOnes' is ambiguous #3477
Comments
@yurivict thank you for this! I appreciate the bug reports. I'm not sure I can build it here without installing FreeBSD, which is probably what I ought to do. I will note that we've also run into issues with some strangeness in how the EWAH code compiles with MSVC++, too, and I will check to see if there's any overlap in the issues. |
This issue is not specific to FreeBSD but to the i386 platform. I can reproduce it with the following steps on Linux (x86-64!): export CONDA_FORCE_32BIT=1
export CFLAGS=-m32
conda create -n py37_32 python=3.7
conda activate py37_32
pip install cython numpy
python setup.py develop This fails with the following traceback (abridged)
OS: Arch Linux |
Seems to be fixed with this patch diff --git a/yt/utilities/lib/ewahboolarray/boolarray.h b/yt/utilities/lib/ewahboolarray/boolarray.h
index 822d576b4..e67f91bae 100644
--- a/yt/utilities/lib/ewahboolarray/boolarray.h
+++ b/yt/utilities/lib/ewahboolarray/boolarray.h
@@ -17,6 +17,13 @@
#include "ewahutil.h"
+
+#if ((ULONG_MAX) == (UINT_MAX))
+#define UWORD uint32_t
+#else
+#define UWORD uint64_t
+#endif
+
namespace ewah {
/**
* A dynamic bitset implementation. (without compression).
@@ -344,7 +351,7 @@ public:
size_t numberOfOnes() const {
size_t count = 0;
for (size_t i = 0; i < buffer.size(); ++i) {
- count += countOnes(buffer[i]);
+ count += countOnes((UWORD)buffer[i]);
}
return count;
}
diff --git a/yt/utilities/lib/ewahboolarray/ewah-inl.h b/yt/utilities/lib/ewahboolarray/ewah-inl.h
index 6176c5e15..5b6e0f281 100644
--- a/yt/utilities/lib/ewahboolarray/ewah-inl.h
+++ b/yt/utilities/lib/ewahboolarray/ewah-inl.h
@@ -3,6 +3,12 @@
#include "ewah.h"
+#if ((ULONG_MAX) == (UINT_MAX))
+#define UWORD uint32_t
+#else
+#define UWORD uint64_t
+#endif
+
namespace ewah {
/**
@@ -213,7 +219,7 @@ public:
return;
} else {
uword t = static_cast<uword>(word & (~word + 1));
- answer = literalPosition + countOnes((uword)(t - 1));
+ answer = literalPosition + countOnes((UWORD)(t - 1));
word ^= t;
}
hasNext = moveToNext();
@@ -371,7 +377,7 @@ template <class uword> size_t EWAHBoolArray<uword>::numberOfOnes() const {
}
++pointer;
for (size_t k = 0; k < rlw.getNumberOfLiteralWords(); ++k) {
- tot += countOnes((uword)buffer[pointer]);
+ tot += countOnes((UWORD)buffer[pointer]);
++pointer;
}
} Can anyone confirm? |
@cphyc I assume the answer-store being included in your patch is a mistake ? |
I'm adding this to the 4.0.2 milestone to make sure this is discussed before the bug fix release |
Correct. I'm amending my patch to remove the answer-store update. |
Log: http://beefy17.nyi.freebsd.org/data/main-i386-default/pa8720dde236b_seba8e643b1/logs/py38-yt-4.0.1.log (IPv6 URL)
OS: FreeBSD 13
The text was updated successfully, but these errors were encountered: