Skip to content

Commit

Permalink
Create CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianyu-Liang authored Apr 10, 2023
1 parent 4afe381 commit d0a5b7f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 3.14)
project(hw4)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)

find_package(MPI REQUIRED)
find_package(Eigen3 3.3 REQUIRED NO_MODULE)

# Group number
set(GROUP_NAME "None" CACHE STRING "Your group name as it appears on bCourses (no spaces)")

# Packaging system
if (NOT ${GROUP_NAME} STREQUAL None)
set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_FILE_NAME "cs267${GROUP_NAME}_hw2_2")
install(FILES distributed_pcg.cpp DESTINATION .)
install(FILES ${CPACK_PACKAGE_FILE_NAME}.pdf DESTINATION .)
include(CPack)
endif ()

# We require the GNU compiler for this assignment.
if (NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(Prg-Clang "PrgEnv-cray")
message(WARNING
"Must use GNU Compiler for submission. Make sure you ran:\n"
"module swap ${Prg-${CMAKE_C_COMPILER_ID}} PrgEnv-gnu")
endif ()

add_executable(pcg distributed_pcg.cpp)
target_link_libraries(pcg PRIVATE MPI::MPI_CXX Eigen3::Eigen)



0 comments on commit d0a5b7f

Please sign in to comment.