[petsc-users] Compile and link correctly using conf/petscvariables and conf/variables

Satish Balay balay at mcs.anl.gov
Thu Aug 5 14:52:07 CDT 2010


You configure script would have to create this makefile and "echo
${PETSC_LIB}" - and other stuff you need form a given install of PETSc
- to detect what you want.

Anythings else is not portable. [And won't work across different PETSc
installations - of the same version]

If you want a simple solution - then you should just use PETSc from
makefile directly - and not introduce an extra configure step in the
middle.

satish

On Thu, 5 Aug 2010, Filippo Spiga wrote:

>  Dear Matthew,
> 
> Matthew Knepley wrote:
> > include ${PETSC_DIR}/conf/variables
> > include ${PETSC_DIR}/conf/rules
> > 
> > foo: foo.o
> >      ${CLINKER} -o foo foo.o ${PETSC_TS_LIB}
> 
> I already have a Makefile. But most important I have a autoconf script that
> generates my configure that generates my Makefile. So I have two
> possibilities:
> - modify every single Make template to use "conf/variables" and "conf/rules"
> as you suggested (long, boring and useless strategy because all my current
> Makefiles work. I only want to generalize the configure as much as possible
> replacing one single line);
> - or starting from "conf/petscvariables" I can try to compose by myself the
> only information I need to generalize my scripts.
> 
> I only need the name of the library. That's all. Or, if it was compiled
> splitting it in different indipendent libraries, I need the right order to
> link {PETSC_CONTRIB_BASIC, PETSC_SNES_LIB_BASIC, PETSC_KSP_LIB_BASIC,
> PETSC_MAT_LIB_BASIC, PETSC_LIB_BASIC, PETSC_VEC_LIB_BASIC, PETSC_DM_LIB_BASIC,
> PETSC_TS_LIB_BASIC, PETSC_SYS_LIB_BASIC}. I don't understand why
> "conf/petscvariables" doesn't provide that information. I guess it's easy to
> store it in one single explicit line. I'm looking for a easy way to ensure
> portability, I don't want to increase the complexity of the
> makefile/configure.
> 
> If starting from the last stable release PETSc is compiled by default in one
> single library (and it is), I can ignore all these stuffs until that kind of
> "portability" problem will arise. I will probably do that at this point...
> 
> Thank you very much for your explanations,
> Regards
> 
> 



More information about the petsc-users mailing list