On Thu, Aug 5, 2010 at 10:39 AM, Filippo Spiga <span dir="ltr"><<a href="mailto:filippo.spiga@disco.unimib.it">filippo.spiga@disco.unimib.it</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear users,<br>
I look at different examples but I'm not sure to have well understood how to compile and link correctly using the contents of "conf/petscvariables" and "conf/variables". My program uses both linear and non linear solvers and different external packages such as superlu_dist, hypre and umfpack. I looked at "${PETSC_ROOT}/${PETSC_ARCH}/conf/petscvariables" to extract the right path to compile and link my code. Inside this file there are all these lines:<br>
<br>
PETSC_CONTRIB_BASIC = -lpetsc<br>
PETSC_SNES_LIB_BASIC = -lpetsc<br>
PETSC_KSP_LIB_BASIC = -lpetsc<br>
PETSC_MAT_LIB_BASIC = -lpetsc<br>
PETSC_LIB_BASIC = -lpetsc<br>
PETSC_VEC_LIB_BASIC = -lpetsc<br>
PETSC_DM_LIB_BASIC = -lpetsc<br>
PETSC_TS_LIB_BASIC = -lpetsc<br>
PETSC_SYS_LIB_BASIC = -lpetsc<br>
PACKAGES_LIBS = ...<br>
<br>
but there isn't a single entry that collect in the right order all of them. Then if I look at "${PETSC_ROOT}/${PETSC_ARCH}/conf/variables" I can find these lines:<br>
<br>
PETSC_EXTERNAL_LIB_BASIC = ${EXTERNAL_LIB} ${PACKAGES_LIBS} ${PCC_LINKER_LIBS}<br>
PETSC_SYS_LIB_BASIC = -lpetscsys<br>
PETSC_VEC_LIB_BASIC = -lpetscvec ${PETSC_SYS_LIB_BASIC}<br>
PETSC_MAT_LIB_BASIC = -lpetscmat ${PETSC_VEC_LIB_BASIC}<br>
PETSC_DM_LIB_BASIC = -lpetscdm ${PETSC_MAT_LIB_BASIC}<br>
PETSC_KSP_LIB_BASIC = -lpetscksp ${PETSC_DM_LIB_BASIC}<br>
PETSC_SNES_LIB_BASIC = -lpetscsnes ${PETSC_KSP_LIB_BASIC}<br>
PETSC_TS_LIB_BASIC = -lpetscts ${PETSC_SNES_LIB_BASIC}<br>
PETSC_LIB_BASIC = ${PETSC_TS_LIB_BASIC}<br>
PETSC_CONTRIB_BASIC = -lpetsccontrib<br>
<br>
PETSC_SYS_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_SYS_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_VEC_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_VEC_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_MAT_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_MAT_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_DM_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_DM_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_KSP_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_KSP_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_SNES_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_SNES_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_TS_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_TS_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_LIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_LIB_BASIC} ${PETSC_EXTERNAL_LIB_BASIC}<br>
PETSC_CONTRIB = ${C_SH_LIB_PATH} -L${PETSC_LIB_DIR} ${PETSC_CONTRIB_BASIC}<br>
<br>
that are pretty clear. However if I look inside "${PETSC_ROOT}/${PETSC_ARCH}/lib" I don't see all the -lpetsc* libraries mentioned above" I only have one single "libpetsc.a"<br>
<br>
So, what's the right env variable to use? what is the right order of -lpetsc* statements? Can I only link "libpetsc.a"? In this last case, is my Makefile fully compatible and maintenable with all the future version of PETSc?<br>
</blockquote><div><br></div><div>Is is always correct to use</div><div><br></div><div>include ${PETSC_DIR}/conf/variables</div><div>include ${PETSC_DIR}/conf/rules</div><div><br></div><div>foo: foo.o</div><div> ${CLINKER} -o foo foo.o ${PETSC_TS_LIB}</div>
<div><br></div><div>We switched in the latest release to having a single library, libpetsc.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thank you very much in advance,<br>
Regards<br><font color="#888888">
<br>
-- <br>
<br>
Filippo SPIGA<br>
<br>
«Nobody will drive us out of Cantor's paradise.»<br>
-- David Hilbert<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>