Comment 0 for bug 1741639

Revision history for this message
Raymon de Looff (raymondelooff) wrote :

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
index c281c57b412..47c41471201 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -85,6 +85,8 @@ IF(UNIX)
     IF(HAVE_FALLOCATE AND HAVE_LINUX_FALLOC_H)
       ADD_DEFINITIONS(-DROCKSDB_FALLOCATE_PRESENT)
     ENDIF()
+ ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ ADD_DEFINITIONS(-DOS_MACOSX)
   ENDIF()
 ENDIF()

However, further in the compilation process another error occurs: