[petsc-dev] Experimental GNU make build system

Satish Balay balay at mcs.anl.gov
Tue May 28 20:53:02 CDT 2013


On Thu, 23 May 2013, Jed Brown wrote:

> Satish Balay <balay at mcs.anl.gov> writes:
> 
> > __SDIR__ is primarily needed by 'all-legacy'. cmake/gmake builds are
> > using the full paths at compile time - so they don't need it [and are
> > using empty LOCDIR]
> 
> This should take care of all-legacy:
> 
> diff --git i/conf/rules w/conf/rules
> index 0fc01dc..f8b70ad 100644
> --- i/conf/rules
> +++ w/conf/rules
> @@ -391,7 +391,7 @@ getautoconfargs:
>          if [ $${mypwd} != $${newpwd} ]; then \
>           ${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chk_petscdir;\
>          fi
> -       ${PETSC_COMPILE_SINGLE} $<
> +       ${PETSC_COMPILE_SINGLE} ${PWD}/$<
>         @if [ "${PETSCPORTABLE}" != "" ]; then \
>            ${PYTHON} ${PETSC_DIR}/bin/portabilitycheck.py $*.o ; \
>          fi

I guess fortran sources don't need __SDIR__ - so the corresponding
targets don't need changes.

And we can use the following to get libfast working [This works with
solaris-make & bsd-make aswell]

PSOURCEC  = $(SOURCEC:%=${PWD}/%)                                                                              

I did a basic buid withe the following [checked on
linux,solaris,windows] - and it appears to work fine [assuming
"unknowndirectory/" stuff will be removed with other __SDIR__ changes]

2 Differences are [these should be ok]:

- full path listed in error messages.
'/export/home/petsc/petsc.clone/src/ksp/pc/interface/pcset.c'
[ vs previous message with 'src/ksp/pc/interface/pcset.c']

- The compilers now spit out the full file names. [as thats what we pass to them]

libfast in: /export/home/petsc/petsc.clone/src/sys/classes/viewer/interface
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/view.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/flush.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/viewregall.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/viewreg.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/viewa.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/dlregispetsc.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/viewers.c:
/export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/dupl.c:
libfast in: /export/home/petsc/petsc.clone/src/sys/classes/viewer/interface/ftn-auto


Satish

----------------
petsc at n-gage:~/petsc.clone/src/ksp/ksp/examples/tutorials$ ./ex2 -pc_type foobar
[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Unknown type. Check for miss-spelling or missing external package needed for type:
see http://www.mcs.anl.gov/petsc/documentation/installation.html#external!
[0]PETSC ERROR: Unable to find requested PC type foobar!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.4.0, unknown 
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: ./ex2 on a arch-opensolaris-pkgs-opt named n-gage by petsc Tue May 28 20:37:00 2013
[0]PETSC ERROR: Libraries linked from /export/home/petsc/petsc.clone/arch-opensolaris-pkgs-opt/lib
[0]PETSC ERROR: Configure run at Tue May 28 13:25:16 2013
[0]PETSC ERROR: Configure options --with-debugger=/bin/true --with-debugging=0 --download-mpich=1 --with-c2html=0 --download-cmake=1 --download-metis=1 --download-parmetis=1 --download-triangle=1 --download-superlu=1 --download-superlu_dist=1 --download-f-blas-lapack=1 --download-scalapack=1 --download-mumps=1 --download-sundials=1 --download-hypre=1 --download-umfpack=1 --download-chaco=1 --download-spai=1 --with-no-output -PETSC_ARCH=arch-opensolaris-pkgs-opt -PETSC_DIR=/export/home/petsc/petsc.clone
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: PCSetType() line 68 in "unknowndirectory/"/export/home/petsc/petsc.clone/src/ksp/pc/interface/pcset.c
[0]PETSC ERROR: PCSetFromOptions() line 163 in "unknowndirectory/"/export/home/petsc/petsc.clone/src/ksp/pc/interface/pcset.c
[0]PETSC ERROR: KSPSetFromOptions() line 357 in "unknowndirectory/"/export/home/petsc/petsc.clone/src/ksp/ksp/interface/itcl.c
[0]PETSC ERROR: main() line 192 in "unknowndirectory/"/export/home/petsc/petsc.clone/src/ksp/ksp/examples/tutorials/ex2.c
application called MPI_Abort(MPI_COMM_WORLD, 86) - process 0
[unset]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 86) - process 0
petsc at n-gage:~/petsc.clone/src/ksp/ksp/examples/tutorials$ 

-----
diff --git a/conf/rules b/conf/rules
index 0fc01dc..64ff8d8 100644
--- a/conf/rules
+++ b/conf/rules
@@ -391,7 +391,7 @@ getautoconfargs:
         if [ $${mypwd} != $${newpwd} ]; then \
 	  ${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chk_petscdir;\
         fi
-	${PETSC_COMPILE_SINGLE} $<
+	${PETSC_COMPILE_SINGLE} ${PWD}/$<
 	@if [ "${PETSCPORTABLE}" != "" ]; then \
           ${PYTHON} ${PETSC_DIR}/bin/portabilitycheck.py $*.o ; \
         fi
@@ -399,16 +399,16 @@ getautoconfargs:
 #
 #   Compiles CUDA code
 .cu.o:
-	${PETSC_CUCOMPILE_SINGLE} $<
+	${PETSC_CUCOMPILE_SINGLE} ${PWD}/$<
 
 .cu.a:
-	${PETSC_CUCOMPILE_SINGLE} $<
+	${PETSC_CUCOMPILE_SINGLE} ${PWD}/$<
 	-${AR} ${AR_FLAGS} ${LIBNAME} $*.o
 	-if test -n "${LIBTOOL}"; then ${AR} ${AR_FLAGS} ${LT_LIBNAME} $*.lo; fi
 	-${RM} $*.o $*.lo
 
 .c.a .cpp.a .cc.a .C.a:
-	-${PETSC_COMPILE_SINGLE} $<
+	-${PETSC_COMPILE_SINGLE} ${PWD}/$<
 	-${AR} ${AR_FLAGS} ${LIBNAME} $*.o
 	-if test -n "${LIBTOOL}"; then ${AR} ${AR_FLAGS} ${LT_LIBNAME} $*.lo; fi
 	-${RM} $*.o $*.lo
diff --git a/conf/variables b/conf/variables
index 79ce8ba..bd65385 100644
--- a/conf/variables
+++ b/conf/variables
@@ -10,7 +10,7 @@
 #
 PETSC_LIB_DIR	     = ${PETSC_DIR}/${PETSC_ARCH}/lib
 
-PETSC_CCPPFLAGS	    = ${PETSC_CC_INCLUDES} ${PETSCFLAGS} ${CPP_FLAGS} ${CPPFLAGS} -D__INSDIR__=${LOCDIR}
+PETSC_CCPPFLAGS	    = ${PETSC_CC_INCLUDES} ${PETSCFLAGS} ${CPP_FLAGS} ${CPPFLAGS}
 PETSC_FCPPFLAGS	    = ${PETSC_FC_INCLUDES} ${PETSCFLAGS} ${FPP_FLAGS} ${FPPFLAGS}
 PETSC_C_SH_LIB_PATH = ${CC_LINKER_SLFLAG}${PETSC_LIB_DIR}
 PETSC_F_SH_LIB_PATH = ${FC_LINKER_SLFLAG}${PETSC_LIB_DIR}
@@ -30,10 +30,12 @@ F_SH_LIB_PATH	= ${PETSC_F_SH_LIB_PATH}
 #
 # The following variables define PETSc compile procedures
 #
-PETSC_COMPILE         = ${PCC} -c ${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}  ${SOURCEC}
+PSOURCEC  = $(SOURCEC:%=${PWD}/%)
+PSOURCECU = $(SOURCECU:%=${PWD}/%)
+PETSC_COMPILE         = ${PCC} -c ${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}  ${PSOURCEC}
 PETSC_COMPILE_SINGLE  = ${PCC} -o $*.o -c ${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}
 PETSC_FCOMPILE        = ${FC} -c ${FC_FLAGS} ${FFLAGS} ${FCPPFLAGS}  ${SOURCEF}
-PETSC_CUCOMPILE       = ${CUDAC} ${CUDAC_FLAGS} -c --compiler-options="${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}" ${SOURCECU}
+PETSC_CUCOMPILE       = ${CUDAC} ${CUDAC_FLAGS} -c --compiler-options="${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}" ${PSOURCECU}
 PETSC_CUCOMPILE_SINGLE= ${CUDAC} -o $*.o ${CUDAC_FLAGS} -c --compiler-options="${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}"
 #
 # define OBJSC and OBJSF OBJSCU



More information about the petsc-dev mailing list