-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
67 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
cmake_minimum_required (VERSION 3.2) | ||
project (cacheCluster) | ||
set(CMAKE_BUILD_TYPE Debug) | ||
set(CMAKE_CXX_STANDARD 11) | ||
# set(CMAKE_BUILD_TYPE Debug) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
|
||
# clear an error when using cmake in macOS | ||
# if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
# set(CMAKE_MACOSX_RPATH 1) | ||
# # Fix linking on 10.14+. See https://stackoverflow.com/questions/54068035 | ||
# LINK_DIRECTORIES(/usr/local/lib) | ||
# # a temporary fix for mac | ||
# SET(CMAKE_C_FLAGS_DEBUG " -L/usr/local/lib -lglib-2.0 -lintl -Wno-unused-command-line-argument") | ||
# endif() | ||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/Modules/") | ||
find_package(GLib "2.40" REQUIRED) | ||
include_directories(${GLib_INCLUDE_DIRS}) | ||
message(STATUS "glib found? " ${GLib_FOUND} ", GLIB = " ${GLib_LIBRARY} ", header = " ${GLib_INCLUDE_DIRS}) | ||
|
||
|
||
find_package(ZSTD) | ||
# https://stackoverflow.com/questions/61377055/cannot-find-gflags-gflags-h-while-building-library-osx/61379123#61379123 | ||
include_directories(${ZSTD_INCLUDE_DIR}) | ||
if ("${ZSTD_LIBRARIES}" STREQUAL "") | ||
message(FATAL_ERROR "zstd not found") | ||
endif() | ||
|
||
|
||
################ this mode compiles the external cache replacement algorithm together with the simulator ############ | ||
message(STATUS "project_source dir = " ${PROJECT_SOURCE_DIR}) | ||
file(GLOB ALL_CXX_SRC ${PROJECT_SOURCE_DIR}/*.cpp) | ||
file(GLOB ALL_C_SRC ${PROJECT_SOURCE_DIR}/*.c) | ||
|
||
add_executable(cacheCluster ${ALL_CXX_SRC} ${ALL_C_SRC}) | ||
target_link_libraries(cacheCluster libCacheSim m ${GLib_LIBRARY} pthread dl) | ||
target_link_libraries(cacheCluster libCacheSim m ${GLib_LIBRARY} pthread dl ${ZSTD_LIBRARIES}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
cmake_minimum_required (VERSION 3.2) | ||
project (cacheSimulatorMultiSize) | ||
# set(CMAKE_BUILD_TYPE Debug) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") | ||
|
||
find_library(libCacheSim libCacheSim) | ||
find_path(libCacheSimInclude libCacheSim) | ||
include_directories(${libCacheSimInclude}) | ||
message(STATUS "libCacheSim found? ${libCacheSim}, ${libCacheSimInclude}") | ||
|
||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/Modules/") | ||
find_package(GLib "2.40" REQUIRED) | ||
include_directories(${GLib_INCLUDE_DIRS}) | ||
message(STATUS "glib found? ${GLib_FOUND}, lib = ${GLib_LIBRARY}, header = ${GLib_INCLUDE_DIRS}") | ||
|
||
find_package(ZSTD) | ||
# https://stackoverflow.com/questions/61377055/cannot-find-gflags-gflags-h-while-building-library-osx/61379123#61379123 | ||
include_directories(${ZSTD_INCLUDE_DIR}) | ||
if ("${ZSTD_LIBRARIES}" STREQUAL "") | ||
message(FATAL_ERROR "zstd not found") | ||
endif() | ||
|
||
add_executable(cacheSimulatorMultiSize main.cpp) | ||
target_link_libraries(cacheSimulatorMultiSize libCacheSim) | ||
target_link_libraries(cacheSimulatorMultiSize libCacheSim m ${GLib_LIBRARY} ${ZSTD_LIBRARIES}) | ||
|
Oops, something went wrong.