problem with bison

Nicolas Flipo Nicolas.Flipo at ensmp.fr
Thu Jul 17 10:06:26 CDT 2008


I've got a problem when compiling my code if I include petscksp.h in a *.h

Here is the error message (translated in english)

user at linux-46jw> make program
bison -y  -dv  newent.y
gcc -g -Wall -DYYDEBUG    -c -o newent.o y.tab.c
In file included from newent.y:166:
function.h:27:56: error: petscksp.h: Aucun fichier ou répertoire de ce
type (no file or folder found)

I have no problem to compile PETSc examples, so the environment
variable PETSC_DIR is correctely set in my system.

I also made a test including petscksp.h directly in the .y and it gave
me exactly the same error message, that's why I am suspecting
something with bison...

FYI here is my Makefile:

PROGRAMME= program
SOURCES.c = verouille.c hydraulique.c flux_apport.c init_hyd.c 	matrice.c

SOURCES.l = lexique.l

SOURCES.y = newent.y

SOURCES.h = parametres.h structurs.h var_globals.h functions.h

SOURCES.f=

CFLAGS_GLOBAUX= -g -Wall -DYYDEBUG
CFLAGS= $(CFLAGS_GLOBAUX)

YACC= bison -y
LEX= flex
YFLAGS= -dv
LFLAGS= -v

CC=gcc

OBJ= $(SOURCES.y:.y=.o) $(SOURCES.l:.l=.o) $(SOURCES.c:.c=.o)

CLEANFILES = $(OBJ) core y.*

include ${PETSC_DIR}/bmake/common/base

$(PROGRAMME) : $(OBJ) chkopts
	-$(CLINKER) -o $(PROGRAMME) $(OBJ) ${PETSC_KSP_LIB}
#	${RM} $(OBJ) #  rajouter une fois que tout marchera correctement


Thanks for your help
Nico




More information about the petsc-users mailing list