Error when building with intel mkl 7.21

Matthew Knepley knepley at gmail.com
Fri Dec 8 11:19:25 CST 2006


Your MKL is incompatible with shared libraries on 64-bit machines because it was
compiled without -fPIC. You need to configure with --with-shared=0.

   Matt

On 12/8/06, Ben Tay <zonexo at gmail.com> wrote:
> Hi,
>
> 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
>
> ./config/configure.py --with-vendor-compilers=intel
> --with-blas-lapack-dir=/opt/intel/mkl721/ --with-mpi=0
> --with-x=0 --with-shared
>
> during compilation, I can get the following error msg:
>
> making shared libraries in
> /lsftmp/g0306332/petsc-2.3.2-p7//lib/linux64-nompi-shared
> building libpetsc.so
> building libpetscvec.so
> building libpetscmat.so
> 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
> ld: final link failed: Bad value
> make[2]: [shared_linux] Error 1 (ignored)
> building libpetscdm.so
> building libpetscksp.so
> 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
> ld: final link failed: Bad value
> make[2]: [shared_linux] Error 1 (ignored)
> building libpetscsnes.so
> building libpetscts.so
> building libpetsccontrib.so
>
> 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:
>
> petsc_sub.o(.text+0xcb): In function `petsc_solver':
> /nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:46: undefined
> reference to `matcreateseqaij_'
> petsc_sub.o(.text+0x150):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:52:
> undefined reference to `kspcreate_'
> petsc_sub.o(.text+0x657):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:105:
> undefined reference to `matsetvalues_'
> petsc_sub.o(.text+0x73e):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:110:
> undefined reference to `matsetvalues_'
> petsc_sub.o(.text+0x823):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:115:
> undefined reference to `matsetvalues_'
> petsc_sub.o(.text+0x90a):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:120:
> undefined reference to `matsetvalues_'
> petsc_sub.o(.text+0xa01):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:125:
> undefined reference to `matsetvalues_'
> petsc_sub.o(.text+0xafa):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:130:
> more undefined references to `matsetvalues_' follow
> petsc_sub.o(.text+0x3501): In function `petsc_solver':
> /nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:402:
> undefined reference to `matassemblybegin_'
> petsc_sub.o(.text+0x3526):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:403:
> undefined reference to `matassemblyend_'
> petsc_sub.o(.text+0x356d):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:405:
> undefined reference to `kspsetoperators_'
> petsc_sub.o(.text+0x3595):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:407:
> undefined reference to `kspgetpc_'
> petsc_sub.o(.text+0x35e4):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:411:
> undefined reference to `kspsettype_'
> petsc_sub.o(.text+0x3633):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:416:
> undefined reference to `pcsettype_'
> petsc_sub.o(.text+0x364e):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:419:
> undefined reference to `kspsetfromoptions_'
> petsc_sub.o(.text+0x36ad):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:425:
> undefined reference to `kspsettolerances_'
> petsc_sub.o(.text+0x36e2):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:427:
> undefined reference to `kspsolve_'
> petsc_sub.o(.text+0x3704):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:429:
> undefined reference to `kspgetconvergedreason_'
> /tmp/ifortuYcl1b.o(.text+0x8f2e): In function `ns2d_c':
> /nfs/home/enduser/g0306332/ns2d_c/ns2d_c.f90:825: undefined
> reference to `matdestroy_'
> /tmp/ifortuYcl1b.o(.text+0x8f4c):/nfs/home/enduser/g0306332/ns2d_c/ns2d_c.f90:827:
> undefined reference to `kspdestroy_'
> make: *** [a.out] Error 1
>
> 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...
>
> Hope someone can help. Thank you.


-- 
"Failure has a thousand explanations. Success doesn't need one" -- Sir
Alec Guiness




More information about the petsc-users mailing list