Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 10, 2024
1 parent 1096e68 commit bd5f7c1
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ endif()
find_package(MPI REQUIRED)
if(UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()

endif()
# ===========================================================================
# Targets
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/benders/benders_by_batch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ message("MPI_C_LIBRARIES ${MPI_C_LIBRARIES}")

if (UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif ()
add_library(benders_by_batch_core)
target_sources(benders_by_batch_core PRIVATE
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/benders/benders_mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ find_package(MPI REQUIRED)

if (UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif ()

add_library(benders_mpi_core)
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/benders/outer_loop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ find_package(MPI REQUIRED)

if (UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif ()

add_library(outer_loop_lib)
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/exe/benders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ add_executable (benders
find_package(MPI REQUIRED)
if(UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif()

#IF (WIN32)
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/exe/full_run/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ find_package(MPI REQUIRED)

if (UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif ()

target_link_libraries(full_run
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/exe/outer_loop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ add_executable(outer_loop
find_package(MPI REQUIRED)
if (UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif ()

target_link_libraries(outer_loop
Expand Down
10 changes: 10 additions & 0 deletions tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ find_package(MPI REQUIRED)

if(UNIX)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
# Check if ccache is installed and available in PATH
find_program(CCACHE_EXECUTABLE ccache)

if (CCACHE_EXECUTABLE)
message(STATUS "Using ccache as the compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
else ()
message(WARNING "ccache not found. Proceeding without it.")
endif ()
endif()
# ===========================================================================
# Targets
Expand Down

0 comments on commit bd5f7c1

Please sign in to comment.