[petsc-users] Compile Errors with ifort 11.1

Satish Balay balay at mcs.anl.gov
Fri Nov 12 11:44:49 CST 2010


Attaching a minimal sample makefile. The additional info it would
need is PETSC_DIR, PETSC_ARCH values for your install of PETSc.

All example/tests,tutorial dirs have makefiles in petsc format..

Satish

On Fri, 12 Nov 2010, Tahar Amari wrote:

> Great thanks, it seems that -lpetsc alone works .
> 
>  I will follow this advice regarding the makefile, for the reason you gave.
>  Where should I get a typical makefile to modify please ?
> 
> Tahar
> 
> 
> Le 12 nov. 2010 à 18:34, Satish Balay a écrit :
> 
> > Make sure your compiles have all the flags listed here..
> > 
> > Its best to use petsc makefile formats so that this info is
> > automatically picked up from the petsc config files. [and not tweak
> > user makefiles for every install of petsc..]
> > 
> > Satish
> > 
> > On Fri, 12 Nov 2010, Tahar Amari wrote:
> > 
> >> You are right.
> >> 
> >> Here is what I got
> >> 
> >> 
> >> timac> make getincludedirs getlinklibs
> >> -I/Data/Poub1/petsc-3.1-p5/macx/include -I/Data/Poub1/petsc-3.1-p5/include -I/Data/Poub1/petsc-3.1-p5/macx/include
> >> -L/Data/Poub1/petsc-3.1-p5/macx/lib -L/Data/Poub1/petsc-3.1-p5/macx/lib -L/Data/Poub1/petsc-3.1-p5/macx/lib -lpetsc -L/usr/X11R6/lib -lX11 -L/Data/Poub1/petsc-3.1-p5/macx/lib -lparmetis -lmetis -lflapack -lfblas -L/Data/Poub1/petsc-3.1-p5/macx/lib -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -L/usr/lib/i686-apple-darwin10/4.2.1 -L/opt/intel/Compiler/11.1/088/lib -L/opt/intel/Compiler/11.1/088/Frameworks/mkl/lib/em64t -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -ldl -lpmpich -lmpich -lSystem -lmpichf90 -lifport -lifcore -limf -lsvml -lipgo -lgcc_s.10.5 -lSystemStubs -lmx -lirc -lpthread -ldl -lpmpich -lmpich -lSystem -ldl
> >> 
> >> 
> >> What does it mean please for me to change in my makefiles ?
> >> 
> >> Do you mean that I should remove any link other than -lpetsc ?
> >> 
> >> Great thanks
> >> 
> >> Tahar
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> Le 12 nov. 2010 à 18:26, Satish Balay a écrit :
> >> 
> >>> Looks like you are not using PETSc makefiles - and upgrading from
> >>> older release to petsc-3.1
> >>> 
> >>> Currently there is only one library for petsc [-lpetsc]
> >>> 
> >>> Check:
> >>> cd $PETSC_DIR
> >>> make getincludedirs getlinklibs
> >>> 
> >>> Satish
> >>> 
> >>> On Fri, 12 Nov 2010, Tahar Amari wrote:
> >>> 
> >>>> Many thanks. This is solved.
> >>>> 
> >>>> Now at link I have the library not found. Any idea ?
> >>>> 
> >>>> 
> >>>> -L/usr/local/petsc/macx/lib -lpetscsnes -lpetscvec -lpetscmat -lpetsccontrib -lpetscts -lpetscdm -lpetscksp -lpetsc -lmpich -lpmpich -lfmpich -lmpichf90 -lparmetis -lmetis -lfblas -lflapack
> >>>> ld: library not found for -lpetscsnes
> >>>> 
> >>>> 
> >>>> Tahar
> >>>> 
> >>>> 
> >>>> Le 12 nov. 2010 à 18:17, Satish Balay a écrit :
> >>>> 
> >>>>> Looks like this is related to the following:
> >>>>> http://www.mcs.anl.gov/petsc/petsc-as/documentation/changes/31.html
> >>>>> # petsc.h and petscdef.h are replaced with petscsys.h and petscsysdef.h; while petsc.h now includes ALL PETSc include files.
> >>>>> 
> >>>>> Try removing all includes other than 'petsc.h' from your code.
> >>>>> 
> >>>>> Satish
> >>>>> 
> >>>>> On Fri, 12 Nov 2010, Tahar Amari wrote:
> >>>>> 
> >>>>>> Hello,
> >>>>>> 
> >>>>>> While compiling one of my code with ifort , I have the following error pointing 
> >>>>>> towards petscvec.h .
> >>>>>> 
> >>>>>> Any idea about this posssible kind of error please ? Any option of ifort to use ?
> >>>>>> 
> >>>>>> Many thanks
> >>>>>> 
> >>>>>> Tahar
> >>>>>> 
> >>>>>> 
> >>>>>> ifort -assume byterecl  -I/usr/local/petsc/ -I/usr/local/petsc//include -I/usr/local/petsc//include/finclude -I/usr/local/petsc//macx/include -I/usr/X11R6/include/X11 -DPETSC_HAVE_PARMETIS -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK -DPETSC_AVOID_MPIF_H -c petsc.fpp
> >>>>>> /usr/local/petsc//include/finclude/petscvec.h(10): error #6418: This name has already been assigned a data type.   [NORM_1]
> >>>>>>    integer(kind=selected_int_kind(5)) NORM_1
> >>>>>> 
> >>>>>> 
> >>>>>> 
> >>>>>> --------------------------------------------
> >>>>>> T. Amari
> >>>>>> Centre de Physique Theorique
> >>>>>> Ecole Polytechnique
> >>>>>> 91128 Palaiseau Cedex France
> >>>>>> tel : 33 1 69 33 42 52
> >>>>>> fax: 33 1 69 33 49 49
> >>>>>> email: <mailto:amari at cpht.polytechnique.fr>
> >>>>>> URL : http://www.cpht.polytechnique.fr/cpht/amari
> >>>>>> 
> >>>>>> 
> >>>>>> 
> >>>>>> 
> >>>>>> 
> >>>>> 
> >>>> 
> >>>> --------------------------------------------
> >>>> T. Amari
> >>>> Centre de Physique Theorique
> >>>> Ecole Polytechnique
> >>>> 91128 Palaiseau Cedex France
> >>>> tel : 33 1 69 33 42 52
> >>>> fax: 33 1 69 33 49 49
> >>>> email: <mailto:amari at cpht.polytechnique.fr>
> >>>> URL : http://www.cpht.polytechnique.fr/cpht/amari
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >> 
> >> --------------------------------------------
> >> T. Amari
> >> Centre de Physique Theorique
> >> Ecole Polytechnique
> >> 91128 Palaiseau Cedex France
> >> tel : 33 1 69 33 42 52
> >> fax: 33 1 69 33 49 49
> >> email: <mailto:amari at cpht.polytechnique.fr>
> >> URL : http://www.cpht.polytechnique.fr/cpht/amari
> >> 
> >> 
> >> 
> >> 
> >> 
> 
> --------------------------------------------
> T. Amari
> Centre de Physique Theorique
> Ecole Polytechnique
> 91128 Palaiseau Cedex France
> tel : 33 1 69 33 42 52
> fax: 33 1 69 33 49 49
> email: <mailto:amari at cpht.polytechnique.fr>
> URL : http://www.cpht.polytechnique.fr/cpht/amari
> 
> 
> 
> 
> 
-------------- next part --------------
CFLAGS	         =
FFLAGS	         =
CPPFLAGS         =
FPPFLAGS         =
CLEANFILES       =

include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules

OBJS = ex1.o

ex1: ${OBJS} chkopts
	-${CLINKER} -o ex1 ${OBJS}  ${PETSC_LIB}



More information about the petsc-users mailing list