You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arnoldi-distribuito/CMakeLists.txt

58 lines
2.1 KiB
CMake

# cmake_minimum_required(VERSION 3.5.0)
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# # set root of location to find PETSc's pkg-config
# set(PETSC $ENV{PETSC_DIR}/$ENV{PETSC_ARCH})
# set(ENV{PKG_CONFIG_PATH} ${PETSC}/lib/pkgconfig)
# # Remove the lines below if you do not wish to have PETSc determine the compilers
# execute_process ( COMMAND pkg-config PETSc --variable=ccompiler COMMAND tr -d '\n' OUTPUT_VARIABLE C_COMPILER)
# SET(CMAKE_C_COMPILER ${C_COMPILER})
# execute_process ( COMMAND pkg-config PETSc --variable=cxxcompiler COMMAND tr -d '\n' OUTPUT_VARIABLE CXX_COMPILER)
# if (CXX_COMPILER)
# SET(CMAKE_CXX_COMPILER ${CXX_COMPILER})
# endif (CXX_COMPILER)
# execute_process ( COMMAND pkg-config PETSc --variable=fcompiler COMMAND tr -d '\n' OUTPUT_VARIABLE FORTRAN_COMPILER)
# if (FORTRAN_COMPILER)
# SET(CMAKE_Fortran_COMPILER ${FORTRAN_COMPILER})
# enable_language(Fortran)
# endif (FORTRAN_COMPILER)
# # tells CMake to build the application ex1 from the source file ex1.c
# # this must appear AFTER the compilers are set
# project(main)
# add_executable(main main.c)
# find_package(MPI REQUIRED)
# include_directories(${MPI_INCLUDE_PATH})
# find_package(PkgConfig REQUIRED)
# pkg_search_module(PETSC REQUIRED IMPORTED_TARGET PETSc)
# target_link_libraries(main PkgConfig::PETSC)
1 year ago
cmake_minimum_required(VERSION 3.5.0)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Set root of location to find PETSc's pkg-config
1 year ago
set(PETSC $ENV{PETSC_DIR}/$ENV{PETSC_ARCH})
set(ENV{PKG_CONFIG_PATH} ${PETSC}/lib/pkgconfig)
# Remove the lines below if you do not wish to have PETSc determine the compilers
SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_CXX_COMPILER g++)
SET(CMAKE_Fortran_COMPILER gfortran)
enable_language(Fortran)
# Tells CMake to build the application ex1 from the source file ex1.c
# This must appear AFTER the compilers are set
1 year ago
project(main)
add_executable(main main.c)
find_package(MPI REQUIRED)
1 year ago
find_package(PkgConfig REQUIRED)
1 year ago
pkg_search_module(PETSC REQUIRED IMPORTED_TARGET PETSc)
target_link_libraries(main MPI::MPI_C MPI::MPI_CXX MPI::MPI_Fortran PkgConfig::PETSC)