Commit a2e97663 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch '118-agios-should-not-be-required-in-CMake' into 'master'

Resolve "AGIOS should not be required in CMake"

Closes #118

See merge request !62
parents 8402d979 27f032a6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -84,7 +84,6 @@ find_package(Snappy REQUIRED)
find_package(ZStd REQUIRED)
find_package(JeMalloc) # required if rocksdb has been build with jemalloc
find_package(RocksDB REQUIRED)
find_package(AGIOS) # optional
# margo dependencies
find_package(Mercury REQUIRED)
find_package(Abt REQUIRED)
@@ -132,6 +131,10 @@ message(STATUS "[gekkofs] Client logging output: ${ENABLE_CLIENT_LOG}")

option(GKFS_ENABLE_FORWARDING "Enable forwarding mode" OFF)
option(GKFS_ENABLE_AGIOS "Enable AGIOS scheduling library" OFF)
if (GKFS_ENABLE_AGIOS)
    find_package(AGIOS REQUIRED)
endif ()


set(CLIENT_LOG_MESSAGE_SIZE 1024 CACHE STRING "Maximum size of a log message in the client library")
add_definitions(-DLIBGKFS_LOG_MESSAGE_SIZE=${CLIENT_LOG_MESSAGE_SIZE})
+14 −75
Original line number Diff line number Diff line
@@ -48,10 +48,7 @@ set(PRELOAD_HEADERS
    ../../include/global/rpc/rpc_types.hpp
    ../../include/global/rpc/rpc_util.hpp
    )

add_library(gkfs_intercept SHARED ${PRELOAD_SRC} ${PRELOAD_HEADERS})

