[petsc-users] errors in compiling ~\petsc-3.2-p7\src\ksp\ksp\examples\tutorials\ex2f.F

Barry Smith bsmith at mcs.anl.gov
Mon Mar 19 21:47:25 CDT 2012


  Run make ex5f on src/snes/examples/tutorials   

   Does that compile and link correctly? Note all the libraries that being linked (they are printed to the screen) and make sure you have them all.

   Also note that you must use the same BLAS in building PETSc that you link against. So make sure you built PETSc with the mkl libraries.

   Barry

On Mar 19, 2012, at 9:18 PM, Roc Wang wrote:

> Hello,
> 
> I am trying to compile the example source code of ~\petsc-3.2-p7\src\ksp\ksp\examples\tutorials\ex2f.F. However the error information shows:
> 
> ex2f.o: In function `MAIN__':
> ex2f.F90:(.text+0x1b): undefined reference to `_gfortran_set_std'
> ex2f.F90:(.text+0x6f1): undefined reference to `_gfortran_st_write'
> ex2f.F90:(.text+0x706): undefined reference to `_gfortran_transfer_real'
> ex2f.F90:(.text+0x71b): undefined reference to `_gfortran_transfer_integer'
> ex2f.F90:(.text+0x727): undefined reference to `_gfortran_st_write_done'
> ex2f.F90:(.text+0x773): undefined reference to `_gfortran_st_write'
> ex2f.F90:(.text+0x788): undefined reference to `_gfortran_transfer_integer'
> ex2f.F90:(.text+0x794): undefined reference to `_gfortran_st_write_done'
> ex2f.o: In function `mykspmonitor_':
> ex2f.F90:(.text+0x896): undefined reference to `_gfortran_st_write'
> ex2f.F90:(.text+0x8ae): undefined reference to `_gfortran_transfer_integer'
> ex2f.F90:(.text+0x8ba): undefined reference to `_gfortran_st_write_done'
> ex2f.F90:(.text+0x924): undefined reference to `_gfortran_st_write'
> ex2f.F90:(.text+0x93c): undefined reference to `_gfortran_transfer_integer'
> ex2f.F90:(.text+0x954): undefined reference to `_gfortran_transfer_real'
> ex2f.F90:(.text+0x960): undefined reference to `_gfortran_st_write_done'
> make: *** [ex2f] Error 1
>   
> 
> My makefile is like this:
> 
> ########################################################################
> PETSC_DIR     =/usr/global/petsc/3.1-p8
> PETSC_ARCH 	=linux-intel11-debug
> FFLAGS      = -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include
> LFLAGS = -L${PETSC_DIR}/${PETSC_ARCH}/lib -lpetsc\
>  	-L/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\
>  	-Wl,-R/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\
>  	-lmkl_solver_lp64_sequential\
>  	-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group\
>  	-lX11
> 
> 
> FC          = mpif90
> BIN         = ex2f
> OBJS        = ex2f.o
> 
> 
> ${BIN}:  ${OBJS}
> 	${FC} -o ex2f ${OBJS} ${LFLAGS}
> 
> ex2f.o:        ex2f.F90
> 	${FC} -c ${FFLAGS} ex2f.F90
> 
> clean:
> 	rm -f ex2f *.o
> 
> 
> Should there any more libraries be included in the makefile? 



More information about the petsc-users mailing list