Skip to content
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

popcnt issue on CentOS 7.2 #80

Open
pengxu7 opened this issue Nov 21, 2018 · 3 comments
Open

popcnt issue on CentOS 7.2 #80

pengxu7 opened this issue Nov 21, 2018 · 3 comments

Comments

@pengxu7
Copy link

pengxu7 commented Nov 21, 2018

I built NativeJIT with g++ 5.4.0 on CentOS 7.2. Then I tried to compile your "radius" test code (http://bitfunnel.org/getting-started-with-nativejit/) but got following error:"

/usr/local/gcc54/lib/gcc/x86_64-unknown-linux-gnu/5.4.0/include/popcntintrin.h: In function 'uint8_t NativeJIT::BitOp::GetNonZeroBitCount(uint32_t)':
/usr/local/gcc54/lib/gcc/x86_64-unknown-linux-gnu/5.4.0/include/popcntintrin.h:35:1: error: inlining failed in call to always_inline 'int _mm_popcnt_u32(unsigned int)': target specific option mismatch
_mm_popcnt_u32 (unsigned int __X)
^
In file included from ./nativejit/inc/NativeJIT/CodeGen/X64CodeGenerator.h:32:0,
from ./nativejit/inc/NativeJIT/CodeGen/FunctionBuffer.h:40,
from test.cpp:2:
./nativejit/inc/NativeJIT/BitOperations.h:89:55: error: called from here
return static_cast<uint8_t>(_mm_popcnt_u32(value));
"

Am I missing anything?

Thanks!

@MikeHopcroft
Copy link
Contributor

Hi - my apologies for the slow reply - did you figure this out?

@pengxu7
Copy link
Author

pengxu7 commented Dec 12, 2018

No, I haven't played with NativeJIT after this issue. I wanted to try to use NativeJIT in production code, but this makes me hesitant. Does NativeJIT support Linux, especially CentOS/RHEL? Is it being actively maintained?

Thanks.

@musicinmybrain
Copy link

NativeJIT uses SSE4.2 intrinsics for POPCNT/LZCNT. You have to add -msse4.2 to your build flags for these to be available, which obviously restricts the result to machines with those extensions. That’s what the “target specific option mismatch” is about. To be fully portable you would enable SSE4.2 in just the relevant portion of your code that uses NativeJIT, and do runtime CPU feature detection before calling anything that uses that portion.

(But, no, it seems this project isn’t actively maintained anymore.)

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