[petsc-users] automatic determination of which libraries petsc wants

Geoffrey Irving irving at naml.us
Thu Jan 31 19:10:42 CST 2013


That would be nice, but unfortunately MacPorts doesn't seem to have
installed a .pc file anywhere:

    > find /opt/local -iname petsc.pc # produces nothing

I'm not very familiar with pkgconfig.  Would it be somewhere else?
pkg-config --list-all didn't have it either.

Geoffrey

On Thu, Jan 31, 2013 at 5:05 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>   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
>
> Barrys-MacBook-Pro:power_grid barrysmith$ more ~/Src/petsc-dev/arch-gnu/lib/pkgconfig/PETSc.pc
> prefix=/Users/barrysmith/Src/petsc-dev
> exec_prefix=${prefix}
> includedir=${prefix}/include
> libdir=/Users/barrysmith/Src/petsc-dev/arch-gnu/lib
> ccompiler=/Users/barrysmith/Src/petsc-dev/arch-gnu/bin/mpicc
> fcompiler=/Users/barrysmith/Src/petsc-dev/arch-gnu/bin/mpif90
> blaslapacklibs=-llapack -lblas
>
> Name: PETSc
> Description: Library to solve ODEs and algebraic equations
> Version: 3.3.0
> 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
> 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
>
>
> On Jan 31, 2013, at 6:34 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>
>> On Thu, 31 Jan 2013, Geoffrey Irving wrote:
>>
>>> We have an scons build system linking against PETSc, and it would be
>>> nice to have an automatic way of determining the list of libraries
>>> that a statically linked, installed version of PETSc wants (e.g., the
>>> MacPorts installed version).  What's a good way to do such a thing
>>> from *outside* the PETSc build system?
>>
>>
>> One way is for some script [like configure or equivalent] to create a
>> simple petsc makefile and use any of the following targets to get
>> the required info
>>
>>>>>>>>>>>>>>
>> asterix:/home/balay/tmp>cat makefile
>> PETSC_DIR=/home/balay/spetsc
>> PETSC_ARCH=asterix64
>> include ${PETSC_DIR}/conf/variables
>> include ${PETSC_DIR}/conf/rules
>>
>> asterix:/home/balay/tmp>make getincludedirs
>> -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
>> asterix:/home/balay/tmp>make getlinklibs
>> -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
>> asterix:/home/balay/tmp>
>>>>>>>>>>>
>>
>> [more similar targets are listed in conf/rules]
>>
>> The other option is to use pkgconfig file created by configure.
>> It should be in PETSC_ARCH/lib/pkgconfig [in petsc-dev]
>>
>> Satish
>>
>


More information about the petsc-users mailing list