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

Anton Popov popov at uni-mainz.de
Tue Mar 20 07:23:10 CDT 2012


Try adding -lgfortran to LFLAGS variable

On 3/20/12 3:18 AM, 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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120320/766d03e4/attachment-0001.htm>


More information about the petsc-users mailing list