-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Mac M1 build support proposal (minus rocksdb option) #1743
Conversation
Hi @devnexen! Thanks a lot for this patch, I was really curious how we're doing in terms of compiling on the new M1 macs. Can you please give me a bit more details about what this patch is fixing? Is it some compile errors? |
A little compiling error indeed but mostly crc32 intrinsics support detection in addition |
I had a look at the patch and it looks safe to me. We are due for an M1 mac soon, so we'll be able to provide CI support for it when that happens. For now, I cross checked it with this discussion here: We'll be able to test this probably after the 10.5.9 release, but I think this patch is safe to merge regardless. I'll let it up to @robertbindar to see if he can double check with an M1 mac today. |
@robertbindar during the testing of the patch, please note that PR #1730 is also adding similar change, so if the changes are ok, I suggest to first merge PR #1730 and after this patch. |
Note I also applied a change in rocksdb facebook/rocksdb#7893 and seemingly had been accepted |
Hey @devnexen! I'm not familiar with this area of code, but I trust your expertise on this and on top of that, the code added here seems to be enclosed in the right ifdefs to not have potential conflicts with other areas of the server. I'll give the patch a quick test run to see builds on other platforms are indeed not influenced and then happily merge it. Is the server building clean on your M1 with this patch on? |
yes indeed it does build. |
Hey @robertbindar I tried to build this PR and I couldn't. Here is my output from I don't know enough about the MariaDB dev env. to really debug it, but I just wanted to share. Let me know if this is something obvious to fix and I'll be happy to try again. |
Hey @lonnylot , thanks for working on this. It seems to me that cmake cannot find libiconv, do you have it installed on your system? |
So I have iconv:
Should this satisfy the requirement? (Sorry, I haven't compiled anything in awhile and really don't recall all of the nuances) |
You need to make sure your environment points to the right location of the dependencies (by that I mean not to confuse dependencies built for Rosetta vs the ones for ARM). Here an example :
|
@devnexen Any idea how I could tell which are built for ARM vs. Rosetta? I lonnykapelushnik@Lonnys-MBP server % echo $CPPFLAGS
-I/opt/homebrew/opt/libiconv/include
lonnykapelushnik@Lonnys-MBP server % echo $LDFLAGS
-L/opt/homebrew/opt/libiconv/lib
lonnykapelushnik@Lonnys-MBP server % cmake ../server
...
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ICONV_LIBRARIES (ADVANCED)
linked by target "mariadbclient" in directory /Users/lonnykapelushnik/Development/server/libmariadb/libmariadb
linked by target "libmariadb" in directory /Users/lonnykapelushnik/Development/server/libmariadb/libmariadb
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly. |
Yes homebrew for Rosetta installs in the same location just like the older Mac Intel ie /usr/local whereas for ARM it is into /opt/homebrew
Try to set CXXFLAGS with same values as CPPFLAGS then. You might need more than just libiconv path tough |
Wow - I was on the wrong branch. Sorry for all the noise. But now I'm on the [ 83%] Building CXX object storage/rocksdb/CMakeFiles/rocksdblib.dir/rocksdb/util/crc32c.cc.o
/Users/lonnykapelushnik/Development/server/storage/rocksdb/rocksdb/util/crc32c.cc:500:18: error: use of undeclared identifier 'isSSE42'
has_fast_crc = isSSE42();
^
/Users/lonnykapelushnik/Development/server/storage/rocksdb/rocksdb/util/crc32c.cc:1230:7: error: use of undeclared identifier 'isSSE42'
if (isSSE42()) {
^
/Users/lonnykapelushnik/Development/server/storage/rocksdb/rocksdb/util/crc32c.cc:1231:9: error: use of undeclared identifier 'isPCLMULQDQ'
if (isPCLMULQDQ()) {
^
3 errors generated.
make[2]: *** [storage/rocksdb/CMakeFiles/rocksdblib.dir/rocksdb/util/crc32c.cc.o] Error 1
make[1]: *** [storage/rocksdb/CMakeFiles/rocksdblib.dir/all] Error 2 |
Yes I believe the git hash in here is pretty old https://github.com/facebook/rocksdb/tree/bba5e7bc21093d7cfa765e1280a7c4fdcd284288 |
Hey @devnexen and @lonnylot! I've received my m1 this morning and I managed to build this patch with no problems. Unfortunately @lonnylot I probably won't be able to help you much to set up your dev environment, I'm very newbie in this environment, my process seems to have worked pretty easy (installed Xcode and macports, installed MariaDB dependencies with macports, then just ran a @devnexen I'll merge PR #1730 first as it was created quite a long time ago, and although it is a subset of yours, I think the contributor still deserves GitHub credits for the effort. Can you please rebase against 10.5 once I merged #1730? Thanks a lot, if you don't have the time, I can do the rebase myself no worries. |
rocksdb note - found http://lists.askmonty.org/pipermail/commits/2021-February/014468.html though its not on any branch yet. |
No description provided.