<div>Hi,</div>
<div> </div>
<div>I tried to build the libraries on my school's em64t machines which is supposed to be faster. The compilers are intel cc,fc ver 9. mkl is 7.21.I'm trying to build a shared library. My command is </div>
<div> </div>
<div>./config/configure.py --with-vendor-compilers=intel --with-blas-lapack-dir=/opt/intel/mkl721/ --with-mpi=0 --with-x=0 --with-shared</div>
<div> </div>
<div>during compilation, I can get the following error msg:</div>
<div> </div>
<div>making shared libraries in /lsftmp/g0306332/petsc-2.3.2-p7//lib/linux64-nompi-shared<br>building libpetsc.so<br>building libpetscvec.so<br>building libpetscmat.so<br>ld: /usr/local/intel/mkl721cluster/lib/32/libmkl_lapack.a(dgetrf_omp.o): relocation R_X86_64_PC32 against `_mkl_lapack_dgetrf_omp_271__par_loop0' can not be used when making a shared object; recompile with -fPIC
<br>ld: final link failed: Bad value<br>make[2]: [shared_linux] Error 1 (ignored)<br>building libpetscdm.so<br>building libpetscksp.so<br>ld: /usr/local/intel/mkl721cluster/lib/32/libmkl_lapack.a(dgeqrf_omp.o): relocation R_X86_64_PC32 against `_mkl_lapack_dgeqrf_301__par_loop0' can not be used when making a shared object; recompile with -fPIC
<br>ld: final link failed: Bad value<br>make[2]: [shared_linux] Error 1 (ignored)<br>building libpetscsnes.so<br>building libpetscts.so<br>building libpetsccontrib.so</div>
<div> </div>
<div>The examples ran ok though. However, when I try to run my own code (which worked on another server), I get the following error msg:</div>
<div> </div>
<div>petsc_sub.o(.text+0xcb): In function `petsc_solver':<br>/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:46: undefined reference to `matcreateseqaij_'<br>petsc_sub.o(.text+0x150):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:52: undefined reference to `kspcreate_'
<br>petsc_sub.o(.text+0x657):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:105: undefined reference to `matsetvalues_'<br>petsc_sub.o(.text+0x73e):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:110: undefined reference to `matsetvalues_'
<br>petsc_sub.o(.text+0x823):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:115: undefined reference to `matsetvalues_'<br>petsc_sub.o(.text+0x90a):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:120: undefined reference to `matsetvalues_'
<br>petsc_sub.o(.text+0xa01):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:125: undefined reference to `matsetvalues_'<br>petsc_sub.o(.text+0xafa):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:130: more undefined references to `matsetvalues_' follow
<br>petsc_sub.o(.text+0x3501): In function `petsc_solver':<br>/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:402: undefined reference to `matassemblybegin_'<br>petsc_sub.o(.text+0x3526):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:403: undefined reference to `matassemblyend_'
<br>petsc_sub.o(.text+0x356d):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:405: undefined reference to `kspsetoperators_'<br>petsc_sub.o(.text+0x3595):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:407: undefined reference to `kspgetpc_'
<br>petsc_sub.o(.text+0x35e4):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:411: undefined reference to `kspsettype_'<br>petsc_sub.o(.text+0x3633):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:416: undefined reference to `pcsettype_'
<br>petsc_sub.o(.text+0x364e):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:419: undefined reference to `kspsetfromoptions_'<br>petsc_sub.o(.text+0x36ad):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:425: undefined reference to `kspsettolerances_'
<br>petsc_sub.o(.text+0x36e2):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:427: undefined reference to `kspsolve_'<br>petsc_sub.o(.text+0x3704):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:429: undefined reference to `kspgetconvergedreason_'
<br>/tmp/ifortuYcl1b.o(.text+0x8f2e): In function `ns2d_c':<br>/nfs/home/enduser/g0306332/ns2d_c/ns2d_c.f90:825: undefined reference to `matdestroy_'<br>/tmp/ifortuYcl1b.o(.text+0x8f4c):/nfs/home/enduser/g0306332/ns2d_c/ns2d_c.f90:827: undefined reference to `kspdestroy_'
<br>make: *** [a.out] Error 1<br> </div>
<div>It happens when I'm trying to link all the files together. compiling petsc_sub.F has no problem and I am using the same option as for the examples. Also if I use the downloaded blas/lapack instead of mkl, there is also no problem so I guess the problem is from mkl...
</div>
<div> </div>
<div>Hope someone can help. Thank you.</div>