From 8b30d6f23729e6cb5fc3ea2e569d33a7d14c6928 Mon Sep 17 00:00:00 2001 From: TheAssembler1 Date: Mon, 16 Sep 2024 19:31:17 -0400 Subject: [PATCH 1/2] use pkg-config to find fuse dependencies --- CMakeLists.txt | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb907bef..f80483a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.6) set(PROJECT_NAME cu_fuse) project(${PROJECT_NAME}) +set(CMAKE_CXX_COMPILER mpicxx) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -13,30 +14,14 @@ else() message(STATUS "BLOCK_REDUNDANT_RPCS is not enabled") endif() -set(FUSE3_INCLUDE_FILE "/usr/include/fuse3/fuse.h") -if(EXISTS "${FUSE3_INCLUDE_FILE}") - message(STATUS "File ${FUSE3_INCLUDE_FILE} exists.") - set(FUSE3_INCLUDE_DIR "/usr/include/fuse3") -else() - message(WARNING "Required File ${FUSE3_INCLUDE_FILE} does not exist. Please set -DFUSE3_INCLUDE= when invoking CMake.") -endif() - -set(FUSE3_LIB_FILE "/usr/lib64/libfuse3.so") -if(EXISTS "${FUSE3_LIB_FILE}") - message(STATUS "File ${FUSE3_LIB_FILE} exists.") - set(FUSE3_LIB_DIR "/usr/lib64") -else() - message(WARNING "Required File ${FUSE3_LIB_FILE} does not exist. Please set -DFUSE3_LIB= when invoking CMake.") -endif() - -link_directories(${FUSE3_LIB_DIR}) - find_package(PkgConfig REQUIRED) find_package(MPI REQUIRED) -set(CMAKE_CXX_COMPILER mpicxx) -pkg_check_modules (MARGO REQUIRED IMPORTED_TARGET margo) -pkg_check_modules (THALLIUM REQUIRED IMPORTED_TARGET thallium) +pkg_check_modules(FUSE3 REQUIRED fuse3) +pkg_check_modules(MARGO REQUIRED IMPORTED_TARGET margo) +pkg_check_modules(THALLIUM REQUIRED IMPORTED_TARGET thallium) + +include_directories(${FUSE3_INCLUDE_DIRS}) include_directories(${MPI_INCLUDE_PATH}) include_directories(${MARGO_INCLUDE_DIRS}) include_directories(${THALLIUM_INCLUDE_DIRS}) @@ -64,15 +49,16 @@ set(SOURCES src/cache/path_status_cache.cpp ) - add_executable(${PROJECT_NAME} ${SOURCES}) -target_include_directories(${PROJECT_NAME} PRIVATE "${FUSE3_INCLUDE_DIR}" "${MPI_INCLUDE_PATH}" "${MARGO_INCLUDE_DIRS}" "${THALLIUM_INCLUDE_DIRS}") -target_link_libraries(${PROJECT_NAME} PRIVATE ${MPI_CXX_LIBRARIES} PkgConfig::MARGO PkgConfig::THALLIUM fuse3 MPI::MPI_CXX) - +target_include_directories(${PROJECT_NAME} PRIVATE "${FUSE3_INCLUDE_DIRS}" "${MPI_INCLUDE_PATH}" "${MARGO_INCLUDE_DIRS}" "${THALLIUM_INCLUDE_DIRS}") +target_link_libraries(${PROJECT_NAME} PRIVATE ${MPI_CXX_LIBRARIES} PkgConfig::MARGO PkgConfig::THALLIUM MPI::MPI_CXX ${FUSE3_LIBRARIES}) +add_definitions(${FUSE3_CFLAGS_OTHER}) set(SHUTDOWN_PROJECT_NAME cu_fuse_shutdown) set(SHUTDOWN_SOURCES src/copper/rpc_shutdown.cpp) add_executable(${SHUTDOWN_PROJECT_NAME} ${SHUTDOWN_SOURCES}) -target_link_libraries(${SHUTDOWN_PROJECT_NAME} PRIVATE PkgConfig::MARGO PkgConfig::THALLIUM) +target_link_libraries(${SHUTDOWN_PROJECT_NAME} PRIVATE PkgConfig::MARGO PkgConfig::THALLIUM ${FUSE3_LIBRARIES}) +add_definitions(${FUSE3_CFLAGS_OTHER}) + +install(TARGETS ${PROJECT_NAME} DESTINATION bin) -install(TARGETS ${PROJECT_NAME} DESTINATION bin) \ No newline at end of file From 0b98e1752dfe30a18fa866a4996a81e8a5fee8cf Mon Sep 17 00:00:00 2001 From: TheAssembler1 Date: Thu, 19 Sep 2024 16:37:12 -0400 Subject: [PATCH 2/2] Remove MPI as a dependency --- CMakeLists.txt | 14 ++++++-------- src/copper/rpc_shutdown.cpp | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f80483a7..9c5f77ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.6) set(PROJECT_NAME cu_fuse) project(${PROJECT_NAME}) -set(CMAKE_CXX_COMPILER mpicxx) +set(${PROJECT_NAME} LANGUAGE CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -15,7 +15,9 @@ else() endif() find_package(PkgConfig REQUIRED) -find_package(MPI REQUIRED) +find_package(thallium CONFIG REQUIRED) +find_package(mercury CONFIG REQUIRED) +find_package(cereal CONFIG REQUIRED) pkg_check_modules(FUSE3 REQUIRED fuse3) pkg_check_modules(MARGO REQUIRED IMPORTED_TARGET margo) @@ -26,11 +28,7 @@ include_directories(${MPI_INCLUDE_PATH}) include_directories(${MARGO_INCLUDE_DIRS}) include_directories(${THALLIUM_INCLUDE_DIRS}) -find_package(thallium CONFIG REQUIRED) -find_package(mercury CONFIG REQUIRED) -find_package(cereal CONFIG REQUIRED) - -get_target_property (CEREAL_INC cereal::cereal INTERFACE_INCLUDE_DIRECTORIES) +get_target_property(CEREAL_INC cereal::cereal INTERFACE_INCLUDE_DIRECTORIES) set(SOURCES src/entry.cpp @@ -51,7 +49,7 @@ set(SOURCES add_executable(${PROJECT_NAME} ${SOURCES}) target_include_directories(${PROJECT_NAME} PRIVATE "${FUSE3_INCLUDE_DIRS}" "${MPI_INCLUDE_PATH}" "${MARGO_INCLUDE_DIRS}" "${THALLIUM_INCLUDE_DIRS}") -target_link_libraries(${PROJECT_NAME} PRIVATE ${MPI_CXX_LIBRARIES} PkgConfig::MARGO PkgConfig::THALLIUM MPI::MPI_CXX ${FUSE3_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::MARGO PkgConfig::THALLIUM ${FUSE3_LIBRARIES}) add_definitions(${FUSE3_CFLAGS_OTHER}) set(SHUTDOWN_PROJECT_NAME cu_fuse_shutdown) diff --git a/src/copper/rpc_shutdown.cpp b/src/copper/rpc_shutdown.cpp index 058853c5..230d2c59 100644 --- a/src/copper/rpc_shutdown.cpp +++ b/src/copper/rpc_shutdown.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include