jedbrown/cmake-modules

CMake ERROR: PETSC could not be found

Opened this issue · 3 comments

Dear,
When using ccmake to install bitpit, I get the following error:

CMake Error at
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137
(message):
PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH.
(missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378
(_FPHSA_FAILURE_MESSAGE)
external/PETSc/cmake/FindPETSc.cmake:348
(find_package_handle_standard_args)
CMakeLists.txt:524 (find_package)

However, I have set all environmental variables (PETSC_DIR, PETSC_ARCH, PETSC_INCLUDES, PETSC_LIBRARIES and PETSC_EXECUTABLE_RUNS). Does anybody know how to solve this?
Note: my os is ubuntu 18.04

For recent versions of PETSc, I would use CMake's pkg-config support. If you need debugging help here, please send CMakeFiles/CMakeOutput.log and CMakeFiles/CMakeError.log.

How do I use CMake's pkg-config support?
Here are the lg files:
CMakeError.log
CMakeOutput.log

Unfortunately, no useful output in those log files. Note that PETSC_INCLUDES, PETSC_LIBRARIES and PETSC_EXECUTABLE_RUNS are not environment variables and should not be set by you. They're intended to be set by FindPETSc.cmake.

But I recommend this: https://cmake.org/cmake/help/latest/module/FindPkgConfig.html