[petsc-dev] BuildSystem: how to prevent 'make clean' before 'make'

Satish Balay balay at mcs.anl.gov
Wed Nov 29 17:40:05 CST 2017


Sure - there are lots of assumptions in GNUPackage and CMAKEPackage
[they assume most packages behave similarly wrt these types of builds]

And one can also override these default routines provided.

Some pacakges might provide a different 'clean' target. And some might prefer
VPATH? builds? [i.e mkdir objdir && cd objdir && ../configure && make]. 

The CMAKE packages default to this mode. Perhaps we need to add this for gnupackages aswell..

Satish

On Wed, 29 Nov 2017, Blaise A Bourdin wrote:

> Thanks.
> 
> I understand that it is not optimal. But OTOH, you are also assuming that make clean does what it is supposed to do…
> 
> Blaise
> 
> 
> > On Nov 29, 2017, at 5:29 PM, Satish Balay <balay at mcs.anl.gov> wrote:
> > 
> > Right now there is no provision for this. The following can add it.
> > 
> > 
> >>>>>>>>> 
> > $ git diff
> > diff --git a/config/BuildSystem/config/package.py b/config/BuildSystem/config/package.py
> > index 14de19502b..f9a2e68a25 100644
> > --- a/config/BuildSystem/config/package.py
> > +++ b/config/BuildSystem/config/package.py
> > @@ -80,6 +80,7 @@ class Package(config.base.Configure):
> >     self.makerulename           = '' # some packages do too many things with the make stage; this allows a package to limit to, for example, just building the libraries
> >     self.installedpetsc         = 0
> >     self.installwithbatch       = 0  # install the package even though configure is running in the initial batch mode; f2blaslapack and fblaslapack for example
> > +    self.skipcleanbeforebuild   = 0  # skip running 'make clean' before starting a fresh build of a package
> >     return
> > 
> >   def __str__(self):
> > @@ -1322,7 +1323,8 @@ class GNUPackage(Package):
> >       if self.parallelMake: pmake = self.make.make_jnp+' '+self.makerulename+' '
> >       else: pmake = self.make.make+' '+self.makerulename+' '
> > 
> > -      output2,err2,ret2  = config.base.Configure.executeShellCommand('cd '+self.packageDir+' && '+self.make.make+' clean', timeout=200, log = self.log)
> > +      if not self.skipcleanbeforebuild:
> > +        output2,err2,ret2  = config.base.Configure.executeShellCommand('cd '+self.packageDir+' && '+self.make.make+' clean', timeout=200, log = self.log)
> >       output3,err3,ret3  = config.base.Configure.executeShellCommand('cd '+self.packageDir+' && '+pmake, timeout=6000, log = self.log)
> >       self.logPrintBox('Running make install on '+self.PACKAGE+'; this may take several minutes')
> >       self.installDirProvider.printSudoPasswordMessage(self.installSudo)
> > <<<<<<<<
> > 
> > But then - a dirty build dir might break subsequent builds with the same PETSC_ARCH [usually triggered when configure options change]
> > 
> > Satish
> > 
> > On Wed, 29 Nov 2017, Blaise A Bourdin wrote:
> > 
> >> Hi,
> >> 
> >> I am trying to get BuildSystem to build pnetcdf (parallel netcdf automatically).
> >> The build process is very straightforward (configure; make; make install)
> >> Looking at other packages, I came up with the following for $PETSC_DIR/config/BuildSystem/config/packages/pnetcdf.py
> >> 
> >> import config.package
> >> import os
> >> 
> >> class Configure(config.package.GNUPackage):
> >>  def __init__(self, framework):
> >>    config.package.Package.__init__(self, framework)
> >>    self.download          = ['http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/parallel-netcdf-1.8.1.tar.gz']
> >>    self.functions         = ['ncmpi_create']
> >>    self.includes          = ['pnetcdf.h']
> >>    self.liblist           = [['libpnetcdf.a']]
> >>    self.downloaddirnames  = ['parallel-netcdf-1.8.1']
> >>    return
> >> 
> >>  def setupDependencies(self, framework):
> >>    config.package.GNUPackage.setupDependencies(self, framework)
> >>    self.mpi   = framework.require('config.packages.MPI', self)
> >>    self.deps  = [self.mpi]
> >>    return
> >> 
> >>  def formGNUConfigureArgs(self):
> >>    args = config.package.GNUPackage.formGNUConfigureArgs(self)
> >>    args.append('LIBS="'+self.compilers.LIBS+'"')
> >>    return args
> >> 
> >> 
> >> Looking at configure.log, it looks like BuildSystem does a make clean between configure and make
> >> Unfortunately, there must be something wrong with the parallel-netcdf makefile, as make clean erases some of the files generated by pkgconfig (?), so that make install later fails...
> >> 
> >> Is there an easy way to skip the 'make clean' step? 
> >> 
> >> Blaise
> >> 
> >> 
> >> 
> >> 
> > 
> 
> 


More information about the petsc-dev mailing list