Skip to content

Commit b44b91f

Browse files
committed
CMake: link MPI library
1 parent c41fba4 commit b44b91f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
cmake_minimum_required(VERSION 3.0)
22

3+
set(CMAKE_C_COMPILER "mpicc")
34
set(CMAKE_C_FLAGS "-O3 -std=c11 -Werror -Wall -Wextra -pedantic")
45

56
project(DistributedMalloc)
67

8+
find_package(MPI REQUIRED)
9+
710
# Vars with files for compilation
811
set(SRCS src/main.c src/utils.c src/cli.c)
912
include_directories("include/")
13+
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
1014

11-
add_executable(dmalloc ${SRCS})
15+
add_executable(dmalloc ${SRCS} ${MPI_C_LIBRARIES})
1216

0 commit comments

Comments
 (0)