problem with bison

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


Hi Satish,

I'm not sure to understand exactly what you mean. I tried to use the
-I option . It seems that include works out now but I still have a
problem with vecimpl.h

user at linux-46jw:> make program
bison -y  -dv  newent.y
gcc -g -Wall -DYYDEBUG   -I/usr/local/bin/petsc-2.3.3-p13/include
-I/usr/local/bin/petsc-2.3.3-p13/include/petsc
-I/usr/local/bin/petsc-2.3.3-p13/include/mpiuni
-I/usr/local/bin/petsc-2.3.3-p13/include/private
-I/usr/local/bin/petsc-2.3.3-p13/bmake/linux-gnu-c-debug   -c -o
newent.o y.tab.c
In file included from /usr/local/bin/petsc-2.3.3-p13/include/petscvec.h:427,
                from /usr/local/bin/petsc-2.3.3-p13/include/petscmat.h:6,
                from /usr/local/bin/petsc-2.3.3-p13/include/petscpc.h:6,
                from /usr/local/bin/petsc-2.3.3-p13/include/petscksp.h:6,
                from function.h:27,
                from newent.y:166:
/usr/local/bin/petsc-2.3.3-p13/include/private/vecimpl.h:236: error:
expected specifier-qualifier-list before 'MPI_Win'
newent.y: In function 'yyparse':
newent.y:740: warning: implicit declaration of function 'calcule_pk_apports'
newent.y:1900: warning: unused variable 'lu_fprod'
make: *** [newent.o] Error 1

The last thing is that I don't understand why include
${PETSC_DIR}/bmake/common/base doesn't work for bison?
Nico


On Thu, Jul 17, 2008 at 9:40 AM, Satish Balay <balay at mcs.anl.gov> wrote:
> 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