Commit 54b41a5c authored by Marc Vef's avatar Marc Vef
Browse files

rocksdb setup

parent b27ddd5d
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
# Finds liblz4.
#
# This module defines:
# LZ4_FOUND
# LZ4_INCLUDE_DIR
# LZ4_LIBRARY
#

find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
find_library(LZ4_LIBRARY NAMES lz4)

# We require LZ4_compress_default() which was added in v1.7.0
if (LZ4_LIBRARY)
    include(CheckCSourceRuns)
    set(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR})
    set(CMAKE_REQUIRED_LIBRARIES ${LZ4_LIBRARY})
    check_c_source_runs("
#include <lz4.h>
int main() {
  int good = (LZ4_VERSION_MAJOR > 1) ||
    ((LZ4_VERSION_MAJOR == 1) && (LZ4_VERSION_MINOR >= 7));
return !good;
}" LZ4_GOOD_VERSION)
    set(CMAKE_REQUIRED_INCLUDES)
    set(CMAKE_REQUIRED_LIBRARIES)
endif ()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
        LZ4 DEFAULT_MSG
        LZ4_LIBRARY LZ4_INCLUDE_DIR LZ4_GOOD_VERSION)

if (NOT LZ4_FOUND)
    message(STATUS "Using third-party bundled LZ4")
else ()
    message(STATUS "Found LZ4: ${LZ4_LIBRARY}")
endif (NOT LZ4_FOUND)

mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARY)
 No newline at end of file
+64 −0
Original line number Diff line number Diff line
# Try to find RocksDB headers and library.
#
# Usage of this module as follows:
#
#     find_package(RocksDB)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
#  ROCKSDB_ROOT_DIR          Set this variable to the root installation of
#                            RocksDB if the module has problems finding the
#                            proper installation path.
#
# Variables defined by this module:
#
#  ROCKSDB_FOUND               System has RocksDB library/headers.
#  ROCKSDB_LIBRARIES           The RocksDB library.
#  ROCKSDB_INCLUDE_DIRS        The location of RocksDB headers.

find_path(ROCKSDB_DIR
        HINTS
        /usr
        /usr/local
        /usr/local/adafs/
        )

find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h
        HINTS
        /home/evie/adafs/git/rocksdb
        /usr
        /usr/local
        /usr/local/adafs
        ${ROCKSDB_DIR}
        PATH_SUFFIXES include
        )

find_library(ROCKSDB_LIBRARY rocksdb
        HINTS
        /home/evie/adafs/git/rocksdb
        /usr
        /usr/local
        /usr/local/adafs
        ${ROCKSDB_DIR}
        PATH SUFFIXES lib
        PATH_SUFFIXES lib/rocksdb
        #        ${ROCKSDB_ROOT_DIR}/lib
        #        ${ROCKSDB_ROOT_DIR}/lib/rocksdb
        )

set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR})
set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RocksDB DEFAULT_MSG
        ROCKSDB_INCLUDE_DIR
        ROCKSDB_LIBRARY
        )

mark_as_advanced(
        ROCKSDB_DIR
        ROCKSDB_LIBRARY
        ROCKSDB_INCLUDE_DIR
)
 No newline at end of file
+33 −0
Original line number Diff line number Diff line
#
# - Try to find Facebook zstd library
# This will define
# ZSTD_FOUND
# ZSTD_INCLUDE_DIR
# ZSTD_LIBRARIES
#

find_path(
        ZSTD_INCLUDE_DIR
        NAMES "zstd.h"
        HINTS
        "/usr/include"
)

find_library(
        ZSTD_LIBRARY
        NAMES zstd
        HINTS
        "/usr/lib"
)

set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
        ZSTD DEFAULT_MSG ZSTD_INCLUDE_DIR ZSTD_LIBRARIES)

mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARIES ZSTD_FOUND)

if (ZSTD_FOUND AND NOT ZSTD_FIND_QUIETLY)
    message(STATUS "ZSTD: ${ZSTD_INCLUDE_DIR}")
endif ()
 No newline at end of file
+36 −0
Original line number Diff line number Diff line

# This code is released under the
# Apache License Version 2.0 http://www.apache.org/licenses/.
#
# Copyright (c) 2012 Louis Dionne
#
# Find snappy compression library and includes. This module defines:
#   snappy_INCLUDE_DIRS - The directories containing snappy's headers.
#   snappy_LIBRARIES    - A list of snappy's libraries.
#   snappy_FOUND        - Whether snappy was found.
#
# This module can be controlled by setting the following variables:
#   snappy_ROOT - The root directory where to find snappy. If this is not
#                 set, the default paths are searched.

if (NOT snappy_ROOT)
    find_path(snappy_INCLUDE_DIRS snappy.h)
    find_library(snappy_LIBRARIES NAMES snappy)
else ()
    find_path(snappy_INCLUDE_DIRS snappy.h NO_DEFAULT_PATH PATHS ${snappy_ROOT})
    find_library(snappy_LIBRARIES NAMES snappy NO_DEFAULT_PATH PATHS ${snappy_ROOT})
endif ()

if (snappy_INCLUDE_DIRS AND snappy_LIBRARIES)
    set(snappy_FOUND TRUE)
else ()
    set(snappy_FOUND FALSE)
    set(snappy_INCLUDE_DIR)
    set(snappy_LIBRARIES)
endif ()

find_package_handle_standard_args(snappy DEFAULT_MSG
        snappy_INCLUDE_DIRS snappy_LIBRARIES
        )

mark_as_advanced(snappy_LIBRARIES snappy_INCLUDE_DIRS)
 No newline at end of file
+12 −2
Original line number Diff line number Diff line
@@ -15,10 +15,18 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

# required packages
find_package(FUSE3 REQUIRED)
# Rocksdb dependencies
find_package(LZ4 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
find_package(gflags REQUIRED)
find_package(snappy REQUIRED)
find_package(ZStd REQUIRED)
find_package(RocksDB REQUIRED)
# boost dependencies, system is required for filesystem #TODO VERSION UNTESTED. I USE 1.62
find_package(Boost 1.58 REQUIRED COMPONENTS system filesystem serialization)

include_directories(${FUSE3_INCLUDE_DIR} include/)
include_directories(${FUSE3_INCLUDE_DIR} ${ROCKSDB_INCLUDE_DIR} include/)
set(SOURCE_FILES src/main.cpp src/main.hpp src/fuse_ops.hpp src/configure.hpp
        src/classes/metadata.h src/classes/metadata.cpp src/classes/fs_data.h src/classes/fs_data.cpp
        src/classes/dentry.h src/classes/dentry.cpp
@@ -31,4 +39,6 @@ set(SOURCE_FILES src/main.cpp src/main.hpp src/fuse_ops.hpp src/configure.hpp

        )
add_executable(adafs ${SOURCE_FILES} src/main.cpp)
target_link_libraries(adafs ${FUSE3_LIBRARIES} -lpthread -lboost_system -lboost_filesystem -lboost_serialization -pg)
target_link_libraries(adafs ${FUSE3_LIBRARIES} ${ROCKSDB_LIBRARIES}
        ${snappy_LIBRARIES} ${ZLIB_LIBRARIES} ${LZ4_LIBRARY} ${BZIP2_LIBRARIES} ${gflags_LIBRARIES} ${ZStd_LIBRARIES}
        -lpthread -lboost_system -lboost_filesystem -lboost_serialization -pg)
Loading