diff --git a/CMakeLists.txt b/CMakeLists.txt index 9292a3cec14a207da123d163a379b37d7e188fa0..965bea6fded732d59b0e28fa2fb10585ebc74c48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 4569b6183c1d90d03bbc1675770fe806d924e6ae..e6488538e90b4a3022a76b49848ec897e2acc651 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -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} diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index 689e0c01ef777607a0356fc5ce9dcb978e527011..793ced82fa92f74fbe2309a809464662490d2473 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -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 diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index 60e8540dcb3311d484a60857566adb08988f7db1..75d3c79cda4182864ed58dd59efd831711db88af 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -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 @@ -127,4 +129,5 @@ if(GKFS_INSTALL_TESTS) PATTERN "__pycache__" EXCLUDE PATTERN ".pytest_cache" EXCLUDE ) + endif () endif()