Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
53cb9a74
Unverified
Commit
53cb9a74
authored
Dec 24, 2017
by
zhangjinpeng1987
Committed by
GitHub
Dec 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake config checks
parent
51a5c0c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
6 deletions
+85
-6
CMakeLists.txt
librocksdb_sys/rocksdb/CMakeLists.txt
+43
-6
FindNUMA.cmake
librocksdb_sys/rocksdb/cmake/modules/FindNUMA.cmake
+21
-0
FindTBB.cmake
librocksdb_sys/rocksdb/cmake/modules/FindTBB.cmake
+21
-0
No files found.
librocksdb_sys/rocksdb/CMakeLists.txt
View file @
53cb9a74
...
...
@@ -259,6 +259,20 @@ if(WITH_UBSAN)
endif
()
endif
()
find_package
(
NUMA
)
if
(
NUMA_FOUND
)
add_definitions
(
-DNUMA
)
include_directories
(
${
NUMA_INCLUDE_DIR
}
)
list
(
APPEND THIRDPARTY_LIBS
${
NUMA_LIBRARIES
}
)
endif
()
find_package
(
TBB
)
if
(
TBB_FOUND
)
add_definitions
(
-DTBB
)
include_directories
(
${
TBB_INCLUDE_DIR
}
)
list
(
APPEND THIRDPARTY_LIBS
${
TBB_LIBRARIES
}
)
endif
()
# Used to run CI build and tests so we can run faster
set
(
OPTIMIZE_DEBUG_DEFAULT 0
)
# Debug build is unoptimized by default use -DOPTDBG=1 to optimize
...
...
@@ -326,11 +340,8 @@ if(NOT WIN32)
endif
()
option
(
WITH_FALLOCATE
"build with fallocate"
ON
)
if
(
WITH_FALLOCATE
)
set
(
CMAKE_REQUIRED_FLAGS
${
CMAKE_C_FLAGS
}
)
include
(
CheckCSourceCompiles
)
CHECK_C_SOURCE_COMPILES
(
"
CHECK_CXX_SOURCE_COMPILES
(
"
#include <fcntl.h>
#include <linux/falloc.h>
int main() {
...
...
@@ -343,12 +354,38 @@ int main() {
endif
()
endif
()
include
(
CheckFunctionExists
)
CHECK_FUNCTION_EXISTS
(
malloc_usable_size HAVE_MALLOC_USABLE_SIZE
)
CHECK_CXX_SOURCE_COMPILES
(
"
#include <fcntl.h>
int main() {
int fd = open(
\"
/dev/null
\"
, 0);
sync_file_range(fd, 0, 1024, SYNC_FILE_RANGE_WRITE);
}
"
HAVE_SYNC_FILE_RANGE_WRITE
)
if
(
HAVE_SYNC_FILE_RANGE_WRITE
)
add_definitions
(
-DROCKSDB_RANGESYNC_PRESENT
)
endif
()
CHECK_CXX_SOURCE_COMPILES
(
"
#include <pthread.h>
int main() {
(void) PTHREAD_MUTEX_ADAPTIVE_NP;
}
"
HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
)
if
(
HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
)
add_definitions
(
-DROCKSDB_PTHREAD_ADAPTIVE_MUTEX
)
endif
()
include
(
CheckCXXSymbolExists
)
check_cxx_symbol_exists
(
malloc_usable_size malloc.h HAVE_MALLOC_USABLE_SIZE
)
if
(
HAVE_MALLOC_USABLE_SIZE
)
add_definitions
(
-DROCKSDB_MALLOC_USABLE_SIZE
)
endif
()
check_cxx_symbol_exists
(
sched_getcpu sched.h HAVE_SCHED_GETCPU
)
if
(
HAVE_SCHED_GETCPU
)
add_definitions
(
-DROCKSDB_SCHED_GETCPU_PRESENT
)
endif
()
include_directories
(
${
PROJECT_SOURCE_DIR
}
)
include_directories
(
${
PROJECT_SOURCE_DIR
}
/include
)
include_directories
(
SYSTEM
${
PROJECT_SOURCE_DIR
}
/third-party/gtest-1.7.0/fused-src
)
...
...
librocksdb_sys/rocksdb/cmake/modules/FindNUMA.cmake
0 → 100644
View file @
53cb9a74
# - Find NUMA
# Find the NUMA library and includes
#
# NUMA_INCLUDE_DIR - where to find numa.h, etc.
# NUMA_LIBRARIES - List of libraries when using NUMA.
# NUMA_FOUND - True if NUMA found.
find_path
(
NUMA_INCLUDE_DIR
NAMES numa.h numaif.h
HINTS
${
NUMA_ROOT_DIR
}
/include
)
find_library
(
NUMA_LIBRARIES
NAMES numa
HINTS
${
NUMA_ROOT_DIR
}
/lib
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
NUMA DEFAULT_MSG NUMA_LIBRARIES NUMA_INCLUDE_DIR
)
mark_as_advanced
(
NUMA_LIBRARIES
NUMA_INCLUDE_DIR
)
librocksdb_sys/rocksdb/cmake/modules/FindTBB.cmake
0 → 100644
View file @
53cb9a74
# - Find TBB
# Find the Thread Building Blocks library and includes
#
# TBB_INCLUDE_DIR - where to find tbb.h, etc.
# TBB_LIBRARIES - List of libraries when using TBB.
# TBB_FOUND - True if TBB found.
find_path
(
TBB_INCLUDE_DIR
NAMES tbb/tbb.h
HINTS
${
TBB_ROOT_DIR
}
/include
)
find_library
(
TBB_LIBRARIES
NAMES tbb
HINTS
${
TBB_ROOT_DIR
}
/lib
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
TBB DEFAULT_MSG TBB_LIBRARIES TBB_INCLUDE_DIR
)
mark_as_advanced
(
TBB_LIBRARIES
TBB_INCLUDE_DIR
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment