Closed yifangt closed 2 years ago
Manually add the -mpopcnt option in the CMakeLists.txt:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
which seems to have fixed the error.
Please confirm if this is the correct way to fix the bug.
Hi there, I never got this compiler error and I've been always using popcnt :) If you fixed that by adding a compilation flag, it means that your CPU has not automatic support for popcnt. Very strange because popcnt is available since SSE 4.2. Yes, you can either add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt") or set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
By the way, what version of gcc are you using?
Thanks!
My gcc version is: gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Actually, I just noted that also in PTHash, I've used:
# For hardware popcount and pdep
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mbmi2 -msse4.2")
I've added them now. Can you try if now compiles on your end?
I still have the same issue and have to manually add this line after your update:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
However, when I switched to another computer to compile, I did not have this problem, even without the line for PTHash you mentioned.
So, the issue seems to be an exception on my desktop with Ubuntu 21.10. Thanks a lot again!
Ok. Thank you for reporting! Closing this issue then.
I tried to compile the package to give it a try but met a problem at compiling:
Googled for a while and found out the the problem is related to the -mpopcnt option, but I am not familiar with the cmake and the _mm_popcnt_u64() function.
My system is
Linux 5.13.0-24-generic #24-Ubuntu-21.10
I appreciate any help to resolve this issue.