Hello for compiled problem
Wei-Dong Lian
weidong.lian at gmail.com
Tue Mar 10 16:35:20 CDT 2009
Satish,
I am very grateful that you are so kind for my problem. Thanks for all of
your team workers. Petsc is great.
Now I am in France, so it is 22:10 and I am at home, my computer is Ubuntu
64 English, so it works very well in my computer. Tomorrow morning I will
try that.
First I am so sorry for my poor programming level giving you so much
trouble, I am a new user under linux. My major is Mechanics, so my makefile
seems unprofessional. But I am interested in programming. I will take more
time for that later.
Now I also found a problem for my computer about using petsc.
In my computer, petsc can be compiled successfully without any problem. So I
use the *.so library to link into my programme, it worked very well. But
today I just have a try to link *.a library into my programme and it can not
be compiled successfully. The problem is the same as in my office's
computer. Now I am sure it is my problem linking the static lib *.a, can you
tell me how to use your petsc with linking the *.a, I have read your
makefile in the examples as you told me, but it is a little complicated. And
you also told me that the order of the static lib is very important. What
should I do for changing my makefile? I really want to use your makefile to
link my programme, but I word in many computer in the network under Linux,
So different computer have differect petsc, that's why I want to use my
makefile to link petsc.
Thanks very much. It is really very kind of you.
Yours truly,
Weidong
***********************My makefile to linking the petsc into my
programme***********************************************
#FOR PETSC
ifdef HAVE_PETSC
DEFS := $(DEFS) -DHAVE_PETSC
DEPS := $(DEPS) SolverInterfaces/PetscSeq
#PETSC_DIR=$(DEVROOT)/Solver/petscSeq
PETSC_ARCH=$(ARCHOS)
PETSC_LIBDIR := $(PETSC_DIR)/$(PETSC_ARCH)/lib
INCLUDES := $(INCLUDES) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/include/mpiuni
-I$(PETSC_DIR)/include/adic -I$(PETSC_DIR)/$(PETSC_ARCH)/include
ADDLIB := $(ADDLIB) -llapack
ADDLIBSTATIC := $(ADDLIBSTATIC) $(PETSC_LIBDIR)/libmpiuni.a
# ######for shared library it worked well
#ADDLIB := $(ADDLIB) -L$(PETSC_LIBDIR) -Wl,-rpath,$(PETSC_LIBDIR)
-lpetsccontrib -lpetscksp -lpetscsnes -lpetscvec -lpetsc -lpetscdm
-lpetscmat -lpetscts
#####for static library it told me that many unreferenced sysbol as blow
ADDLIBSTATIC := $(ADDLIBSTATIC) $(PETSC_LIBDIR)/libpetsccontrib.a
$(PETSC_LIBDIR)/libpetscksp.a $(PETSC_LIBDIR)/libpetscsnes.a
$(PETSC_LIBDIR)/libpetscvec.a $(PETSC_LIBDIR)/libpetsc.a
$(PETSC_LIBDIR)/libpetscdm.a $(PETSC_LIBDIR)/libpetscmat.a
$(PETSC_LIBDIR)/libpetscts.a
ifndef PARALLEL
LIBS:= $(LIBS) PetscSeq
endif
endif
#End For PETSC
*************************************************************************************************
##################error information###############################
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:797:
undefined reference to `MPIUNI_TMP'
/home/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscmat.a(mpiaij.o):
In function `MatZeroRows_MPIAIJ(_p_Mat*, int, int const*, double)':
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612:
undefined reference to `MPIUNI_TMP'
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612:
undefined reference to `MPIUNI_TMP'
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612:
undefined reference to `MPIUNI_TMP'
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612:
undefined reference to `MPIUNI_TMP'
##################################################
On Tue, Mar 10, 2009 at 9:37 PM, Satish Balay <balay at mcs.anl.gov> wrote:
> Weidong,
>
> What do you have for the following?
>
> env |grep LANG
> cd src/benchmarks
> gcc sizeof.c
> gcc -PIC sizeof.c
> export LANG=en_US.UTF-8
> gcc -PIC sizeof.c
>
>
> thanks,
> Satish
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090310/bb31322a/attachment.htm>
More information about the petsc-users
mailing list