I tried to compile PESTC using this configuration:
./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-f-blas-lapack=1 --download-openmpi --with-shared-libraries
make PETSC_DIR=/tmp/petsc-3.3-p7 PETSC_ARCH=arch-linux2-c-debug all
But when compiling my lib that uses petsc, even though I linked all petsc libs it's complain at runtime of: undefined symbol: _Z10VecGetSizeP6_p_VecPi
, and after some search in the interne I came across some .so that my petsc didn't build, libs like libpetscvec.so
or libpetscsnes.so
.
I also found that it will generate some .mod
with the same name of these non-generated libs (ex: /tmp/petsc-3.3-p7/arch-linux2-c-debug/include/petscsnes.mod
).
so I'm not sure if I'm missing a flag that should tell the compiler to give me libs no modules, or maybe if they are in some external packages, and that I should install with --download-SOMEPACKAGE
.
Here is the .so
libs that are generated in the $PETSC_DIR/$PETSC_ARCH/lib
:
libmca_common_sm.so
libmca_common_sm.so.1
libmca_common_sm.so.1.0.2
libmpi.so
libmpi.so.0
libmpi.so.0.0.4
libmpi_cxx.so
libmpi_cxx.so.0
libmpi_cxx.so.0.0.1
libmpi_f77.so
libmpi_f77.so.0
libmpi_f77.so.0.0.3
libmpi_f90.so
libmpi_f90.so.0
libmpi_f90.so.0.1.0
libopen-pal.so
libopen-pal.so.0
libopen-pal.so.0.0.0
libopen-rte.so
libopen-rte.so.0
libopen-rte.so.0.0.0
libopenmpi_malloc.so
libopenmpi_malloc.so.0
libopenmpi_malloc.so.0.0.0
libpetsc.so
This one was quite trick here is how I solved it:
./configure --with-pic=1 \
--with-x11=0 --download-openmpi=yes \
--doCleanup=1 --useThreads=0 \
--with-shared-libraries=1 --with-clanguage=Cxx \
--with-c++-support --with-fc=0 --ignore-cygwin-link \
--with-blas-lib="[$VENDOR_LIBS/intel/mkl/lib/intel64/libmkl_blas95_lp64.a,$VENDOR_LIBS/intel/mkl/lib/intel64/libmkl_intel_lp64.so,$VENDOR_LIBS/intel/mkl/lib/intel64/libmkl_core.so,$VENDOR_LIBS/intel/mkl/lib/intel64/libmkl_intel_thread.so,$VENDOR_LIBS/intel/lib/intel64/libiomp5.so]" \
--with-lapack-lib="[$VENDOR_LIBS/intel/mkl/lib/intel64/libmkl_lapack95_lp64.a]"
So, yes, I saw that I was missing the Intel MKL libraries (that was a big part of the error, but also was the rest of the arguments passed in the configure).
I'm not sure if this is something that will be useful for others, since this lib has tons of different configurations for many cases. But, hey, who knows...