cmake_minimum_required(VERSION 3.18) # set the project name project(NUMA_Slow_Fast_Datamigration_Test VERSION 0.1) # specify the C standard set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) #set flags on need cross compile for sapphirerapids architecture set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=sapphirerapids") #set flags on need cross compile for skylake micro architecture #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=skylake-avx512") #set flags on need cross compile for knights landing micro architecture (for debugging) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512cd -mavx512er -mavx512pf") #suppress selected! warnigs that are not very important to resolve. This is to keep the compileation output clean set(SUPPRESS_WARNINGS "-Wno-literal-suffix -Wno-volatile") set(DEBUG_FLAGS "-g3" "-ggdb") set(RELEASE_FLAGS "-O3") #set flags used for Release and Debug build type add_compile_options( "$<$:${RELEASE_FLAGS}>" "$<$:${DEBUG_FLAGS}>" ) # evaluate custom variables function(eval vname vvalid vdefault) # is variable is set to the below value if its not already defined from the comand line set(VALID ${vvalid} CACHE INTERNAL "Possible values for ${vname}") set(${vname} ${vdefault} CACHE STRING "The barrier mode") # command for GUI shenanigans set_property(CACHE ${vname} PROPERTY STRINGS VALID) if(${vname} IN_LIST VALID) message(STATUS "Variable ${vname} = ${${vname}}") else() message(STATUS "Variable ${vname} has invalid value ${${vname}}") # set the fallback value for use in parent function unset(${vname} CACHE) message(STATUS "Fallback to default: ${vname} = ${vdefault}") set(${vname} ${vdefault} PARENT_SCOPE) endif() endfunction() eval(WSUPPRESS "suppress;show" "show") if($ EQUAL 1) add_compile_options("${SUPPRESS_WARNINGS}") endif() eval(BARRIER_MODE "global;local" "global") add_definitions(-DBARRIER_MODE="${BARRIER_MODE}") eval(BUFFER_LIMIT "unlimited;limited" "unlimited") add_definitions(-DBUFFER_LIMIT=$) eval(QUERY "simple;complex" "simple") add_definitions(-DQUERY=$) eval(THREAD_FACTOR "1;2;3;4;5;6;7;8;9;10" "1") add_definitions(-DTHREAD_GROUP_MULTIPLIER=${THREAD_FACTOR}) # build directory set(CMAKE_BINARY_DIR "../bin") #relative to inside build set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) # include directories include_directories(src/utils) include_directories(src/algorithm) include_directories(src/algorithm/operators) # link libraries link_libraries(-lnuma -lpthread -l:libdml.a) # Add targets only below # specify build targets add_executable(MAXBench src/benchmark/MAX_benchmark.cpp)