<div>Hi,</div>
<div> </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 "undefined reference to ...." error.</div>
<div> </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> </div>
<div>My code is</div>
<div> </div>
<div>global.F</div>
<div> </div>
<div> module global_data</div>
<div>
<p> implicit none</p>
<p> save</p>
<p>#include "include/finclude/petsc.h"<br>#include "include/finclude/petscvec.h"<br>#include "include/finclude/petscmat.h"<br>#include "include/finclude/petscksp.h"<br>#include "include/finclude/petscpc.h"
<br>#include "include/finclude/petscmat.h90"</p>
<p> integer :: i,j,k</p>
<p> Vec xx,b_rhs,xx_uv,b_rhs_uv ! /* solution vector, right hand side vector and work vector */</p>
<p> Mat A_mat,A_mat_uv ! /* sparse matrix */</p>
<p> 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':<br>/nfs/home/enduser/g0306332/test/main.F:11: undefined reference to `petscinitialize_'<br>/tmp/ifort0JBYUf.o(.text+0xaf):/nfs/home/enduser/g0306332/test/main.F:13: undefined reference to `matcreateseqaij_'
<br></p>
<p>The compiling commands, which I rephrase from the "make ex1f" 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 -fPIC -g -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 -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,"/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" -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 -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 -o
a.out global.o main.f90 <br></p>
<p>I have used shared,static library. I wonder if it is a problem with mkl em64t or there's something wrong with my code/compilation.</p>
<p> </p>
<p>Thank you.</p></div>