<div dir="ltr">I agree with using PETSc.pc now that it's available (but it's not in petsc-3.3).<div><br></div><div style>FWIW, it should be putting everything but libpetsc into Libs.private (which will be used for static linking).</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 31, 2013 at 7:05 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Why all the nonstandard suggestions, why not just do what Satish suggested: (if those work for you let us know and we'll improve the pkgconfig file<br>
<br>
Barrys-MacBook-Pro:power_grid barrysmith$ more ~/Src/petsc-dev/arch-gnu/lib/pkgconfig/PETSc.pc<br>
prefix=/Users/barrysmith/Src/petsc-dev<br>
exec_prefix=${prefix}<br>
includedir=${prefix}/include<br>
libdir=/Users/barrysmith/Src/petsc-dev/arch-gnu/lib<br>
ccompiler=/Users/barrysmith/Src/petsc-dev/arch-gnu/bin/mpicc<br>
fcompiler=/Users/barrysmith/Src/petsc-dev/arch-gnu/bin/mpif90<br>
blaslapacklibs=-llapack -lblas<br>
<br>
Name: PETSc<br>
Description: Library to solve ODEs and algebraic equations<br>
Version: 3.3.0<br>
Cflags: -I/Users/barrysmith/Src/petsc-dev/include -I/Users/barrysmith/Src/petsc-dev/arch-gnu/include -I/usr/local/include/libAfterImage/ -I/opt/X11/include -I/Users/barrysmith/Src/ams-dev/include<br>
Libs: -L/Users/barrysmith/Src/petsc-dev/arch-gnu/lib  -lpetsc -lHYPRE -L/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/llvm-gcc-4.2/lib/gcc -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/llvm-gcc-4.2/lib -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib -lmpichcxx -lstdc++ -lml -lmpichcxx -lstdc++ -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lscalapack -lsuperlu_4.3 -lsuperlu_dist_3.2 -llapack -lblas -L/usr/local/include/libAfterImage/../../lib -lAfterImage -ltriangle -L/opt/X11/lib -lX11 -L/Users/barrysmith/Src/ams-dev/lib -lamspub -lparmetis -lmetis -lfftw3_mpi -lfftw3 -lptesmumps -lptscotch -lptscotcherr -lpthread -lyaml -lmpichf90 -lgfortran -L/usr/local/lib/gcc/x86_64-apple-darwin10.7.0/4.6.0 -L/usr/local/lib -lgfortran -lgcc_ext.10.5 -lquadmath -lm -lm -lmpichcxx -lstdc++ -lm -lz -lz -ldl -lpmpich -lmpich -lopa -lmpl -lSystem -ldl<br>

<div class="HOEnZb"><div class="h5"><br>
<br>
On Jan 31, 2013, at 6:34 PM, Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br>
<br>
> On Thu, 31 Jan 2013, Geoffrey Irving wrote:<br>
><br>
>> We have an scons build system linking against PETSc, and it would be<br>
>> nice to have an automatic way of determining the list of libraries<br>
>> that a statically linked, installed version of PETSc wants (e.g., the<br>
>> MacPorts installed version).  What's a good way to do such a thing<br>
>> from *outside* the PETSc build system?<br>
><br>
><br>
> One way is for some script [like configure or equivalent] to create a<br>
> simple petsc makefile and use any of the following targets to get<br>
> the required info<br>
><br>
>>>>>>>>>>>>><br>
> asterix:/home/balay/tmp>cat makefile<br>
> PETSC_DIR=/home/balay/spetsc<br>
> PETSC_ARCH=asterix64<br>
> include ${PETSC_DIR}/conf/variables<br>
> include ${PETSC_DIR}/conf/rules<br>
><br>
> asterix:/home/balay/tmp>make getincludedirs<br>
> -I/home/balay/spetsc/include -I/home/balay/spetsc/asterix64/include -I/home/balay/soft/linux64/mpich2-1.1/include -I/home/balay/soft/mpich2-1.5/include<br>
> asterix:/home/balay/tmp>make getlinklibs<br>
> -Wl,-rpath,/home/balay/spetsc/asterix64/lib -Wl,-rpath,/home/balay/spetsc/asterix64/lib -L/home/balay/spetsc/asterix64/lib -lpetsc -llapack -lblas -lX11 -lpthread -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib -L/home/balay/soft/mpich2-1.5/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm -lgfortran -lm -lquadmath -lm -ldl -lmpich -lopa -lmpl -lrt -lgcc_s -ldl<br>

> asterix:/home/balay/tmp><br>
>>>>>>>>>><br>
><br>
> [more similar targets are listed in conf/rules]<br>
><br>
> The other option is to use pkgconfig file created by configure.<br>
> It should be in PETSC_ARCH/lib/pkgconfig [in petsc-dev]<br>
><br>
> Satish<br>
><br>
<br>
</div></div></blockquote></div><br></div>