[petsc-users] Compilation error

Jin, Shuangshuang Shuangshuang.Jin at pnnl.gov
Fri Jan 24 13:59:09 CST 2014


Thanks, your comment helps. After loading a newer version of gcc/4.6.2, the code got compiled successfully.

Thanks,
Shuangshuang

-----Original Message-----
From: Jed Brown [mailto:jed at jedbrown.org] 
Sent: Friday, January 24, 2014 11:55 AM
To: Jin, Shuangshuang; petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] Compilation error

"Jin, Shuangshuang" <Shuangshuang.Jin at pnnl.gov> writes:

> Hello, I successfully installed Petsc-dev on my cluster with the following configuration:
>
> ./configure --with-scalar-type=complex --with-clanguage=C++ 
> --download-f-blas-lapack PETSC_ARCH=arch-complex 
> --with-fortran-kernels=generic --download-superlu_dist 
> --download-mumps --download-scalapack --download-parmetis 
> --download-metis
>
> The PETSc libraries were built correctly, and test examples were ran to verfy correct installation.
>
> However, when I got to run the example in /Petsc-dev/src/ts/examples/tutorials/ex17.c, I got compilation an error as below:
>
> [d3m956 at philo tutorials]$ make ex17
> mpicxx -o ex17.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g   -fPIC    -I/pic/projects/ds/Powertech_Labs/petsc-dev.6.06.13/include -I/pic/projects/ds/Powertech_Labs/petsc-dev.6.06.13/arch-complex/include -I/share/apps/openmpi/1.6.5/gcc/4.6.2/include    -D__INSDIR__=src/ts/examples/tutorials/ ex17.c
> /pic/projects/ds/Powertech_Labs/petsc-dev.6.06.13/include/petscsnes.h(585): error: invalid argument to attribute "deprecated"
>   PETSC_DEPRECATED("Use SNESGetLineSearch()") PETSC_STATIC_INLINE PetscErrorCode SNESGetSNESLineSearch(SNES snes,SNESLineSearch *ls) {return SNESGetLineSearch(snes,ls);}
>   ^

You must be using a very old "petsc-dev".  Likely scenario here is that you have changed environments from when you configured, and now this older version of gcc (the Intel compiler changes its dialect based on which gcc it finds in path) has a dialect that doesn't support arguments to attribute deprecated.  This was so common that I unconditionally turned off use of the argument to attribute deprecated.  (Yes, this is worse for users that have a stable environment or don't use Intel compilers, but Intel's indirect environment-dependence causes the unacceptable breakage above so we had to work around it somehow.)


More information about the petsc-users mailing list