-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
problems with fast crc support #2488
Comments
I wonder whether this is an issue for the distros that bundle RocksDB? |
Yes, we had problems with fast CRC support in Percona Server build. |
This line in RocksDB LOG explains whether fast CRC support might be used. It can say yes when support isn't used because of this bug. Code is here: To get fast crc32 support you want -DHAVE_SSE42 and probably some of -msse, -msse4.2 on compiler command line. Which mean you might need USE_SSE=1 set as an environment variable when building MyRocks. grep for SSE in https://github.com/facebook/rocksdb/blob/master/build_tools/build_detect_platform |
This has been a headache for CockroachDB too (cockroachdb/cockroach#15589). Compiling with |
@bdarnell you are welcome to send a PR to add a flag to achieve what you want. |
With some compilers, `-std=c++11` is necessary for <cstdint> to be available. Pass this flag via $PLATFORM_CXXFLAGS. Fixes facebook#2488.
Summary: With some compilers, `-std=c++11` is necessary for <cstdint> to be available. Pass this flag via $PLATFORM_CXXFLAGS. Fixes facebook#2488. Closes facebook#2545 Differential Revision: D5620610 Pulled By: yiwu-arbug fbshipit-source-id: 2f975b8c1ad52e283e677d9a33543abd064f13ce
Summary: With some compilers, `-std=c++11` is necessary for <cstdint> to be available. Pass this flag via $PLATFORM_CXXFLAGS. Fixes facebook#2488. Closes facebook#2545 Differential Revision: D5620610 Pulled By: yiwu-arbug fbshipit-source-id: 2f975b8c1ad52e283e677d9a33543abd064f13ce
There are a few problems with fast crc support in RocksDB:
Note that an internal bug has already been opened for this.
This is a hack to get the -DHAVE_SSE42 flag added to the build command line. The problem is that the test code won't compile with -std=c++11. Adding $PLATFORM_CXXFLAGS might also fix this.
--- a/build_tools/build_detect_platform
+++ b/build_tools/build_detect_platform
@@ -456,7 +456,7 @@ elif test -z "$PORTABLE"; then
fi
fi
-$CXX $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null <<EOF
+$CXX $COMMON_FLAGS -std=c++11 -x c++ - -o /dev/null 2>/dev/null <<EOF
#include
#include <nmmintrin.h>
int main() {
Support for fast crc in RocksDB is complex:
From the above, if the HAVE_SSE42 macro isn't defined then the fast crc function will use slow crc implementation. But LOG depends on output from isSSE42 function that depends on SSE4_2 macro which claims fast crc is supported.
The text was updated successfully, but these errors were encountered: