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

Adding examples cmake option for gfind

parent 00bda3c1
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -234,6 +234,13 @@ gkfs_define_option(
    DEFAULT_VALUE OFF
)

# build examples
gkfs_define_option(
    GKFS_BUILD_EXAMPLES
    HELP_TEXT "Enable ${PROJECT_NAME} examples compilation"
    DEFAULT_VALUE OFF
)

cmake_dependent_option(GKFS_INSTALL_TESTS "Install GekkoFS self tests" OFF "GKFS_BUILD_TESTS" OFF)


+5 −1
Original line number Diff line number Diff line
@@ -326,6 +326,10 @@ add_subdirectory(include)
if (GKFS_BUILD_TOOLS)
    add_subdirectory(tools)
endif ()
if (GKFS_BUILD_EXAMPLES)
    find_package(MPI)
    add_subdirectory(examples/gfind)
endif ()

### Mark any CMake variables imported from {fmt} and spdlog as advanced, so
### that they don't appear in cmake-gui or ccmake. Similarly for FETCHCONTENT
@@ -366,7 +370,7 @@ if (GKFS_BUILD_TESTS)
    message(STATUS "[gekkofs] Guided distributor tests: ${GKFS_TESTS_GUIDED_DISTRIBUTION}")

    add_subdirectory(tests)
    add_subdirectory(examples/gfind)
    #    add_subdirectory(examples/gfind)
else()
    unset(GKFS_TESTS_INTERFACE CACHE)
endif()
+14 −0
Original line number Diff line number Diff line
@@ -28,16 +28,30 @@

set(CMAKE_CXX_STANDARD 17)
add_executable(sfind sfind.cpp)
add_executable(gfind)
add_executable(gkfs_lib_example gkfs_lib_example.cpp)

target_link_libraries(gkfs_lib_example
  PRIVATE gkfs_user_lib
)

set_property(TARGET gfind PROPERTY POSITION_INDEPENDENT_CODE ON)
target_sources(gfind
    PRIVATE
    gfind.cpp
)
target_link_libraries(gfind
    PUBLIC
    MPI::MPI_CXX
)

if(GKFS_INSTALL_TESTS)
    install(TARGETS sfind 
        DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    install(TARGETS gfind
        DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    install(TARGETS gkfs_lib_example
        DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
+0 −2
Original line number Diff line number Diff line
@@ -378,7 +378,6 @@ int process(char *processor_name, int world_rank, int world_size,

  // INIT PFIND
  memset(&runtime, 0, sizeof(pfind_runtime_options_t));
  int ret;
  /* Get timestamp file */
  if (opt->timestamp_file) {
    if (pfind_rank == 0) {
@@ -393,7 +392,6 @@ int process(char *processor_name, int world_rank, int world_size,
    MPI_Bcast(&runtime.ctime_min, 1, MPI_INT, 0, pfind_com);
  }

  auto iterations = 0;
  if (world_rank == 0) {
    queue<string> dirs;
    string workdir = opt->workdir;