-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (27 loc) · 959 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#specefiy required version - this is the newest one
cmake_minimum_required(VERSION 3.11)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
#use intel compiler
set (CMAKE_CXX_COMPILER "mpiicpc")
set (CMAKE_C_COMPILER "mpiicc")
#set as inlcude dir the current directory
#one could devide the project into more directorys later
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(project_sources
MY_MCP.cpp
costs.cpp
utils.cpp
)
#add compiler flags inlcuding cblas
set(C_flags "-mkl -Ofast -Wall -Wextra -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_flags}")
#set project name
project (MY_MCP)
#add an executable - using variables
add_executable(${PROJECT_NAME} ${project_sources})
#include MKL - here include your mkl path
include_directories("/opt/intel/mkl/include")
#place where libfabric is installed - needed for IntelMPI-2019
target_link_libraries(${PROJECT_NAME} "/usr/local/lib/libfabric.so.1")