[petsc-users] Placing FindPETSc.cmake

Evan Um evanum at gmail.com
Fri May 11 13:28:56 CDT 2018


Hi,

I would like to ask a question about FindPETSc.cmake. I place the cmake
file in the same directory where main.cpp is placed. I also placed the file
in /usr/share/cmake_xx/Modules. Where should i put the file? What else
should I do to use the file in cmake? Do I need any other lines in my
cmakelists.txt except find_package(petsc)? Thanks for your comments.

Evan

-------------------------------------------------------------

cmake_minimum_required(VERSION 3.10)

project(hellopetsc)

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_C_COMPILER mpicc)
SET(CMAKE_CXX_COMPILER mpicxx)

find_package(PETSC COMPONENTS CXX)

add_executable(hellopetsc main.cpp)

------------------------------------------------------------
CMake Warning at CMakeLists.txt:9 (find_package):
  By not providing "FindPETSC.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PETSC", but
  CMake did not find one.

  Could not find a package configuration file provided by "PETSC" with any
of
  the following names:

    PETSCConfig.cmake
    petsc-config.cmake

  Add the installation prefix of "PETSC" to CMAKE_PREFIX_PATH or set
  "PETSC_DIR" to a directory containing one of the above files.  If "PETSC"
  provides a separate development package or SDK, be sure it has been
  installed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180511/4c5c3bb1/attachment.html>


More information about the petsc-users mailing list