You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running a 32 bit system that has a processor with AVX support, and it seems that this section
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <>
GLM_FUNC_QUALIFIER int bitCount(uint32 x)
{
return _mm_popcnt_u32(x);
}
template <>
GLM_FUNC_QUALIFIER int bitCount(uint64 x)
{
return static_cast<int>(_mm_popcnt_u64(x));
}
# endif
from /usr/include/glm/detail/func_integer_simd.inl is giving me headaches, namely in the form of:
/usr/include/glm/detail/func_integer_simd.inl: In function ‘int glm::bitCount(genType) [with genType = long long unsigned int]’:
/usr/include/glm/detail/func_integer_simd.inl:60:43: error: ‘_mm_popcnt_u64’ was not declared in this scope
return static_cast(_mm_popcnt_u64(x));
My compiler is gcc 5.4.0, and when I manually try something like
#include <smmintrin.h>
#include <stdio.h>
int main(void) {
int res = _mm_popcnt_u64(0);
printf("Result res should be 0: %d\n", res);
}
it also fails with
test.c: In function ‘main’:
test.c:5:12: warning: implicit declaration of function ‘_mm_popcnt_u64’ [-Wimplicit-function-declaration]
int res = _mm_popcnt_u64(0);
^
/tmp/ccaMYiyR.o: In function main': test.c:(.text+0x17): undefined reference to _mm_popcnt_u64'
collect2: error: ld returned 1 exit status
while
#include <smmintrin.h>
#include <stdio.h>
int main(void) {
int res = _mm_popcnt_u32(0);
printf("Result res should be 0: %d\n", res);
}
builds successfully.
I'm sorry that I don't have much more of a clue but only these observation, but if _mm_popcnt_u64 is indeed not supposed to be there on 32 bit, then /usr/include/glm/detail/func_integer_simd.inl would probably have to be changed in a way so that it doesn't get used when a 32 bit processor that supports AVX is present. Indeed, commenting out the code quoted above fix my original build errors.
The text was updated successfully, but these errors were encountered:
thanks for looking into this! Yes, I'm using GCC (version 5.4.0) and stumbled upon the issue when I was building libreoffice (which uses glm) on two of my Gentoo Linux systems. Both are 32 bit, one uses an older Intel processor without AVX, and the other one a newer AMD processor with AVX, and my build was consistently succeeding on the first, but failing on the second system. ;-)
I'm running a 32 bit system that has a processor with AVX support, and it seems that this section
from /usr/include/glm/detail/func_integer_simd.inl is giving me headaches, namely in the form of:
/usr/include/glm/detail/func_integer_simd.inl: In function ‘int glm::bitCount(genType) [with genType = long long unsigned int]’:
/usr/include/glm/detail/func_integer_simd.inl:60:43: error: ‘_mm_popcnt_u64’ was not declared in this scope
return static_cast(_mm_popcnt_u64(x));
My compiler is gcc 5.4.0, and when I manually try something like
it also fails with
test.c: In function ‘main’:
test.c:5:12: warning: implicit declaration of function ‘_mm_popcnt_u64’ [-Wimplicit-function-declaration]
int res = _mm_popcnt_u64(0);
^
/tmp/ccaMYiyR.o: In function
main': test.c:(.text+0x17): undefined reference to
_mm_popcnt_u64'collect2: error: ld returned 1 exit status
while
builds successfully.
I'm sorry that I don't have much more of a clue but only these observation, but if _mm_popcnt_u64 is indeed not supposed to be there on 32 bit, then /usr/include/glm/detail/func_integer_simd.inl would probably have to be changed in a way so that it doesn't get used when a 32 bit processor that supports AVX is present. Indeed, commenting out the code quoted above fix my original build errors.
The text was updated successfully, but these errors were encountered: