Ben- Matt's suggestion of not using shared libraries may work, but it looks to me like PETSc is trying to link 64-bit PETSc libraries against 32-bit MKL libraries (note the directory 32 in the MKL path). I don't know the layout of the MKL tree but you probably need to adjust your configuration line to make sure PETSc finds the 64-bit MKL libraries (assuming you have them).
Brad On Friday 08 December 2006 9:19 am, Matthew Knepley wrote: > 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:10 > >5: undefined reference to `matsetvalues_' > > petsc_sub.o(.text+0x73e):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:11 > >0: undefined reference to `matsetvalues_' > > petsc_sub.o(.text+0x823):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:11 > >5: undefined reference to `matsetvalues_' > > petsc_sub.o(.text+0x90a):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:12 > >0: undefined reference to `matsetvalues_' > > petsc_sub.o(.text+0xa01):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:12 > >5: undefined reference to `matsetvalues_' > > petsc_sub.o(.text+0xafa):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:13 > >0: 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:4 > >03: undefined reference to `matassemblyend_' > > petsc_sub.o(.text+0x356d):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >05: undefined reference to `kspsetoperators_' > > petsc_sub.o(.text+0x3595):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >07: undefined reference to `kspgetpc_' > > petsc_sub.o(.text+0x35e4):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >11: undefined reference to `kspsettype_' > > petsc_sub.o(.text+0x3633):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >16: undefined reference to `pcsettype_' > > petsc_sub.o(.text+0x364e):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >19: undefined reference to `kspsetfromoptions_' > > petsc_sub.o(.text+0x36ad):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >25: undefined reference to `kspsettolerances_' > > petsc_sub.o(.text+0x36e2):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >27: undefined reference to `kspsolve_' > > petsc_sub.o(.text+0x3704):/nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:4 > >29: 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.
