From f2a563539d20f1a416ebf5387d2123c6372e7860 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Sun, 1 Mar 2020 21:46:36 +0100 Subject: [PATCH] Modified CMAKE files for WIN32 --- .gitmodules | 3 +++ DRAMSys/CMakeLists.txt | 12 +++++++++--- DRAMSys/library/CMakeLists.txt | 17 ++++++++++++----- .../src/common/third_party/sqlite-amalgamation | 1 + DRAMSys/library/src/simulation/dram/Dram.cpp | 13 +++++++++++-- DRAMSys/traceAnalyzer/CMakeLists.txt | 9 ++++++++- 6 files changed, 44 insertions(+), 11 deletions(-) create mode 160000 DRAMSys/library/src/common/third_party/sqlite-amalgamation diff --git a/.gitmodules b/.gitmodules index cd634d8d..13b67848 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,3 +11,6 @@ [submodule "DRAMSys/library/src/common/third_party/systemc"] path = DRAMSys/library/src/common/third_party/systemc url = https://github.com/accellera-official/systemc.git +[submodule "DRAMSys/library/src/common/third_party/sqlite-amalgamation"] + path = DRAMSys/library/src/common/third_party/sqlite-amalgamation + url = https://github.com/azadkuh/sqlite-amalgamation.git diff --git a/DRAMSys/CMakeLists.txt b/DRAMSys/CMakeLists.txt index 75ac6330..9ce35df7 100644 --- a/DRAMSys/CMakeLists.txt +++ b/DRAMSys/CMakeLists.txt @@ -37,9 +37,12 @@ project(DRAMSys) # Configuration: set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version") +set(DCMAKE_SH "CMAKE_SH-NOTFOUND" CACHE STRING "Ignore sh.exe error on Windows") # Add sqlite3 Dependency: -find_library(SQLITE3_LIBRARY NAMES sqlite3) +set(BUILD_ENABLE_RTREE ON CACHE BOOL "Enable R-Tree Feature") +set(BUILD_ENABLE_RTREE ON) +add_subdirectory(library/src/common/third_party/sqlite-amalgamation) # Add DRAMSysLibrary: add_subdirectory(library) @@ -49,6 +52,9 @@ add_subdirectory(traceAnalyzer) # Build: add_executable(DRAMSys simulator/main.cpp) -target_include_directories(DRAMSys PUBLIC DRAMSysLibrary library/src/simulation) -target_link_libraries(DRAMSys systemc sqlite3 DRAMSysLibrary) +target_include_directories(DRAMSys + PUBLIC library/src/simulation/ + PUBLIC library/src/common/third_party/sqlite-amalgamation/ +) +target_link_libraries(DRAMSys sqlite3::sqlite3 systemc DRAMSysLibrary) diff --git a/DRAMSys/library/CMakeLists.txt b/DRAMSys/library/CMakeLists.txt index 7094e300..e43b84a8 100644 --- a/DRAMSys/library/CMakeLists.txt +++ b/DRAMSys/library/CMakeLists.txt @@ -35,9 +35,6 @@ cmake_minimum_required(VERSION 3.10) # Project Name project(DRAMSysLibrary) -#set (CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version") - # Add DRAMPower: add_subdirectory(src/common/third_party/DRAMPower) @@ -46,6 +43,9 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libs") add_subdirectory(src/common/third_party/systemc) # Configuration: +set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version") +set(DCMAKE_SH="CMAKE_SH-NOTFOUND") + include_directories( src/simulation src/simulation/dram @@ -134,6 +134,13 @@ add_library(DRAMSysLibrary ) # Build: -target_include_directories(DRAMSysLibrary PUBLIC src/common/third_party/DRAMPower/src) -target_link_libraries(DRAMSysLibrary SystemC::systemc DRAMPower) +target_include_directories(DRAMSysLibrary + PUBLIC src/common/third_party/DRAMPower/src + PUBLIC src/common/third_party/sqlite-amalgamation/ +) +target_link_libraries(DRAMSysLibrary + SystemC::systemc + sqlite3::sqlite3 + DRAMPower +) diff --git a/DRAMSys/library/src/common/third_party/sqlite-amalgamation b/DRAMSys/library/src/common/third_party/sqlite-amalgamation new file mode 160000 index 00000000..9be05e13 --- /dev/null +++ b/DRAMSys/library/src/common/third_party/sqlite-amalgamation @@ -0,0 +1 @@ +Subproject commit 9be05e13408dd8cf8dafe8f11b1700a28194e07e diff --git a/DRAMSys/library/src/simulation/dram/Dram.cpp b/DRAMSys/library/src/simulation/dram/Dram.cpp index 93877ee1..b23e9c58 100644 --- a/DRAMSys/library/src/simulation/dram/Dram.cpp +++ b/DRAMSys/library/src/simulation/dram/Dram.cpp @@ -39,7 +39,11 @@ #include "Dram.h" -#include +#ifdef _WIN32 + #include +#else + #include +#endif #include #include #include @@ -78,7 +82,12 @@ Dram::Dram(sc_module_name name) : sc_module(name), tSocket("socket") else { // allocate and model storage of one DRAM channel using memory map - memory = (unsigned char *)mmap(NULL, memorySize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0); + #ifdef _WIN32 + SC_REPORT_FATAL("Dram", "On Windows Storage is not yet supported"); + memory = 0; // FIXME + #else + memory = (unsigned char *)mmap(NULL, memorySize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0); + #endif } } diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 13567b43..d4cc7b5a 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -43,7 +43,13 @@ find_package(PythonLibs REQUIRED) # Add QWT Dependency: find_library(QWT_LIBRARY NAMES "qwt-qt5" "qwt") -find_path (QWT_INCLUDE_DIRS NAMES "qwt_plot.h" PATHS "/usr/include/qwt-qt5" "/usr/include/qwt") +find_path (QWT_INCLUDE_DIRS NAMES "qwt_plot.h" PATHS + "/usr/include/qwt-qt5" + "/usr/include/qwt" + "C:\\Qwt\\" + "C:\\Qwt-6.1.4\\" + "C:\\Users\\jung\\Zeugs\\qwt\\qwt-614-install\\include" +) # Add QT Library: find_package(Qt5 COMPONENTS Core Gui Widgets Sql REQUIRED) @@ -54,6 +60,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Configure: set (CMAKE_CXX_STANDARD 11) +set(DCMAKE_SH="CMAKE_SH-NOTFOUND") include_directories( ${QWT_INCLUDE_DIRS}