Skip to content

Cannot compile 32-bit version (BINARY=32) #1974

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

Closed
TiborGY opened this issue Jan 20, 2019 · 4 comments
Closed

Cannot compile 32-bit version (BINARY=32) #1974

TiborGY opened this issue Jan 20, 2019 · 4 comments

Comments

@TiborGY
Copy link
Contributor

TiborGY commented Jan 20, 2019

Trying to compile a 32-bit version of the library on a 64-bit OS (Ubuntu 18.04, GCC 7.3) fails with the following log. Something related to avx512 detection does not work on 32-bit. NO_AVX=1 and NO_AVX2=1 have no effect on this issue.

In file included from getarch.c:1090:0:
cpuid_x86.c: In function ‘support_avx512’:
cpuid_x86.c:242:5: warning: implicit declaration of function ‘xgetbv’; did you mean ‘getwd’? [-Wimplicit-function-declaration]
xgetbv(0, &eax, &edx);
^~~~~~
getwd
/tmp/ccA8ambP.o: In function support_avx512': getarch.c:(.text+0x23c): undefined reference to xgetbv'
collect2: error: ld returned 1 exit status
make: *** [getarch] Error 1

@brada4
Copy link
Contributor

brada4 commented Jan 20, 2019

Do you use 32bit gcc or clang with multilib?
There is no AVX possible in 32bit mode at all
What is your CPU?

@martin-frbg
Copy link
Collaborator

Can you provide the complete build log please ? The avx512 detection is allowed to fail and should set NO_AVX512=1 in that case.

@TiborGY
Copy link
Contributor Author

TiborGY commented Jan 20, 2019

This is the complete build log. The build system fails very early, because it cannot compile getarch.c .

@martin-frbg
Copy link
Collaborator

Ah, I see. You have set NO_AVX=1 which removes the definition of xgetbv(). Line 231 of cpuid_x86.c should read if !defined(NO_AVX) && !defined(NO_AVX512) rather than just ifndef NO_AVX512.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants