When trying to build Percona Server 5.7.20-18 with Percona MyRocks on macOS, the compilation fails due to the multiple errors. Without Percona MyRocks it compiles without errors.
The first error occurs due to missing checks for macOS in the CMakeLists.txt file:
/tmp/percona-server-20180106-55884-1lcy18e/percona-server-5.7.20-18/storage/rocksdb/rocksdb/port/port_posix.h:50:12: fatal error: 'endian.h' file not found
#include <endian.h> ^~~~~~~~~~
This error can be fixed quite easily by applying the following patch to the CMakeLists.txt file. RocksDB uses the same check to set the -DOS_MACOSX flag.
When trying to build Percona Server 5.7.20-18 with Percona MyRocks on macOS, the compilation fails due to the multiple errors. Without Percona MyRocks it compiles without errors.
The first error occurs due to missing checks for macOS in the CMakeLists.txt file:
/tmp/percona- server- 20180106- 55884-1lcy18e/ percona- server- 5.7.20- 18/storage/ rocksdb/ rocksdb/ port/port_ posix.h: 50:12: fatal error: 'endian.h' file not found
^~~ ~~~~~~~
#include <endian.h>
This error can be fixed quite easily by applying the following patch to the CMakeLists.txt file. RocksDB uses the same check to set the -DOS_MACOSX flag.
diff --git a/storage/ rocksdb/ CMakeLists. txt b/storage/ rocksdb/ CMakeLists. txt .47c41471201 100644 rocksdb/ CMakeLists. txt rocksdb/ CMakeLists. txt HAVE_FALLOCATE AND HAVE_LINUX_ FALLOC_ H)
ADD_DEFINITIONS (-DROCKSDB_ FALLOCATE_ PRESENT) CMAKE_SYSTEM_ NAME STREQUAL "Darwin") (-DOS_MACOSX)
index c281c57b412.
--- a/storage/
+++ b/storage/
@@ -85,6 +85,8 @@ IF(UNIX)
IF(
ENDIF()
+ ELSEIF(
+ ADD_DEFINITIONS
ENDIF()
ENDIF()
However, further in the compilation process another error occurs: