libMesh provides a m4 test for finding the PETSc library. You can find it here
https://github.com/libMesh/libmesh/blob/master/m4/petsc.m4 On Wed, Oct 12, 2016 at 3:18 PM, jeremy theler <jer...@seamplex.com> wrote: > I once made a quick hack, maybe you can start your dirty work from here > > https://bitbucket.org/wasora/wasora/src/5a88abbac1a846f2a6ed0b4e585f6f3c0fedf2e7/m4/petsc.m4?at=default&fileviewer=file-view-default > > -- > jeremy > > On Tue, Oct 11, 2016 at 5:31 PM Barry Smith <bsm...@mcs.anl.gov> wrote: >> >> >> You don't want to get the debug mode from PETSC_ARCH since there may >> not be a PETSC_ARCH (for PETSc --prefix installs) or because the user did >> not put the string in it. You can check for the PETSC_USE_DEBUG symbol in >> the petscconf.h file by linking a C program against <petscsys.h> and #if >> defined(PETSC_USE_DEBUG). >> >> >> Barry >> >> > On Oct 11, 2016, at 3:12 PM, CLAUS HELLMUTH WARNER HETZER >> > <cl...@olemiss.edu> wrote: >> > >> > Hi everybody- >> > >> > Figured I’d ask this here before I go reinventing the wheel. >> > >> > I’m writing an autoconf installer (the standard Linux configure/make >> > package) for an acoustic wave propagation modeling package that builds >> > PETSc >> > and SLEPc as part of the installation process. I’d like to be able to test >> > for instances of PETSc already being installed on the user’s machine and, >> > if >> > possible, whether they’re the debug version. I know I can check for the >> > existence of the PETSC_DIR environmental variable, and parse the PETSC_ARCH >> > variable for “debug”, and I’ll do that as a first pass, but has anybody >> > written any M4 tests that are more reliable than those (i.e. actually >> > attempting to link to the libraries)? I had one user who had the libraries >> > installed in /usr/local/bin but didn’t have the environmental variables set >> > in their profile, so the linker was confused and it took a while to figure >> > out what was going weird with the install. >> > >> > If not, I guess I’ll be putting on my Autoconf gloves and getting my >> > hands dirty. >> > >> > Thanks >> > -Claus Hetzer >> > >> > ------------------ >> > Claus Hetzer >> > Senior Research and Development Engineer >> > National Center for Physical Acoustics >> > The University of Mississippi >> > 145 Hill Drive >> > PO Box 1848 >> > University, MS 38677 >> > cl...@olemiss.edu >> > >> > >> > >> > >> > >> >