diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a6b30f3 --- /dev/null +++ b/CMakeLists.txt @@ -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) + + +