[Pkg-scicomp-devel] Bug#522287: Bug#522287: Bug#522287: [petsc] fail to execute code linked with petsc

Johannes Ring johannr at simula.no
Wed May 13 08:32:18 UTC 2009


I have the same problem as Christophe. I created a makefile for
Christophe's simple code (t.cpp) by adapting one of the makefiles from the
PETSc examples. My makefile looks like this:

include ${PETSC_DIR}/conf/base
t: t.o  chkopts
        -${CLINKER} -o t t.o ${PETSC_LIB}
        ${RM} -f t.o

Compiling works fine:

$ PETSC_DIR=/usr/lib/petsc PETSC_ARCH=linux-gnu-c-opt make t
mpicc -o t.o -c -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -O
-I/usr/lib/petsc/linux-gnu-c-opt/include -I/usr/lib/petsc/include
-I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -I/usr/include
-I/usr/include/spooles -I/usr/include/superlu -I/usr/include/suitesparse
-D__SDIR__="" t.cpp
mpicc -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -O  -o t t.o
-L/usr/lib/petsc/linux-gnu-c-opt/lib -L/usr/lib/petsc/linux-gnu-c-opt/lib
-lpetscts -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc
     -lX11 -L/usr/lib -lHYPRE -lmpi_cxx -lstdc++ -lspooles -lsuperlu
-lumfpack -lamd -llapack -lblas -L/usr/lib/openmpi/lib
-L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/lib -ldl -lmpi -lopen-rte
-lopen-pal -lnsl -lutil -lgcc_s -lpthread -lmpi_f90 -lmpi_f77
-lgfortranbegin -lgfortran -lm -lm -L/usr/lib/gcc/i486-linux-gnu -lm -lm
-ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil -lgcc_s -lpthread -lmpi_f90
-lmpi_f77 -lgfortranbegin -lgfortran -lm -lm -lm -lm
-L/usr/lib/openmpi/lib -L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/lib -ldl
-lmpi -lopen-rte -lopen-pal -lnsl -lutil -lgcc_s -lpthread -lmpi_f90
-lmpi_f77 -lgfortranbegin -lgfortran -lm -lm -L/usr/lib/gcc/i486-linux-gnu
-lm -lm -lmpi_cxx -lstdc++ -lmpi_cxx -lstdc++ -ldl -lmpi -lopen-rte
-lopen-pal -lnsl -lutil -lgcc_s -lpthread -ldl
/bin/rm -f -f t.o

Running the program produces this output:

$ ./t
[0]PETSC ERROR: --------------------- Error Message
[0]PETSC ERROR: Unable to open file!
[0]PETSC ERROR: Unable to locate PETSc dynamic library
 You cannot move the dynamic libraries!!
[0]PETSC ERROR: Petsc Release Version 3.0.0, Patch 0, Fri Dec 19 22:02:38
CST 2008
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ./t on a linux-gnu named debian-vmware by johannr Wed May
13 11:15:48 2009
[0]PETSC ERROR: Libraries linked from
[0]PETSC ERROR: Configure run at Mon Mar 30 23:54:34 2009
[0]PETSC ERROR: Configure options --with-shared --with-dynamic
--with-debugging=0 --useThreads 0 --with-mpi-dir=/usr/lib/openmpi
--with-mpi-shared=1 --with-blas-lib=-lblas --with-lapack-lib=-llapack
--with-umfpack=1 --with-umfpack-include=/usr/include/suitesparse
--with-superlu=1 --with-superlu-include=/usr/include/superlu
--with-superlu-lib=/usr/lib/libsuperlu.so --with-spooles=1
--with-spooles-lib=/usr/lib/libspooles.so --with-hypre=1
[0]PETSC ERROR: PetscInitialize_DynamicLibraries() line 97 in
[0]PETSC ERROR: PetscInitialize() line 581 in src/sys/objects/pinit.c

Best regards,


On Tue, May 12, 2009 21:02, Christophe Prud'homme wrote:
> Hi Adam
> thanks for the heads up :)
> until 3.0 I never had to set PETSC_DIR  and PETSC_ARCH, it was working
> out of the box.
> The other problem is that it affects slepc too.
> What I do at the moment is use 2.3.3 which works without problems, I
> just had to recompile with the newest openmpi
> I will look again into this, I am pretty sure I went down the road of
> setting these PETSC variables, I will do that again.
> Best regards
> C.
> On Tue, May 12, 2009 at 2:27 PM, Adam C Powell IV <hazelsct at debian.org>
> wrote:
>> severity 522287 important
>> tags 522287 unreproducible
>> thanks
>> Hi Christophe,
>> Sorry about the delay, I'm accustomed to getting bugs via email, and
>> only just subscribed to the PTS.
>> I'm afraid I can't reproduce this.  Did you set PETSC_DIR and PETSC_ARCH
>> as described in README.Debian?  I'm afraid PETSc is picky about this.
>> Can you test it as described in README.Debian, by unpacking src.tar.gz
>> test files in the -doc package?
>> Thanks,
>> -Adam
>> --
>> GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6
>> Engineering consulting with open source tools
>> http://www.opennovation.com/
>> _______________________________________________
>> Pkg-scicomp-devel mailing list
>> Pkg-scicomp-devel at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/pkg-scicomp-devel
> _______________________________________________
> Pkg-scicomp-devel mailing list
> Pkg-scicomp-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-scicomp-devel

More information about the Pkg-scicomp-devel mailing list