Re: [petsc-users] Configuring with CMake

2022-03-25 Thread Palmer, Bruce J via petsc-users
I didn't get around to writing a reproducer, but I did send an extensive complaint to the CMake user group. I haven't heard anything back yet. I finally got this to work by adding this to the CMakeLists.txt file if (NOT BUILD_SHARED_LIBS) target_link_libraries(gridpack_math PUBLIC

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Jed Brown
It would be good to report a reduced test case upstream. They may not fix it, but a lot of things related to static libraries don't work without coaxing and they'll never get fixed if people who use CMake with static libraries don't make their voices heard. "Palmer, Bruce J via petsc-users"

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Palmer, Bruce J via petsc-users
Argh, I'm an idiot. I can't write a proper print statement in CMake. The PETSC_STATIC_LDFLAGS variable is showing all the libraries so probably all I need to do is substitute that for PETSC_LDFLAGS in the GridPACK CMake build (once I find it) when the build is static. On 2/22/22, 10:39 AM,

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Satish Balay via petsc-users
You can run 'pkg-config --static --libs PETSC_DIR/PETSC_ARCH/lib/pkgconfig/petsc.pc' to verify if pkg-config is able to obtain 'Libs.private' values. And then you would need help from someone who can debug cmake - on why PETSC_STATIC set by cmake does not reflect this value [as it should - per

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Palmer, Bruce J via petsc-users
The static versions of the variables exist (PETSC_STATIC), but they appear to have the same values as the non-static variables. As I mentioned, I'm a complete novice at pkgconfig, but it looks like if you could add the contents of Libs.private to the link line, you'd be in business. Any idea

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Satish Balay via petsc-users
https://cmake.org/cmake/help/latest/module/FindPkgConfig.html >>> Two sets of values exist: One for the common case ( = ) and another for the information pkg-config provides when called with the --static option ( = _STATIC). <<< So perhaps CMAKE is already setting the _STATIC variant of (for

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Palmer, Bruce J via petsc-users
The contents of the petsc.pc file are listed below. It looks good to me. The Libs.private variable seems to include the -lf2clapack and -lf2cblas libraries. I don't know how this info gets propagated up the build chain. Bruce

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Satish Balay via petsc-users
The relevant pkg-config commands are: balay@sb /home/balay/petsc (release=) $ pkg-config --libs arch-linux-c-debug/lib/pkgconfig/petsc.pc -L/home/balay/petsc/arch-linux-c-debug/lib -lpetsc balay@sb /home/balay/petsc (release=) $ pkg-config --shared --libs

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Barry Smith
Bruce, Can you please send the PkgConfig calls that you make to get the PETSc values? And then exactly what PETSc PkgConfig returns. Thanks Barry > On Feb 22, 2022, at 11:03 AM, Palmer, Bruce J via petsc-users > wrote: > > Hi, > > We recently switched the CMake configuration on

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Satish Balay via petsc-users
Perhaps the easy fix is to build PETSc as shared libraries. [this is the default anyway] However wrt pkgconfig: $ cat arch-linux-c-debug/lib/pkgconfig/petsc.pc prefix=/home/balay/petsc/arch-linux-c-debug exec_prefix=${prefix} includedir=${prefix}/include libdir=${prefix}/lib

[petsc-users] Configuring with CMake

2022-02-22 Thread Palmer, Bruce J via petsc-users
Hi, We recently switched the CMake configuration on our GridPACK application to use the PkgConfig utility instead of Jeb Brown’s FindPETSc.cmake module. This seems to work on a number of platforms but it is failing to link on others. It appears that the build cannot find the LAPACK and BLAS