I followed this https://mariadb.com/kb/en/Build_Environment_Setup_for_Mac/ and then https://mariadb.com/kb/en/generic-build-instructions/.
Encountered few errors along the way. Below are the issues with the fixes that worked for me -
-
- Issue:
Bison error
- Fix: Ran
brew install bison
to upgrade bison version. Cleaned up build folder and re-ran build.
- Issue:
-
- Issue:
pcre2.h missing
- Fix: Ran
brew install pcre2
to install the dependency. Created a symbolic link -ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h \ /Library/Developer/CommandLineTools/usr/include/pcre2.h
.
- Issue:
-
- Issue:
unknown type name 'malloc_statistics_t'
- Fix: Since the usage is in some statistics, can ignore that code. Quick clean hack suggested by someone -
--- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -653,7 +653,7 @@ Memory allocated by threads: %s\n", llstr(tmp.global_memory_used, llbuff[8]), llstr(tmp.local_memory_used, llbuff[9])); -#elif defined(HAVE_MALLOC_ZONE) +#elif 0 malloc_statistics_t info; char llbuff[4][22];
- Issue:
-
- Issue:
error: 'sprintf' is deprecated
- Fix: Build with
DMYSQL_MAINTAINER_MODE=OFF.
that should do the trick. From docs -By default, MariaDB is compiled with the -Werror flag, which causes compiling to abort if there is a compiler warning. You can disable that by configuring with -DMYSQL_MAINTAINER_MODE=OFF.
- Issue: