mosaic-group / openfpm

OpenFPM: A scalable open framework for particle and particle-mesh codes on parallel computers
http://openfpm.mpi-cbg.de/
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

PetSC source compilation and CMake detection #1

Open abhinavsns opened 4 months ago

abhinavsns commented 4 months ago

Currently, OpenFPM uses find_package(PETSc) for PETSc detection, this is not ideal because the corresponding CMake module findPETSc.cmake is deprecated. Further, a lot of options in script/install_PETSC.sh are no longer used.

A potential solution is to move to pkg-config. This is recommended by petsc-dev: https://www.mail-archive.com/petsc-dev@mcs.anl.gov/msg28259.html

Example implementation using pkg-config can be found at: https://stackoverflow.com/a/67885007

abhinavsns commented 4 months ago

With petsc 3.20.5 on MacOS arm64, I noticed a workaround can be to add METIS/lib to the ld_lib_pathopt in script/conf_CMake.sh just like we do for SUITESPARSE. https://github.com/mosaic-group/openfpm/blob/204393620c335330ebedd1dd98dc898712c70c7a/script/conf_CMake.sh#L156

abhinavsns commented 3 months ago

Now with the new config process that removes config.h, I noticed the HAVE PETSC variable is written correctly for abuild with $make but not for the binaries headers when installed using $make install on my macbook pro arm64.

Also the github Ubuntu CI is failing to detect PetSC and Eigen both. @syaskovets @incardon