PETSC headers

billy at dem.uminho.pt billy at dem.uminho.pt
Sat Feb 18 10:32:49 CST 2006



No, the examples are working OK. I compiled
petsc/src/snes/examples/tutorials/ex10d/ex10.c and there is no problem.

I must be doing something wrong in my makefile.

# METIS
METIS_DIR = $(SOURCE_DIR)/metis
METIS_LIB = $(METIS_DIR)/libmetis.a

# Multiple processor - MPICH
ifeq ($(MPI_VERSION), MPICH)
  MPI_LIB = -L$(HOME)/MPICH/mpich-1.2.7/lib
  MPI_INC = -I$(HOME)/MPICH/mpich-1.2.7/include
  CFLAGS = -I$(SOURCE_DIR) -I$(LASPACK_DIR) $(MPI_INC) $(MPI_LIB)
$(PETSC_INCLUDE) $(PETSC_LIB) -lm
  CC = $(CLINKER)
endif

# Multiple processor - LAM
ifeq ($(MPI_VERSION), LAM)
  MPI_LIB = -L$(HOME)/LAMMPI/lam-7.1.1/linux/lib
  MPI_INC = -I$(HOME)/LAMMPI/lam-7.1.1/linux/include
  CFLAGS = -I$(SOURCE_DIR) -I$(LASPACK_DIR) $(MPI_INC) $(MPI_LIB)
$(PETSC_INCLUDE) $(PETSC_LIB) -lm -lmpi
  CC = $(CLINKER)
endif

# PETSC
include ${PETSC_DIR}/bmake/common/base

EXECUTABLE = examples/ex

all: $(SOURCE_OBJ) $(LASPACK_OBJ)

ifeq ($(MPI_VERSION),LAM)
	@echo ""
	@echo "***** Building with LAM option *****"
	@echo ""
endif

ifeq ($(MPI_VERSION),MPICH)
	@echo ""
	@echo "***** Building with MPICH option *****"
	@echo ""
endif

	$(CC) $(SOURCE_OBJ) $(METIS_LIB) $(PETSC_LIB) -o $(EXECUTABLE)


Billy.

Quoting Satish Balay <balay at mcs.anl.gov>:

> Not sure what was fixed in patches..
> 
> Bill - can you reproduce this error with a PETSc example?  [say
> src/snes/examples/tutorials/ex1.c]
> 
> Satish
> 
> On Fri, 17 Feb 2006, Matthew Knepley wrote:
> 
> > billy at dem.uminho.pt writes:
> > 
> >     Do you have the latest patchlevel for 2.3.0? Also, we just released
> > 2.3.1 and stringly recommend you upgrade since there are no interface
> changes.
> > I think this problem was fixed in a patch.
> > 
> >   Matt
> > 
> > > I added this line to my makefile:
> > >
> > > include $(PETSC_DIR)/bmake/common/base
> > >
> > > In my main.c file I added the header:
> > >
> > > #include "petsc.h"
> > >
> > > and it worked fine, but when I use instead: 
> > >
> > > #include "petscao.h"
> > > #include "petscsnes.h"
> > >
> > > I get the following errors during compilation:
> > >
> > > In file included from
> /home/billy/PETSC/petsc-2.3.0/include/petscao.h:8,
> > >                  from source/main.c:50:
> > > /home/billy/PETSC/petsc-2.3.0/include/petscis.h:167: error: parse error
> before
> > > numeric constant
> > > /home/billy/PETSC/petsc-2.3.0/include/petscis.h:167: warning: no
> semicolon at
> > > end of struct or union
> > > /home/billy/PETSC/petsc-2.3.0/include/petscis.h:172: error: parse error
> before
> > > '}' token
> > >
> > >
> > > Billy.
> > >
> > >
> > >
> > 
> > 
> 
> 





More information about the petsc-users mailing list