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 pcm location set(PCM_LOCATION ./thirdParty/pcm) set(PCM_LINKS -lpcm -L${CMAKE_CURRENT_LIST_DIR}/${PCM_LOCATION}/build/lib) # pass the in formation about the shared library location to the linker link_directories(${CMAKE_CURRENT_LIST_DIR}/${PCM_LOCATION}/build/lib) #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" "4") add_definitions(-DTHREAD_GROUP_MULTIPLIER=${THREAD_FACTOR}) eval(PINNING "cpu;numa" "cpu") add_definitions(-DPINNING=$) eval(PCM_M "true;false" "false") add_definitions(-DPCM_M=$) add_definitions(${PCM_LINKS}) # 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) include_directories(thirdParty/pcm/src) # link libraries link_libraries(-lnuma -lpthread) # Add targets only below # specify build targets add_executable(FilterAggregatePipeline src/benchmark/filter_aggregate_pipeline.cpp) add_executable(DoublyFiltered src/benchmark/doubly_filtered_agg.cpp) add_executable(DIMESBench src/benchmark/DIMES_benchmark.cpp) add_executable(DIMESCoreBench src/benchmark/DIMES_cores_benchmark.cpp) add_executable(MicroBench src/benchmark/micro_benchmarks.cpp) add_executable(MAXBench src/benchmark/MAX_benchmark.cpp src/benchmark/QDP_minimal.h) target_link_libraries(MAXBench libpcm.so) add_executable(LatencyBench src/benchmark/latency.cpp)