target_link_libraries(gkfs_intercept
set(PRELOAD_LINK_LIBRARIES
    # internal
    metadata
    distributor
@@ -62,73 +59,33 @@ target_link_libraries(gkfs_intercept
    mercury
    hermes
    fmt::fmt
    Boost::boost # needed for tokenizer header
    Boost::boost
    Threads::Threads
    Date::TZ
    )

target_include_directories(gkfs_intercept
    PRIVATE
set(PRELOAD_INCLUDE_DIRS
    ${ABT_INCLUDE_DIRS}
    ${MARGO_INCLUDE_DIRS}
    )

add_library(gkfs_intercept SHARED ${PRELOAD_SRC} ${PRELOAD_HEADERS})

target_link_libraries(gkfs_intercept ${PRELOAD_LINK_LIBRARIES})

target_include_directories(gkfs_intercept PRIVATE ${PRELOAD_INCLUDE_DIRS})

install(TARGETS gkfs_intercept
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gkfs
    )

################### Forwarding client ###################
if (GKFS_ENABLE_FORWARDING)
    set(FWD_PRELOAD_SRC
        gkfs_functions.cpp
        hooks.cpp
        intercept.cpp
        logging.cpp
        open_file_map.cpp
        open_dir.cpp
        path.cpp
        preload.cpp
        preload_context.cpp
        preload_util.cpp
        ../global/path_util.cpp
        ../global/rpc/rpc_util.cpp
        rpc/rpc_types.cpp
        rpc/forward_data.cpp
        rpc/forward_management.cpp
        rpc/forward_metadata.cpp
        syscalls/detail/syscall_info.c
        ${PRELOAD_SRC}
        )
    set(FWD_PRELOAD_HEADERS
        ../../include/client/gkfs_functions.hpp
        ../../include/config.hpp
        ../../include/client/env.hpp
        ../../include/client/hooks.hpp
        ../../include/client/intercept.hpp
        ../../include/client/logging.hpp
        ../../include/client/make_array.hpp
        ../../include/client/open_file_map.hpp
        ../../include/client/open_dir.hpp
        ../../include/client/path.hpp
        ../../include/client/preload.hpp
        ../../include/client/preload_context.hpp
        ../../include/client/preload_util.hpp
        ../../include/client/rpc/rpc_types.hpp
        ../../include/client/rpc/forward_management.hpp
        ../../include/client/rpc/forward_metadata.hpp
        ../../include/client/rpc/forward_data.hpp
        ../../include/client/syscalls/args.hpp
        ../../include/client/syscalls/decoder.hpp
        ../../include/client/syscalls/errno.hpp
        ../../include/client/syscalls/rets.hpp
        ../../include/client/syscalls/syscall.hpp
        ../../include/client/syscalls/detail/syscall_info.h
        ../../include/global/cmake_configure.hpp
        ../../include/global/chunk_calc_util.hpp
        ../../include/global/global_defs.hpp
        ../../include/global/path_util.hpp
        ../../include/global/rpc/rpc_types.hpp
        ../../include/global/rpc/rpc_util.hpp
        ${PRELOAD_HEADERS}
        )

    add_library(gkfwd_intercept SHARED ${FWD_PRELOAD_SRC} ${FWD_PRELOAD_HEADERS})
@@ -149,27 +106,9 @@ if (GKFS_ENABLE_FORWARDING)
    message(STATUS "[gekkofs] Forwarding mode: ${GKFS_ENABLE_FORWARDING}")
    message(STATUS "[gekkofs] AGIOS scheduling: ${GKFS_ENABLE_AGIOS}")

    target_link_libraries(gkfwd_intercept
        # internal
        metadata
        distributor
        env_util
        # external
        Syscall_intercept::Syscall_intercept
        dl
        mercury
        hermes
        fmt::fmt
        Boost::boost # needed for tokenizer header
        Threads::Threads
        Date::TZ
        )
    target_link_libraries(gkfwd_intercept ${PRELOAD_LINK_LIBRARIES})

    target_include_directories(gkfwd_intercept
        PRIVATE
        ${ABT_INCLUDE_DIRS}
        ${MARGO_INCLUDE_DIRS}
        )
    target_include_directories(gkfwd_intercept PRIVATE ${PRELOAD_INCLUDE_DIRS})

    install(TARGETS gkfwd_intercept
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+13 −53
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ set(DAEMON_HEADERS
    ../../include/daemon/handler/rpc_defs.hpp
    ../../include/daemon/handler/rpc_util.hpp
    )
add_executable(gkfs_daemon ${DAEMON_SRC} ${DAEMON_HEADERS})
target_link_libraries(gkfs_daemon
set(DAEMON_LINK_LIBRARIES
    # internal libs
    metadata
    metadata_db
@@ -47,54 +46,33 @@ target_link_libraries(gkfs_daemon
    mercury
    ${MARGO_LIBRARIES}
    # others
    Boost::boost # needed for tokenizer header
    Boost::boost
    Boost::program_options
    Boost::filesystem
    Threads::Threads
    )

target_include_directories(gkfs_daemon
    PRIVATE
set(DAEMON_INCLUDE_DIRS
    ${ABT_INCLUDE_DIRS}
    ${MARGO_INCLUDE_DIRS}
    )

add_executable(gkfs_daemon ${DAEMON_SRC} ${DAEMON_HEADERS})
target_link_libraries(gkfs_daemon ${DAEMON_LINK_LIBRARIES})

target_include_directories(gkfs_daemon PRIVATE ${DAEMON_INCLUDE_DIRS})

install(TARGETS gkfs_daemon
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )

################### Forwarding daemon ###################
if (GKFS_ENABLE_FORWARDING)
    set(FWD_DAEMON_SRC
        ../global/rpc/rpc_util.cpp
        ../global/path_util.cpp
        daemon.cpp
        util.cpp
        ops/metadentry.cpp
        ops/data.cpp
        classes/fs_data.cpp
        classes/rpc_data.cpp
        handler/srv_data.cpp
        handler/srv_metadata.cpp
        handler/srv_management.cpp
        ${DAEMON_SRC}
        scheduler/agios.cpp
        )
    set(FWD_DAEMON_HEADERS
        ../../include/config.hpp
        ../../include/version.hpp
        ../../include/global/cmake_configure.hpp
        ../../include/global/global_defs.hpp
        ../../include/global/rpc/rpc_types.hpp
        ../../include/global/rpc/rpc_util.hpp
        ../../include/global/path_util.hpp
        ../../include/daemon/daemon.hpp
        ../../include/daemon/util.hpp
        ${DAEMON_HEADERS}
        ../../include/daemon/scheduler/agios.hpp
        ../../include/daemon/ops/data.hpp
        ../../include/daemon/ops/metadentry.hpp
        ../../include/daemon/classes/fs_data.hpp
        ../../include/daemon/classes/rpc_data.hpp
        ../../include/daemon/handler/rpc_defs.hpp
        ../../include/daemon/handler/rpc_util.hpp
        )
    add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS})

@@ -115,32 +93,14 @@ if (GKFS_ENABLE_FORWARDING)
    message(STATUS "[gekkofs] AGIOS scheduling: ${GKFS_ENABLE_AGIOS}")

    target_link_libraries(gkfwd_daemon
        # internal libs
        metadata
        metadata_db
        storage
        distributor
        log_util
        env_util
        spdlog
        fmt::fmt
        ${DAEMON_LINK_LIBRARIES}
        ${AGIOS_LIBRARIES}
        # margo libs
        ${ABT_LIBRARIES}
        mercury
        ${MARGO_LIBRARIES}
        # others
        Boost::boost # needed for tokenizer header
        Boost::program_options
        Boost::filesystem
        Threads::Threads
        )

    target_include_directories(gkfwd_daemon
        PRIVATE
        ${DAEMON_INCLUDE_DIRS}
        ${AGIOS_INCLUDE_DIRS}
        ${ABT_INCLUDE_DIRS}
        ${MARGO_INCLUDE_DIRS}
        )

    install(TARGETS gkfwd_daemon
+4 −1
Original line number Diff line number Diff line
@@ -48,12 +48,14 @@ gkfs_add_python_test(
    SOURCE shell/
)

if (GKFS_TESTS_FORWARDING)
gkfs_add_python_test(
    NAME forwarding
    PYTHON_VERSION 3.6
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/integration
    SOURCE forwarding/
)
endif ()

gkfs_add_python_test(
    NAME test_data
@@ -119,7 +121,7 @@ if(GKFS_INSTALL_TESTS)
            PATTERN "__pycache__" EXCLUDE
            PATTERN ".pytest_cache" EXCLUDE
    )

    if (GKFS_TESTS_FORWARDING)
    install(DIRECTORY forwarding
        DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gkfs/tests/integration
        FILES_MATCHING
@@ -128,3 +130,4 @@ if(GKFS_INSTALL_TESTS)
            PATTERN ".pytest_cache" EXCLUDE
    )
    endif ()
endif()