Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pkg-config to find fuse dependencies #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 17 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.6)
set(PROJECT_NAME cu_fuse)
project(${PROJECT_NAME})

set(${PROJECT_NAME} LANGUAGE CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand All @@ -13,39 +14,21 @@ 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=<path> 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=<path> 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)
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)
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})

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
Expand All @@ -64,15 +47,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 PkgConfig::MARGO PkgConfig::THALLIUM ${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)
1 change: 0 additions & 1 deletion src/copper/rpc_shutdown.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <thallium.hpp>
#include <thallium/serialization/stl/string.hpp>
#include <mpi.h>
#include <array>
#include <iostream>
#include <fstream>
Expand Down