problem with bison
Satish Balay
balay at mcs.anl.gov
Thu Jul 17 11:40:38 CDT 2008
Hmm - perhaps you need to specify a '.y.c:' target in your makefile?
It loks like make is using a '.y.o:' target - thus skipping '.c.o:'
target as defined in PETSc makefiles.
> gcc -g -Wall -DYYDEBUG -c -o newent.o y.tab.c
If PETSc target for .c file is used - you should see
-I$PETSC_DIR/include etc options aswell.
Satish
On Thu, 17 Jul 2008, Nicolas Flipo wrote:
> 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