-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Fix compilation on Apple Silicon #7714
Conversation
0b7ef20
to
f8f5b58
Compare
f57f19c
to
67c9f16
Compare
@adamretter I looked into the branch with my M1 machine. It compiled ok. I ran
The ones with Exit val 1 did fail because they could not find gflags.
I tried to install gflags with a fresh checkout with The actual failing test was outputting this:
If you have any further questions you are always welcome to ask! |
@jurmous Excellent thanks for testing. Looks good :-) |
Are there steps here to get this merged to master? Is there an area to focus on we can help with? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pdillinger has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pdillinger has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@adamretter has updated the pull request. You must reimport the pull request before landing. |
FB infra was choking on this diff. Hopefully works with a merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pdillinger has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@pdillinger merged this pull request in ee4bd47. |
This patch updates rust-rocksdb to correctly build on Apple Silicon (using all native tools). We include patches to rustdb found here: facebook/rocksdb#7714. Additionally, we upgrade the build script and rocksdb libraries to fix compilation. See issue here: rust-rocksdb#482
Summary: Closes - facebook#7710 I tested this on an Apple DTK (Developer Transition Kit) with an Apple A12Z Bionic CPU and macOS Big Sur (11.0.1). Previously the arm64 specific CRC optimisations were limited to Linux only OS... Well now Apple Silicon is also arm64 but runs macOS ;-) Pull Request resolved: facebook#7714 Reviewed By: ltamasi Differential Revision: D25287349 Pulled By: pdillinger fbshipit-source-id: 639b168bf0ac2652907531e9604936ac4974b577
1. Backport facebook#7714 from upstream. 2. `uname -m` on the new Apple Silicon Mac outputs `arm64`. The ARMv8 CRC check in the cmake file is changed. 3. Do not treat arm darwin as iOS. With this PR, ` cmake .. -DWITH_GFLAGS=OFF -DWITH_TESTS=OFF -DWITH_TOOLS=OFF` outputs: ``` -- The C compiler identification is AppleClang 12.0.0.12000032 -- The CXX compiler identification is AppleClang 12.0.0.12000032 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is Clang -- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Found Git: /usr/bin/git (found version "2.24.3 (Apple Git-128)") -- Performing Test HAVE_OMIT_LEAF_FRAME_POINTER -- Performing Test HAVE_OMIT_LEAF_FRAME_POINTER - Success -- Performing Test HAS_ARMV8_CRC -- Performing Test HAS_ARMV8_CRC - Success -- HAS_ARMV8_CRC yes -- Performing Test HAVE_SSE42 -- Performing Test HAVE_SSE42 - Failed -- Performing Test HAVE_THREAD_LOCAL -- Performing Test HAVE_THREAD_LOCAL - Success -- Enabling RTTI in Debug builds only (default) -- Performing Test HAVE_FALLOCATE -- Performing Test HAVE_FALLOCATE - Failed -- Performing Test HAVE_SYNC_FILE_RANGE_WRITE -- Performing Test HAVE_SYNC_FILE_RANGE_WRITE - Failed -- Performing Test HAVE_PTHREAD_MUTEX_ADAPTIVE_NP -- Performing Test HAVE_PTHREAD_MUTEX_ADAPTIVE_NP - Failed -- Looking for malloc_usable_size -- Looking for malloc_usable_size - not found -- Looking for sched_getcpu -- Looking for sched_getcpu - not found -- Looking for getauxval -- Looking for getauxval - not found -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- JNI library is disabled -- Configuring done -- Generating done ``` And then, `make rocksdb -j4` succeeds. Signed-off-by: Yilin CHen <sticnarf@gmail.com> Co-authored-by: yiwu-arbug <yiwu@pingcap.com>
Summary: Closes - facebook#7710 I tested this on an Apple DTK (Developer Transition Kit) with an Apple A12Z Bionic CPU and macOS Big Sur (11.0.1). Previously the arm64 specific CRC optimisations were limited to Linux only OS... Well now Apple Silicon is also arm64 but runs macOS ;-) Pull Request resolved: facebook#7714 Reviewed By: ltamasi Differential Revision: D25287349 Pulled By: pdillinger fbshipit-source-id: 639b168bf0ac2652907531e9604936ac4974b577
Summary: Closes - facebook#7710 I tested this on an Apple DTK (Developer Transition Kit) with an Apple A12Z Bionic CPU and macOS Big Sur (11.0.1). Previously the arm64 specific CRC optimisations were limited to Linux only OS... Well now Apple Silicon is also arm64 but runs macOS ;-) Pull Request resolved: facebook#7714 Reviewed By: ltamasi Differential Revision: D25287349 Pulled By: pdillinger fbshipit-source-id: 639b168bf0ac2652907531e9604936ac4974b577
1. Backport facebook#7714 from upstream. 2. `uname -m` on the new Apple Silicon Mac outputs `arm64`. The ARMv8 CRC check in the cmake file is changed. 3. Do not treat arm darwin as iOS. With this PR, ` cmake .. -DWITH_GFLAGS=OFF -DWITH_TESTS=OFF -DWITH_TOOLS=OFF` outputs: ``` -- The C compiler identification is AppleClang 12.0.0.12000032 -- The CXX compiler identification is AppleClang 12.0.0.12000032 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is Clang -- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Found Git: /usr/bin/git (found version "2.24.3 (Apple Git-128)") -- Performing Test HAVE_OMIT_LEAF_FRAME_POINTER -- Performing Test HAVE_OMIT_LEAF_FRAME_POINTER - Success -- Performing Test HAS_ARMV8_CRC -- Performing Test HAS_ARMV8_CRC - Success -- HAS_ARMV8_CRC yes -- Performing Test HAVE_SSE42 -- Performing Test HAVE_SSE42 - Failed -- Performing Test HAVE_THREAD_LOCAL -- Performing Test HAVE_THREAD_LOCAL - Success -- Enabling RTTI in Debug builds only (default) -- Performing Test HAVE_FALLOCATE -- Performing Test HAVE_FALLOCATE - Failed -- Performing Test HAVE_SYNC_FILE_RANGE_WRITE -- Performing Test HAVE_SYNC_FILE_RANGE_WRITE - Failed -- Performing Test HAVE_PTHREAD_MUTEX_ADAPTIVE_NP -- Performing Test HAVE_PTHREAD_MUTEX_ADAPTIVE_NP - Failed -- Looking for malloc_usable_size -- Looking for malloc_usable_size - not found -- Looking for sched_getcpu -- Looking for sched_getcpu - not found -- Looking for getauxval -- Looking for getauxval - not found -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- JNI library is disabled -- Configuring done -- Generating done ``` And then, `make rocksdb -j4` succeeds. Signed-off-by: Yilin CHen <sticnarf@gmail.com> Co-authored-by: yiwu-arbug <yiwu@pingcap.com>
1. Backport facebook#7714 from upstream. 2. `uname -m` on the new Apple Silicon Mac outputs `arm64`. The ARMv8 CRC check in the cmake file is changed. 3. Do not treat arm darwin as iOS. With this PR, ` cmake .. -DWITH_GFLAGS=OFF -DWITH_TESTS=OFF -DWITH_TOOLS=OFF` outputs: ``` -- The C compiler identification is AppleClang 12.0.0.12000032 -- The CXX compiler identification is AppleClang 12.0.0.12000032 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is Clang -- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Found Git: /usr/bin/git (found version "2.24.3 (Apple Git-128)") -- Performing Test HAVE_OMIT_LEAF_FRAME_POINTER -- Performing Test HAVE_OMIT_LEAF_FRAME_POINTER - Success -- Performing Test HAS_ARMV8_CRC -- Performing Test HAS_ARMV8_CRC - Success -- HAS_ARMV8_CRC yes -- Performing Test HAVE_SSE42 -- Performing Test HAVE_SSE42 - Failed -- Performing Test HAVE_THREAD_LOCAL -- Performing Test HAVE_THREAD_LOCAL - Success -- Enabling RTTI in Debug builds only (default) -- Performing Test HAVE_FALLOCATE -- Performing Test HAVE_FALLOCATE - Failed -- Performing Test HAVE_SYNC_FILE_RANGE_WRITE -- Performing Test HAVE_SYNC_FILE_RANGE_WRITE - Failed -- Performing Test HAVE_PTHREAD_MUTEX_ADAPTIVE_NP -- Performing Test HAVE_PTHREAD_MUTEX_ADAPTIVE_NP - Failed -- Looking for malloc_usable_size -- Looking for malloc_usable_size - not found -- Looking for sched_getcpu -- Looking for sched_getcpu - not found -- Looking for getauxval -- Looking for getauxval - not found -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- JNI library is disabled -- Configuring done -- Generating done ``` And then, `make rocksdb -j4` succeeds. Signed-off-by: Yilin CHen <sticnarf@gmail.com> Co-authored-by: yiwu-arbug <yiwu@pingcap.com>
In order to build on Apple Silicon (e.g. M1 processors) we need RocksDB v6.16.3 or higher. facebook/rocksdb#7714
Closes - #7710
I tested this on an Apple DTK (Developer Transition Kit) with an Apple A12Z Bionic CPU and macOS Big Sur (11.0.1).
Previously the arm64 specific CRC optimisations were limited to Linux only OS... Well now Apple Silicon is also arm64 but runs macOS ;-)