<div>Hi,</div>
<div>&nbsp;</div>
<div>I have a very simple fortran code. It compiles on a 32bit system with mkl with no errors but on em64t, it gives &quot;undefined reference to ....&quot; error.</div>
<div>&nbsp;</div>
<div>It works when I compiled with the supplied blas/lapack. However if I use Intel mkl, it gives the error as stated above.</div>
<div>&nbsp;</div>
<div>My code is</div>
<div>&nbsp;</div>
<div>global.F</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; module global_data</div>
<div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; implicit none</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save</p>
<p>#include &quot;include/finclude/petsc.h&quot;<br>#include &quot;include/finclude/petscvec.h&quot;<br>#include &quot;include/finclude/petscmat.h&quot;<br>#include &quot;include/finclude/petscksp.h&quot;<br>#include &quot;include/finclude/petscpc.h&quot;
<br>#include &quot;include/finclude/petscmat.h90&quot;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; integer :: i,j,k</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Vec&nbsp;&nbsp;&nbsp; xx,b_rhs,xx_uv,b_rhs_uv&nbsp;&nbsp; !&nbsp;&nbsp; /* solution vector, right hand side vector and work vector */</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mat&nbsp;&nbsp;&nbsp; A_mat,A_mat_uv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !&nbsp; /* sparse matrix */</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end module global_data</p>
<p>main.f90</p>
<p>program ns2d_c</p>
<p>use global_data</p>
<p>implicit none</p>
<p>integer :: ierr</p>
<p>i=1</p>
<p>call PetscInitialize(PETSC_NULL_CHARACTER,ierr)</p>
<p>call MatCreateSeqAIJ(PETSC_COMM_SELF,9,9,9,PETSC_NULL_INTEGER,A_mat,ierr)</p>
<p>end program ns2d_c<br></p>
<p><br>The error msg is </p>
<p>/tmp/ifort0JBYUf.o(.text+0x46): In function `ns2d_c&#39;:<br>/nfs/home/enduser/g0306332/test/main.F:11: undefined reference to `petscinitialize_&#39;<br>/tmp/ifort0JBYUf.o(.text+0xaf):/nfs/home/enduser/g0306332/test/main.F:13: undefined reference to `matcreateseqaij_&#39;
<br></p>
<p>The compiling commands, which I rephrase from the &quot;make ex1f&quot; are</p>
<p>ifort -132 -fPIC -g -c -I/nfs/lsftmp/g0306332/petsc-2.3.2-p8 -I/nfs/lsftmp/g0306332/petsc-2.3.2-p8/bmake/l64-nompi-noshared -I/nfs/lsftmp/g0306332/petsc-2.3.2-p8/include -I/nfs/lsftmp/g0306332/petsc-2.3.2-p8/include/mpiuni 
global.F</p>
<p>ifort&nbsp; -fPIC -g&nbsp; -Wl,-rpath,/nfs/lsftmp/g0306332/petsc-2.3.2-p8/lib/l64-nompi-noshared -L/nfs/lsftmp/g0306332/petsc-2.3.2-p8/lib/l64-nompi-noshared -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc&nbsp;&nbsp;&nbsp; -Wl,-rpath,/nfs/lsftmp/g0306332/petsc-
2.3.2-p8/lib/l64-nompi-noshared -L/nfs/lsftmp/g0306332/petsc-2.3.2-p8/lib/l64-nompi-noshared -lmpiuni -Wl,-rpath,/lsftmp/g0306332/inter/mkl/lib/em64t -L/lsftmp/g0306332/inter/mkl/lib/em64t -lmkl_lapack -lmkl_em64t -lguide -lpthread -ldl -Wl,-rpath,/usr/local/intel/cce9.0/lib -L/usr/local/intel/cce9.0/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -lsvml -limf -lirc -lgcc_s -lirc_s -Wl,-rpath,&quot;/usr/local/intel/cce9.0/lib&quot; -Wl,-rpath,&quot;/usr/local/intel/cce9.0/lib&quot; -L&quot;/usr/local/intel/cce9.0/lib&quot; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/&quot; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/&quot; -L&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/&quot; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64&quot; -Wl,-rpath,&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64&quot; -L&quot;/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64&quot; -Wl,-rpath,/usr/local/intel/fc9.0/lib -L/usr/local/intel/fc9.0/lib -lifport -lifcore -lm -Wl,-rpath,/usr/local/intel/cce9.0/lib -Wl,-rpath,/usr/local/intel/cce9.0/lib -L/usr/local/intel/cce9.0/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -lm&nbsp; -ldl -Wl,-rpath,/usr/local/intel/cce9.0/lib -L/usr/local/intel/cce9.0/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -lsvml -limf -lirc -lgcc_s -lirc_s -ldl&nbsp; -o 
a.out global.o&nbsp; main.f90&nbsp; <br></p>
<p>I have used shared,static library. I wonder if it is a problem with mkl em64t or there&#39;s something wrong with my code/compilation.</p>
<p>&nbsp;</p>
<p>Thank you.</p></div>