Percona MyRocks does not compile on macOS

Bug #1741639 reported by Raymon de Looff on 2018-01-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Invalid
Undecided
Unassigned
5.7
Triaged
Low
Unassigned

Bug Description

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, possibly due to missing platform checks for librt. This error occurs multiple times.

[ 41%] Linking CXX executable sst_dump
cd /tmp/percona-server-20180106-59497-1lkwih4/percona-server-5.7.20-18/storage/rocksdb && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/sst_dump.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/super/clang++ -std=c++11 -Wno-deprecated-declarations -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -Wno-null-conversion -Wno-unused-private-field -Wimplicit-fallthrough=0 -msse4.2 -DNDEBUG -DDBUG_OFF -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/sst_dump.dir/rocksdb/tools/sst_dump.cc.o CMakeFiles/sst_dump.dir/rocksdb/tools/ldb_tool.cc.o CMakeFiles/sst_dump.dir/rocksdb/tools/ldb_cmd.cc.o CMakeFiles/sst_dump.dir/rocksdb/tools/sst_dump_tool.cc.o CMakeFiles/sst_dump.dir/rocksdb/cache/clock_cache.cc.o CMakeFiles/sst_dump.dir/rocksdb/cache/lru_cache.cc.o CMakeFiles/sst_dump.dir/rocksdb/cache/sharded_cache.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/c.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/column_family.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/compacted_db_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/compaction.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/compaction_iterator.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/compaction_job.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/compaction_picker.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/compaction_picker_universal.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/convenience.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_filesnapshot.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_write.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_compaction_flush.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_files.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_open.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_debug.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_experimental.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_impl_readonly.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_info_dumper.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/db_iter.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/dbformat.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/event_helpers.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/experimental.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/external_sst_file_ingestion_job.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/file_indexer.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/flush_job.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/flush_scheduler.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/forward_iterator.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/internal_stats.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/log_reader.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/log_writer.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/malloc_stats.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/managed_iterator.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/memtable.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/memtable_list.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/merge_helper.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/merge_operator.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/range_del_aggregator.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/repair.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/snapshot_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/table_cache.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/table_properties_collector.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/transaction_log_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/version_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/version_edit.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/version_set.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/wal_manager.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/write_batch.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/write_batch_base.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/write_controller.cc.o CMakeFiles/sst_dump.dir/rocksdb/db/write_thread.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/env.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/env_chroot.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/env_encryption.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/env_hdfs.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/env_posix.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/io_posix.cc.o CMakeFiles/sst_dump.dir/rocksdb/env/mock_env.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/alloc_tracker.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/hash_cuckoo_rep.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/hash_linklist_rep.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/hash_skiplist_rep.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/skiplistrep.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/vectorrep.cc.o CMakeFiles/sst_dump.dir/rocksdb/memtable/write_buffer_manager.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/histogram.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/histogram_windowing.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/instrumented_mutex.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/iostats_context.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/perf_context.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/perf_level.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/statistics.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/thread_status_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/thread_status_updater.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/thread_status_updater_debug.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/thread_status_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/monitoring/thread_status_util_debug.cc.o CMakeFiles/sst_dump.dir/rocksdb/options/cf_options.cc.o CMakeFiles/sst_dump.dir/rocksdb/options/db_options.cc.o CMakeFiles/sst_dump.dir/rocksdb/options/options.cc.o CMakeFiles/sst_dump.dir/rocksdb/options/options_helper.cc.o CMakeFiles/sst_dump.dir/rocksdb/options/options_parser.cc.o CMakeFiles/sst_dump.dir/rocksdb/options/options_sanity_check.cc.o CMakeFiles/sst_dump.dir/rocksdb/port/port_posix.cc.o CMakeFiles/sst_dump.dir/rocksdb/port/stack_trace.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/adaptive_table_factory.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block_based_filter_block.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block_based_table_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block_based_table_factory.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block_based_table_reader.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/block_prefix_index.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/bloom_block.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/cuckoo_table_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/cuckoo_table_factory.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/cuckoo_table_reader.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/flush_block_policy.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/format.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/full_filter_block.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/get_context.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/index_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/iterator.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/merging_iterator.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/meta_blocks.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/partitioned_filter_block.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/persistent_cache_helper.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/plain_table_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/plain_table_factory.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/plain_table_index.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/plain_table_key_coding.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/plain_table_reader.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/sst_file_writer.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/table_properties.cc.o CMakeFiles/sst_dump.dir/rocksdb/table/two_level_iterator.cc.o CMakeFiles/sst_dump.dir/rocksdb/tools/dump/db_dump_tool.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/arena.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/auto_roll_logger.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/bloom.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/build_version.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/coding.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/compaction_job_stats_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/comparator.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/concurrent_arena.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/crc32c.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/delete_scheduler.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/dynamic_bloom.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/event_logger.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/file_reader_writer.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/file_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/filename.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/filter_policy.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/hash.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/log_buffer.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/murmurhash.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/random.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/rate_limiter.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/slice.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/sst_file_manager_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/status.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/status_message.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/string_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/sync_point.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/thread_local.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/threadpool_imp.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/transaction_test_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/util/xxhash.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/backupable/backupable_db.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/blob_db.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/blob_db_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/blob_file.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/blob_log_reader.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/blob_log_writer.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/blob_log_format.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/blob_db/ttl_extractor.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/cassandra/cassandra_compaction_filter.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/cassandra/format.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/cassandra/merge_operator.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/checkpoint/checkpoint_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/convenience/info_log_finder.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/date_tiered/date_tiered_db_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/debug.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/document/document_db.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/document/json_document.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/document/json_document_builder.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/env_mirror.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/env_timed.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/geodb/geodb_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/leveldb_options/leveldb_options.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/lua/rocks_lua_compaction_filter.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/memory/memory_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/merge_operators/max.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/merge_operators/put.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/merge_operators/string_append/stringappend.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/merge_operators/string_append/stringappend2.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/merge_operators/uint64add.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/option_change_migration/option_change_migration.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/options/options_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/persistent_cache/block_cache_tier.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/persistent_cache/persistent_cache_tier.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/redis/redis_lists.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/simulator_cache/sim_cache.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/spatialdb/spatial_db.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/optimistic_transaction_db_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/optimistic_transaction.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/transaction_base.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/pessimistic_transaction_db.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/transaction_db_mutex_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/pessimistic_transaction.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/transaction_lock_mgr.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/transaction_util.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/transactions/write_prepared_txn.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/ttl/db_ttl_impl.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc.o CMakeFiles/sst_dump.dir/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc.o CMakeFiles/sst_dump.dir/third_party/lz4/lib/lz4.c.o CMakeFiles/sst_dump.dir/third_party/lz4/lib/lz4hc.c.o CMakeFiles/sst_dump.dir/third_party/lz4/lib/lz4frame.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/entropy_common.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/error_private.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/fse_decompress.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/pool.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/threading.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/xxhash.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/common/zstd_common.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/compress/fse_compress.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/compress/huf_compress.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/compress/zstd_compress.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/compress/zstdmt_compress.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/decompress/huf_decompress.c.o CMakeFiles/sst_dump.dir/third_party/zstd/lib/decompress/zstd_decompress.c.o -o sst_dump /usr/lib/libz.dylib -lrt
ld: library not found for -lrt

description: updated

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2285

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers