[petsc-users] minor error message compiling

Satish Balay balay at mcs.anl.gov
Wed Aug 8 14:00:08 CDT 2012


On Wed, 8 Aug 2012, Nachiket Gokhale wrote:

> On Wed, Aug 8, 2012 at 2:24 PM, Satish Balay <balay at mcs.anl.gov> wrote:
> > On Wed, 8 Aug 2012, Nachiket Gokhale wrote:
> >
> >> On Wed, Aug 8, 2012 at 1:03 PM, Satish Balay <balay at mcs.anl.gov> wrote:
> >> > On Wed, 8 Aug 2012, Nachiket Gokhale wrote:
> >> >
> >> >> I just upgraded to 3.3 and while compiling I get the following error:
> >> >>
> >> >> Traceback (most recent call last):
> >> >>   File "/opt/petsc/petsc-3.3-p2/bin/petscnagupgrade.py", line 54, in <module>
> >> >>     petscdir = os.environ['PETSC_DIR']
> >> >>   File "/usr/local/lib/python2.7/UserDict.py", line 23, in __getitem__
> >> >>     raise KeyError(key)
> >> >> KeyError: 'PETSC_DIR'
> >> >> make: [petscnagupgrade] Error 1 (ignored)
> >> >>
> >> >> Seems to occur only when the env variable PETSC_DIR is not defined;
> >> >> the program seems to compile properly inspite of this error.
> >> >
> >> > Hm petscnagupgrade.py is primarily invoked by make - and when using
> >> > PETSc makefiles - PETSC_DIR is always set - so I'm not sure why you
> >> > get this error.
> >> >
> >> > Are you using PETSc makefiles? What make are you using? [gnu/ bsd/solaris?]
> >> >
> >> > Does the attached patch fix it?
> >> >
> >> > patch -Np1 < petscnag.patch
> >> >
> >> > Satish
> >>
> >> Yes your attached patch fixes it. Thanks!
> >>
> >> I should have been more clear. The problem occured not while compiling
> >> PETSc but a small SlepC application. I am including
> >>
> >> include    ${SLEPC_DIR}/conf/slepc_common
> >>
> >> in my Makefile and relying on it to include PETSC variables.
> >>
> >> I have a standard Redhat Enterprise Linux system.
> >
> > Ok. Its still not clear to me whats causing this error. Without
> > PETSC_DIR set - how was your make able to get all the way to running
> > '/opt/petsc/petsc-3.3-p2/bin/petscnagupgrade.py' [because PETSC_DIR
> > was used to locate petscnagupgrade.py at the above path].
> >
> > Satish
> 
> 
> Well,  PETSC_DIR was always set in the Makefile (attached), but not in
> the environment variables in the shell.  Setting or unsetting in the
> bash shell seemed to trigger that error.

ok. Perhaps you can try using the attached alternate patch.

Satish
-------------- next part --------------
diff --git a/conf/rules b/conf/rules
--- a/conf/rules
+++ b/conf/rules
@@ -15,7 +15,7 @@
         fi
 
 petscnagupgrade:
-	-@${PETSC_DIR}/bin/petscnagupgrade.py
+	- at PETSC_DIR=${PETSC_DIR} ${PETSC_DIR}/bin/petscnagupgrade.py
 
 chk_loc:
 	@if [ ${LOC}foo = foo ] ; then \


More information about the petsc-users mailing list