<div>Hi,</div>
<div>&nbsp;</div>
<div>regarding &quot;<font color="#550055">&gt; &gt; &gt; -lirc -lgcc_s -lirc_s -ldl &nbsp;-o a.out global.o &nbsp;main.f90&quot;</font></div>
<div>&nbsp;</div>
<div>is it the correct order? my make file is in that order.</div>
<div>&nbsp;</div>
<div>anyway, compiling 1st then linking solve the problem. Strange that it didn&#39;t work compiling/linking at the same step. it worked for other configuration.</div>
<div>&nbsp;</div>
<div>thanks anyway.</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 1/11/07, <b class="gmail_sendername">Satish Balay</b> &lt;<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Ah - I wasn&#39;t checking your make output closly..<br><br>Looks like you are listing your libs after petsclibs. You&#39;ll have to
<br>list the object files - in the correct order of dependencies..<br><br>&gt; &gt; &gt; -lirc -lgcc_s -lirc_s -ldl&nbsp;&nbsp;-o a.out global.o&nbsp;&nbsp;main.f90<br><br>Also - looks like you are compiling &amp; linking at the same step.. [
i.e<br>using .o and .f90 in the same command]. Sugest crearing .o files before<br>linking..<br><br>i.e<br><br>${FLINKER} -o a.out global.o&nbsp;&nbsp;main.o ${PETSC_LIB}<br><br>Satish<br><br><br>On Thu, 11 Jan 2007, Ben Tay wrote:<br>
<br>&gt; Yes it ran successfully. I&#39;ve attached the output.<br>&gt;<br>&gt; thank you very much.<br>&gt;<br>&gt;<br>&gt; On 1/11/07, Satish Balay &lt;<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>&gt; wrote:
<br>&gt; &gt;<br>&gt; &gt; Do PETSc examples work?<br>&gt; &gt;<br>&gt; &gt; Send us the output from<br>&gt; &gt;<br>&gt; &gt; make test<br>&gt; &gt;<br>&gt; &gt; Staish<br>&gt; &gt;<br>&gt; &gt; On Wed, 10 Jan 2007, Ben Tay wrote:
<br>&gt; &gt;<br>&gt; &gt; &gt; Hi,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I have a very simple fortran code. It compiles on a 32bit system with<br>&gt; &gt; mkl<br>&gt; &gt; &gt; with no errors but on em64t, it gives &quot;undefined reference to ....&quot;
<br>&gt; &gt; error.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; It works when I compiled with the supplied blas/lapack. However if I use<br>&gt; &gt; &gt; Intel mkl, it gives the error as stated above.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; My code is
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; global.F<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; module global_data<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;implicit none<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;save<br>&gt; &gt; &gt;
<br>&gt; &gt; &gt; #include &quot;include/finclude/petsc.h&quot;<br>&gt; &gt; &gt; #include &quot;include/finclude/petscvec.h&quot;<br>&gt; &gt; &gt; #include &quot;include/finclude/petscmat.h&quot;<br>&gt; &gt; &gt; #include &quot;include/finclude/petscksp.h&quot;
<br>&gt; &gt; &gt; #include &quot;include/finclude/petscpc.h&quot;<br>&gt; &gt; &gt; #include &quot;include/finclude/petscmat.h90&quot;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;integer :: i,j,k<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vec&nbsp;&nbsp;&nbsp;&nbsp;xx,b_rhs,xx_uv,b_rhs_uv&nbsp;&nbsp; !&nbsp;&nbsp; /* solution vector, right
<br>&gt; &gt; hand<br>&gt; &gt; &gt; side vector and work vector */<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mat&nbsp;&nbsp;&nbsp;&nbsp;A_mat,A_mat_uv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!&nbsp;&nbsp;/* sparse matrix */<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end module global_data
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; main.f90<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; program ns2d_c<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; use global_data<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; implicit none<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; integer :: ierr
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; i=1<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; call PetscInitialize(PETSC_NULL_CHARACTER,ierr)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; call<br>&gt; &gt; MatCreateSeqAIJ(PETSC_COMM_SELF,9,9,9,PETSC_NULL_INTEGER,A_mat,ierr)
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; end program ns2d_c<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; The error msg is<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; /tmp/ifort0JBYUf.o(.text+0x46): In function `ns2d_c&#39;:<br>
&gt; &gt; &gt; /nfs/home/enduser/g0306332/test/main.F:11: undefined reference to<br>&gt; &gt; &gt; `petscinitialize_&#39;<br>&gt; &gt; &gt;<br>&gt; &gt; /tmp/ifort0JBYUf.o(.text+0xaf):/nfs/home/enduser/g0306332/test/main.F:13:
<br>&gt; &gt; &gt; undefined reference to `matcreateseqaij_&#39;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; The compiling commands, which I rephrase from the &quot;make ex1f&quot; are<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; ifort -132 -fPIC -g -c
<br>&gt; &gt; &gt; -I/nfs/lsftmp/g0306332/petsc-2.3.2-p8-I/nfs/lsftmp/g0306332/petsc-<br>&gt; &gt; &gt; 2.3.2-p8/bmake/l64-nompi-noshared<br>&gt; &gt; &gt; -I/nfs/lsftmp/g0306332/petsc-2.3.2-p8/include<br>&gt; &gt; &gt; -I/nfs/lsftmp/g0306332/petsc-
2.3.2-p8/include/mpiuni global.F<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; ifort&nbsp;&nbsp;-fPIC -g<br>&gt; &gt; &gt; -Wl,-rpath,/nfs/lsftmp/g0306332/petsc-2.3.2-p8/lib/l64-nompi-noshared<br>&gt; &gt; &gt; -L/nfs/lsftmp/g0306332/petsc-2.3.2-p8
/lib/l64-nompi-noshared -lpetscksp<br>&gt; &gt; &gt; -lpetscdm -lpetscmat -lpetscvec -lpetsc<br>&gt; &gt; &gt; -Wl,-rpath,/nfs/lsftmp/g0306332/petsc-2.3.2-p8/lib/l64-nompi-noshared<br>&gt; &gt; &gt; -L/nfs/lsftmp/g0306332/petsc-
2.3.2-p8/lib/l64-nompi-noshared -lmpiuni<br>&gt; &gt; &gt; -Wl,-rpath,/lsftmp/g0306332/inter/mkl/lib/em64t<br>&gt; &gt; &gt; -L/lsftmp/g0306332/inter/mkl/lib/em64t -lmkl_lapack -lmkl_em64t -lguide<br>&gt; &gt; &gt; -lpthread -ldl -Wl,-rpath,/usr/local/intel/cce9.0/lib
<br>&gt; &gt; &gt; -L/usr/local/intel/cce9.0/lib<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64
<br>&gt; &gt; &gt; -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -lsvml -limf<br>&gt; &gt; &gt; -lirc -lgcc_s -lirc_s -Wl,-rpath,&quot;/usr/local/intel/cce9.0/lib&quot;<br>&gt; &gt; &gt; -Wl,-rpath,&quot;/usr/local/intel/cce9.0/lib&quot; -L&quot;/usr/local/intel/cce9.0/lib&quot;
<br>&gt; &gt; &gt; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/&quot;<br>&gt; &gt; &gt; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/&quot;<br>&gt; &gt; &gt; -L&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/&quot;
<br>&gt; &gt; &gt; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64&quot;<br>&gt; &gt; &gt; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64&quot;<br>&gt; &gt; &gt; -L&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64&quot;
<br>&gt; &gt; &gt; -Wl,-rpath,/usr/local/intel/fc9.0/lib -L/usr/local/intel/fc9.0/lib<br>&gt; &gt; -lifport<br>&gt; &gt; &gt; -lifcore -lm -Wl,-rpath,/usr/local/intel/cce9.0/lib<br>&gt; &gt; &gt; -Wl,-rpath,/usr/local/intel/cce9.0/lib -L/usr/local/intel/cce9.0/lib
<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64
<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64<br>&gt; &gt; &gt; -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -lm&nbsp;&nbsp;-ldl<br>&gt; &gt; &gt; -Wl,-rpath,/usr/local/intel/cce9.0/lib -L/usr/local/intel/cce9.0/lib
<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/<br>&gt; &gt; &gt; -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64<br>&gt; &gt; &gt; -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -lsvml -limf
<br>&gt; &gt; &gt; -lirc -lgcc_s -lirc_s -ldl&nbsp;&nbsp;-o a.out global.o&nbsp;&nbsp;main.f90<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I have used shared,static library. I wonder if it is a problem with mkl<br>&gt; &gt; &gt; em64t or there&#39;s something wrong with my code/compilation.
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Thank you.<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br><br></blockquote></div><br>