[petsc-users] Building apps on Cori (FindPETSc.cmake)

Jed Brown jed at jedbrown.org
Wed Jan 5 17:12:56 CST 2022


Yeah, recommendation is to use FindPkgConfig.cmake.

https://petsc.org/release/faq/#can-i-use-cmake-to-build-my-own-project-that-depends-on-petsc


If you are forced to use a very old CMake, then you need to inspect CMakeFiles/CMakeOutput.log and CMakeFiles/CMakeError.log. These files are somewhat confusing and often lack needed information. The debug-by-email experience with CMake has been so bad I've spent the last decade trying to get away from it. 

Satish Balay <balay at mcs.anl.gov> writes:

> Don't have suggestions for FindPETSc.cmake - however our current recommendation is to use pkgconf [from cmake] to detect petsc.
>
> Satish
>
> On Tue, 4 Jan 2022, ^PNNL GridPACK Account via petsc-users wrote:
>
>> Hi,
>> 
>> We’ve got some users of our GridPACK package that are trying to build on the Cori machine at NERSC. GridPACK uses CMake for its build system and relies on Jed Brown’s FindPETSc.cmake module, along with the FindPackageMultipass.cmake module to identify PETSc. The tests for PETSc are currently failing with
>> 
>> -- Checking PETSc ...
>> -- petsc_lib_dir /global/u1/s/smittal/petsc/arch-linux2-c-debug/lib
>> -- Recognized PETSc install with single library for all packages
>> -- Performing Test MULTIPASS_TEST_1_petsc_works_minimal
>> -- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Failed
>> -- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes
>> -- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes - Failed
>> -- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries
>> CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
>> Please set them or make sure they are set and tested correctly in the CMake files:
>> MPI_LIBRARY
>>     linked by target "cmTC_664e6" in directory /global/homes/s/smittal/GridPACK/build/CMakeFiles/CMakeTmp
>> PETSC_LIBRARY_SINGLE
>>     linked by target "cmTC_664e6" in directory /global/homes/s/smittal/GridPACK/build/CMakeFiles/CMakeTmp
>> 
>> CMake Error at /global/common/cori_cle7/software/cmake/3.21.3/share/cmake-3.21/Modules/Internal/CheckSourceRuns.cmake:94 (try_run):
>>   Failed to generate test project build system.
>> Call Stack (most recent call first):
>>   /global/common/cori_cle7/software/cmake/3.21.3/share/cmake-3.21/Modules/CheckCSourceRuns.cmake:76 (cmake_check_source_runs)
>>   /global/homes/s/smittal/GridPACK/cmake-jedbrown/FindPackageMultipass.cmake:97 (check_c_source_runs)
>>   /global/homes/s/smittal/GridPACK/cmake-jedbrown/FindPETSc.cmake:293 (multipass_source_runs)
>>   /global/homes/s/smittal/GridPACK/cmake-jedbrown/FindPETSc.cmake:332 (petsc_test_runs)
>>   CMakeLists.txt:280 (find_package)
>> 
>> 
>> -- Configuring incomplete, errors occurred!
>> 
>> We have code in the CMakeLists.txt file to identify a Cray build and set the MPI_LIBRARY variable to “” instead of NOTFOUND but that may be failing. The PETSC_LIBRARY_SINGLE error is new and one that I haven’t seen in past attempts to build at NERSC. My recollection was that the FindMPI module was not geared towards identifying the MPI compiler wrappers on Crays and that had a tendency to mess everything else up.
>> 
>> Have you seen these kinds of problems recently and if so, has anyone come up with a solution?
>> 
>> Bruce
>> 
>> 


More information about the petsc-users mailing list