Skip to content

Commit

Permalink
Fix pkg config detection and code cleanup (#224)
Browse files Browse the repository at this point in the history
* Fix libpmem detection in case of pkg_config is missing

* Remove SLAB_HASH macro

- all occurrences was replaced by HASH_POWER macro in b12de66
  • Loading branch information
michalbiesek authored and Yao Yue committed Jul 17, 2019
1 parent 3f984c5 commit 8b23de5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
33 changes: 33 additions & 0 deletions cmake/FindLIBPMEM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Find the libpmem library.
# Output variables:
# LIBPMEM_INCLUDE_DIRS : e.g., /usr/include/.
# LIBPMEM_LIBRARIES : Library path of libpmem
# LIBPMEM_FOUND : True if found.

##_____________________________________________________________________________
## Check for the header files

find_path (LIBPMEM_INCLUDE_DIRS
NAMES libpmem.h
PATH_SUFFIXES include
)

##_____________________________________________________________________________
## Check for the library

find_library (LIBPMEM_LIBRARIES pmem
PATH_SUFFIXES lib64 lib
)

##_____________________________________________________________________________
## Actions taken when all components have been found

find_package_handle_standard_args (LIBPMEM DEFAULT_MSG LIBPMEM_LIBRARIES LIBPMEM_INCLUDE_DIRS)

if (LIBPMEM_FOUND)
message (STATUS "Found components for LIBPMEM")
message (STATUS "LIBPMEM_INCLUDE_DIRS = ${LIBPMEM_INCLUDE_DIRS}")
message (STATUS "LIBPMEM_LIBRARIES = ${LIBPMEM_LIBRARIES}")
else ()
message(FATAL_ERROR "Could not find LIBPMEM, download and install from https://github.com/pmem/pmdk/releases")
endif ()
1 change: 0 additions & 1 deletion src/storage/slab/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define SLAB_EVICT_OPT EVICT_RS
#define SLAB_USE_FREEQ true
#define SLAB_PROFILE NULL
#define SLAB_HASH 16
#define SLAB_USE_CAS true
#define ITEM_SIZE_MIN 44 /* 40 bytes item overhead */
#define ITEM_SIZE_MAX (SLAB_SIZE - SLAB_HDR_SIZE)
Expand Down

0 comments on commit 8b23de5

Please sign in to comment.