Compleated Code

This commit is contained in:
elvis
2023-08-24 19:46:27 +02:00
parent 1c487e1a23
commit 1f2827a100
22 changed files with 4506 additions and 1 deletions

37
CMakeLists.txt Normal file
View File

@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.10)
project(main)
# exports compile_commands.json for the IDE
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(BEFORE SYSTEM ${PROJECT_SOURCE_DIR}/../fastflow/)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(UNIX AND NOT APPLE)
set(CMAKE_CXX_COMPILER "/usr/bin/g++")
set(CMAKE_CXX_FLAGS "-Wall")
else()
set(CMAKE_CXX_COMPILER "/opt/homebrew/bin/g++-13")
set(CMAKE_CXX_FLAGS "-Wall -DNO_DEFAULT_MAPPING")
endif()
# set(CMAKE_CXX_FLAGS "-Wall -DNO_DEFAULT_MAPPING -DBLOCKING_MODE")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -finline-functions")
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
add_library(timer timer.cpp timer.hpp)
add_library(threadpool threadPool.cpp threadPool.hpp)
target_link_libraries(threadpool Threads::Threads)
add_executable(main main.cpp reader.hpp writer.hpp task.hpp stencil.hpp)
include_directories(main PUBLIC ${PROJECT_SOURCE_DIR}/)
target_link_libraries(main Threads::Threads timer threadpool)