<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Try adding -lgfortran to LFLAGS variable<br>
<br>
On 3/20/12 3:18 AM, Roc Wang wrote:
<blockquote cite="mid:BAY159-W38EDF4F8379053E536DAA2B4430@phx.gbl"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div dir="ltr">
<div>Hello,</div>
<div><br>
</div>
<div>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:</div>
<p class="MsoNormal"><span lang="EN-US"><o:p></o:p></span></p>
<div><br>
</div>
<div>ex2f.o: In function `MAIN__':</div>
<div>ex2f.F90:(.text+0x1b): undefined reference to
`_gfortran_set_std'</div>
<div>ex2f.F90:(.text+0x6f1): undefined reference to
`_gfortran_st_write'</div>
<div>ex2f.F90:(.text+0x706): undefined reference to
`_gfortran_transfer_real'</div>
<div>ex2f.F90:(.text+0x71b): undefined reference to
`_gfortran_transfer_integer'</div>
<div>ex2f.F90:(.text+0x727): undefined reference to
`_gfortran_st_write_done'</div>
<div>ex2f.F90:(.text+0x773): undefined reference to
`_gfortran_st_write'</div>
<div>ex2f.F90:(.text+0x788): undefined reference to
`_gfortran_transfer_integer'</div>
<div>ex2f.F90:(.text+0x794): undefined reference to
`_gfortran_st_write_done'</div>
<div>ex2f.o: In function `mykspmonitor_':</div>
<div>ex2f.F90:(.text+0x896): undefined reference to
`_gfortran_st_write'</div>
<div>ex2f.F90:(.text+0x8ae): undefined reference to
`_gfortran_transfer_integer'</div>
<div>ex2f.F90:(.text+0x8ba): undefined reference to
`_gfortran_st_write_done'</div>
<div>ex2f.F90:(.text+0x924): undefined reference to
`_gfortran_st_write'</div>
<div>ex2f.F90:(.text+0x93c): undefined reference to
`_gfortran_transfer_integer'</div>
<div>ex2f.F90:(.text+0x954): undefined reference to
`_gfortran_transfer_real'</div>
<div>ex2f.F90:(.text+0x960): undefined reference to
`_gfortran_st_write_done'</div>
<div>make: *** [ex2f] Error 1</div>
<div> </div>
<div><br>
</div>
<div>My makefile is like this:</div>
<div><br>
</div>
<div>
<div>########################################################################</div>
<div>PETSC_DIR =/usr/global/petsc/3.1-p8</div>
<div>PETSC_ARCH <span class="Apple-tab-span"
style="white-space:pre"> </span>=linux-intel11-debug</div>
<div>FFLAGS = -I${PETSC_DIR}/include
-I${PETSC_DIR}/${PETSC_ARCH}/include</div>
<div>LFLAGS = -L${PETSC_DIR}/${PETSC_ARCH}/lib -lpetsc\</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>-L/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>-Wl,-R/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>-lmkl_solver_lp64_sequential\</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>-Wl,--start-group
-lmkl_intel_lp64 -lmkl_sequential -lmkl_core
-Wl,--end-group\</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>-lX11</div>
<div><br>
</div>
<div><br>
</div>
<div>FC = mpif90</div>
<div>BIN = ex2f</div>
<div>OBJS = ex2f.o</div>
<div><br>
</div>
<div><br>
</div>
<div>${BIN}: ${OBJS}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>${FC}
-o ex2f ${OBJS} ${LFLAGS}</div>
<div><br>
</div>
<div>ex2f.o: ex2f.F90</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>${FC}
-c ${FFLAGS} ex2f.F90</div>
<div><br>
</div>
<div>clean:</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>rm
-f ex2f *.o</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Should there any more libraries be included in the
makefile? </div>
</div>
</blockquote>
<br>
</body>
</html>