MPICH error when using petsc-3.0.0-p4

Satish Balay balay at mcs.anl.gov
Sun Apr 12 10:21:58 CDT 2009


2 changes you have to make for 3.0.0

1. "include/finclude.. -> "finclude..."

2. PETSC_AVOID_DECLARATIONS should be removed - and use petscdef.h
equivalnet files.
i.e

change:
#define PETSC_AVOID_DECLARATIONS
#include "include/finclude/petsc.h"
#include "include/finclude/petscvec.h"
#include "include/finclude/petscmat.h"
#include "include/finclude/petscksp.h"
#include "include/finclude/petscpc.h"
#undef PETSC_AVOID_DECLARATIONS

to:
#include "finclude/petscdef.h"
#include "finclude/petscvecdef.h"
#include "finclude/petscmatdef.h"
#include "finclude/petsckspdef.h"
#include "finclude/petscpcdef.h"

Satish

On Sun, 12 Apr 2009, Wee-Beng TAY wrote:

> Hi Satish,
> 
> I am now using the PETSc ex2f example. I tried "make ex2f" and manage to build
> and run the file. Then I used the options as a reference for my visual fortran
> and it worked.
> 
> The options are:
> 
> /compile_only /debug:full /include:"Debug/"
> /include:"d:\cygwin\codes\petsc-3.0.0-p4\win32_mpi_debug\include"
> /include:"d:\cygwin\codes\petsc-3.0.0-p4\include"
> /include:"E:\cygwin\codes\MPICH\SDK\include" /nologo /threads /warn:nofileopt
> /module:"Debug/" /object:"Debug/" /pdbfile:"Debug/DF60.PDB" /fpp:"/m"
> 
> and
> 
> ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
> advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
> odbccp32.lib libpetscts.lib libpetscsnes.lib libpetscksp.lib libpetscdm.lib
> libpetscmat.lib libpetscvec.lib libpetsc.lib mpich.lib libfblas.lib
> libflapack.lib /nologo /subsystem:console /incremental:yes
> /pdb:"Debug/ex2f.pdb" /debug /machine:I386 /out:"Debug/ex2f.exe" /pdbtype:sept
> /libpath:"d:\cygwin\codes\petsc-3.0.0-p4\win32_mpi_debug\lib"
> /libpath:"E:\cygwin\codes\MPICH\SDK\lib"
> 
> Now I add my own file called global.F and tried to compile, using the same
> options.But now it failed. The error is:
> 
> --------------------Configuration: ex2f - Win32 Debug--------------------
> Compiling Fortran...
> ------------------------------------------------------------------------
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F:
>    7: #include "include/finclude/petsc.h"
>        ^
> ** error  on line 7 in D:\cygwin\codes\pets: cannot find file specified
>     in include directive.
>    8: #include "include/finclude/petscvec.h"
>        ^
> ** error  on line 8 in D:\cygwin\codes\pets: cannot find file specified
>     in include directive.
>    9: #include "include/finclude/petscmat.h"
>        ^
> ** error  on line 9 in D:\cygwin\codes\pets: cannot find file specified
>     in include directive.
>   10: #include "include/finclude/petscksp.h"
>        ^
> ** error  on line 10 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>   11: #include "include/finclude/petscpc.h"
>        ^
> ** error  on line 11 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>   12: #include "include/finclude/petscsys.h"
>        ^
> ** error  on line 12 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>   97: #include "include/finclude/petsc.h"
>        ^
> ** error  on line 97 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>   98: #include "include/finclude/petscvec.h"
>        ^
> ** error  on line 98 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>   99: #include "include/finclude/petscmat.h"
>        ^
> ** error  on line 99 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>  100: #include "include/finclude/petscksp.h"
>        ^
> ** error  on line 100 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>  101: #include "include/finclude/petscpc.h"
>        ^
> ** error  on line 101 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
>  102: #include "include/finclude/petscsys.h"
>        ^
> ** error  on line 102 in D:\cygwin\codes\pets: cannot find file
>     specified in include directive.
> global.i
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F(65) : Error:
> Syntax error, found ',' when expecting one of: ( : % . = =>
> Vec    xx,b_rhs,xx_uv,b_rhs_uv
> -----------------^
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F(67) : Error:
> Syntax error, found ',' when expecting one of: ( : % . = =>
> Mat    A_mat,A_mat_uv    !  /* sparse matrix */
> --------------------^
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F(69) : Error:
> Syntax error, found ',' when expecting one of: ( : % . = =>
> KSP   ksp,ksp_uv    !/* linear solver context */
> -----------------^
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F(71) : Error:
> Syntax error, found ',' when expecting one of: ( : % . = =>
> PC pc,pc_uv
> ------------------^
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F(73) : Error:
> Syntax error, found END-OF-STATEMENT when expecting one of: ( : % . = =>
> PCType      ptype
> -------------------------^
> D:\cygwin\codes\petsc-3.0.0-p4\projects\fortran\ksp\ex2f\global.F(75) : Error:
> Syntax error, found END-OF-STATEMENT when expecting one of: ( : % . = =>
> KSPType  ksptype....
> 
> 
> I can get it to compile if I use :
> 
> Debug/;d:\cygwin\codes\petsc-3.0.0-p4;d:\cygwin\codes\petsc-3.0.0-p4\include;d:\cygwin\codes\petsc-3.0.0-p4\win32_mpi_debug\include;E:\cygwin\codes\MPICH\SDK\include
> 
> Compared to the original one above which is:
> 
> Debug/;d:\cygwin\codes\petsc-3.0.0-p4\win32_mpi_debug\include;d:\cygwin\codes\petsc-3.0.0-p4\include;E:\cygwin\codes\MPICH\SDK\include
> 
> Hence, there is an additional "d:\cygwin\codes\petsc-3.0.0-p4"
> 
> I have attached my global.F. I wonder if this is the cause of the MPICH error.
> 
> Currently, I have removed all other f90 files, except for global.F and
> flux_area.f90. It's when I 'm compiling flux_area.f90 that I got the MPI error
> stated below. I got the same error if I compile under cygwin using the same
> parameters.
> 
> Hope you can help.
> 
> Thank you very much and have a nice day!
> 
> Yours sincerely,
> 
> Wee-Beng Tay
> 
> 
> 
> Satish Balay wrote:
> > Do you get these errors with PETSc f90 examples?
> > 
> > what 'USE statement' do you have in your code?
> > 
> > I guess you'll have to check your code to see how you are using f90
> > modules/includes.
> > 
> > If you can get a minimal compileable code that can reproduce this
> > error - send us the code so that we can reproduce the issue
> > 
> > Satish
> > 
> > On Thu, 9 Apr 2009, Wee-Beng TAY wrote:
> > 
> >   
> > > Hi,
> > > 
> > > I just built petsc-3.0.0-p4 with mpich and after that, I reinstalled my
> > > windows xp and installed mpich in the same directory. I'm using CVF
> > > 
> > > Now, I found that when I'm trying to compile my code, I got the error:
> > > 
> > > :\cygwin\codes\MPICH\SDK\include\mpif.h(105) : Error: The attributes of
> > > this
> > > name conflict with those made accessible by a USE statement.
> > > [MPI_STATUS_SIZE]
> > >      INTEGER MPI_STATUS_IGNORE(MPI_STATUS_SIZE)
> > > --------------------------------^
> > > E:\cygwin\codes\MPICH\SDK\include\mpif.h(106) : Error: The attributes of
> > > this
> > > name conflict with those made accessible by a USE statement.
> > > [MPI_STATUS_SIZE]
> > >      INTEGER MPI_STATUSES_IGNORE(MPI_STATUS_SIZE)
> > > ----------------------------------^
> > > E:\cygwin\codes\petsc-3.0.0-p4\include/finclude/petsc.h(154) : Error: The
> > > attributes of this name conflict with those made accessible by a USE
> > > statement.   [MPI_DOUBLE_PRECISION]
> > >      parameter(MPIU_SCALAR = MPI_DOUBLE_PRECISION)
> > > ------------------------------^
> > > Error executing df.exe.
> > > 
> > > flux_area.obj - 3 error(s), 0 warning(s)
> > > 
> > > My include option is :
> > > 
> > > Debug/;$(PETSC_DIR);$(PETSC_DIR)\$(PETSC_ARCH)\;$(PETSC_DIR)\$(PETSC_ARCH)\include;$(PETSC_DIR)\include;E:\cygwin\codes\MPICH\SDK\include
> > > 
> > > 
> > > Interestingly, when I change my PETSC_DIR to petsc-dev, which correspond
> > > to an
> > > old build of petsc-2.3.3-p13, there is no problem.
> > > 
> > > May I know what's wrong? Btw, I've converted my mpif.h from using "C" as
> > > comments to "!".
> > > 
> > > Thank you very much and have a nice day!
> > > 
> > > Yours sincerely,
> > > 
> > > Wee-Beng Tay
> > > 
> > > 
> > >     
> > 
> > 
> >   



More information about the petsc-users mailing list