[petsc-dev] get moving on gnu make version of PETSc compiler

Satish Balay balay at mcs.anl.gov
Tue Sep 17 15:27:01 CDT 2013


On Tue, 17 Sep 2013, Satish Balay wrote:

> > We could generate the proper dependencies in gmakegen.py, but if
> > we're not checking the source to pick up module dependencies, I'd
> > rather use the hack in gmakefile.
> 
> I'm not sure if its possible to determine the module dependencies from sources.
> [esp since the targets are for .o - and not .mod]

If we are adding dependencies to gmakefile - the following would be
the change.  [I can push to jed/gnumake]

Satish

balay at petsc^/sandbox/balay/petsc.clone((4920dd4...)) $ git diff
diff --git a/config/BuildSystem/config/packages/MPI.py b/config/BuildSystem/config/packages/MPI.py
index a0232eb..14e976f 100644
--- a/config/BuildSystem/config/packages/MPI.py
+++ b/config/BuildSystem/config/packages/MPI.py
@@ -289,6 +289,7 @@ class Configure(config.package.Package):
   def alternateConfigureLibrary(self):
     '''Setup MPIUNI, our uniprocessor version of MPI'''
     self.addDefine('HAVE_MPIUNI', 1)
+    self.addMakeMacro('PETSC_USING_MPIUNI', 1)
     #
     #  Even though MPI-Uni is not an external package (it is in PETSc source) we need to stick the
     #  include path for its mpi.h and mpif.h so that external packages that are built with PETSc to
diff --git a/gmakefile b/gmakefile
index bd3ef2e..50187e6 100644
--- a/gmakefile
+++ b/gmakefile
@@ -134,6 +134,17 @@ $(OBJDIR)/%.o : %.cu | $$(@D)/.DIR
        $(PETSC_COMPILE.cu) $< -o $@ # Compile first so that if there is an error, it comes from a normal compile
        @$(PETSC_GENDEPS.cu) $< -o $(@:%.o=%.d) # Generate the dependencies for later
 
+ifeq ($(PETSC_USING_MPIUNI),1)
+$(OBJDIR)/src/sys/f90-mod/petscsysmod.o:$(OBJDIR)/src/sys/mpiuni/f90-mod/mpiunimod.o
+MPIUNI_MOD = $(PETSC_ARCH)/include/mpi.mod
+endif
+$(OBJDIR)/src/vec/f90-mod/petscvecmod.o:$(OBJDIR)/src/sys/f90-mod/petscsysmod.o
+$(OBJDIR)/src/mat/f90-mod/petscmatmod.o:$(OBJDIR)/src/vec/f90-mod/petscvecmod.o
+$(OBJDIR)/src/dm/f90-mod/petscdmmod.o:$(OBJDIR)/src/mat/f90-mod/petscmatmod.o
+$(OBJDIR)/src/ksp/f90-mod/petsckspmod.o:$(OBJDIR)/src/dm/f90-mod/petscdmmod.o
+$(OBJDIR)/src/snes/f90-mod/petscsnesmod.o:$(OBJDIR)/src/ksp/f90-mod/petsckspmod.o
+$(OBJDIR)/src/ts/f90-mod/petsctsmod.o:$(OBJDIR)/src/snes/f90-mod/petscsnesmod.o
+
 $(OBJDIR)/%.o : %.F | $$(@D)/.DIR
 ifeq ($(FC_MODULE_OUTPUT_FLAG),)
        cd $(PETSC_ARCH)/include && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) ../../$< -o ../../$@
@@ -153,7 +164,7 @@ endif
 .PHONY: clean all print
 
 clean:
-       rm -rf $(OBJDIR) $(LIBDIR)/libpetsc* $(PETSC_ARCH)/include/petsc*.mod $(generated)
+       rm -rf $(OBJDIR) $(LIBDIR)/libpetsc* $(PETSC_ARCH)/include/petsc*.mod $(MPIUNI_MOD) $(generated)
 
 # make print VAR=the-variable
 print:




More information about the petsc-dev mailing list