[petsc-users] error: cannot convert ‘bool’ to ‘PetscBool’ for argument ‘2’

Ted Sariyski tsariysk at craft-tech.com
Sun May 3 10:14:03 CDT 2015


Hi,
I am looking at petsc-3.5.3/src/snes/examples/tutorials. All examples, 
except ex12.c, works fine.
ex12.c compiles with error: "... cannot convert ‘bool’ to ‘PetscBool’ 
..." (see attachment). Do I miss something, or it's a bug?
Thanks,
--
Ted


/> make ex12
*********************W-a-r-n-i-n-g*************************
Your PETSC_DIR may not match the directory you are in
PETSC_DIR  /home/tsariysk/MFEMv3/pkgs/petsc-3.5.3/petsc-complex-dbg 
Current directory 
/work/tsariysk/MFEMv3/tars/petsc-3.5.3/src/snes/examples/tutorials
Ignore this if you are running make test
******************************************************
mpicxx -o ex12.o -c -Wall -Wwrite-strings -Wno-strict-aliasing 
-Wno-unknown-pragmas -g -O0   -fPIC 
-I/home/tsariysk/MFEMv3/pkgs/petsc-3.5.3/petsc-complex-dbg/include 
-I/home/tsariysk/MFEMv3/pkgs/petsc-3.5.3/petsc-complex-dbg/include 
-I/home/tsariysk/MFEMv3/pkgs/metis/include 
-I/home/tsariysk/MFEMv3/pkgs/petsc-3.5.3/petsc-complex-dbg/include 
-I/opt/mpich-3.1.4/include    `pwd`/ex12.c
/work/tsariysk/MFEMv3/tars/petsc-3.5.3/src/snes/examples/tutorials/ex12.c: 
In function ‘PetscErrorCode SetupDiscretization(DM, AppCtx*)’:
/work/tsariysk/MFEMv3/tars/petsc-3.5.3/src/snes/examples/tutorials/ex12.c:505:155: 
error: cannot convert ‘bool’ to ‘PetscBool’ for argument ‘2’ to 
‘PetscErrorCode DMPlexAddBoundary(DM, PetscBool, const char*, const 
char*, PetscInt, void (*)(), PetscInt, const PetscInt*, void*)’
make: *** [ex12.o] Error 1


ENVIRONMENT:
---------------------
Linux  2.6.18-128.1.1.el5 #1 SMP Tue Feb 10 11:36:29 EST 2009 x86_64 
x86_64 x86_64 GNU/Linux
g++ (GCC) 4.7.1
mpich-3.1.4

BUILD:
---------
export PETSC_ARCH=petsc-complex-dbg
export PETSC_CMAKE_ARCH=${PETSC_ARCH}
./configure                                        \
PETSC_DIR=${PETSC_DIR}  PETSC_ARCH=${PETSC_ARCH}   \
--prefix=${PETSC_INSTALL_DIR}/${PETSC_ARCH}        \
--with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \
--CFLAGS=-O                             \
--with-x                                \
--with-precision=double                 \
--with-scalar-type=complex               \
--with-clanguage=c++                    \
--with-debugger=gdb                       \
--with-debugging                            \
--with-fortran-datatypes=1                 \
--with-metis-dir=${PKGSDIR}/metis         \
--download-f2cblaslapack=yes \
--download-hdf5=yes \
--with-valgrind=1



More information about the petsc-users mailing list