Satish,<br>I am very grateful that you are so kind for my problem. Thanks for all of your team workers.  Petsc is great.<br>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. <br>
<br>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. <br>
<br>Now I also found a problem for my computer about using petsc. <br>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&#39;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&#39;s why I want to use my makefile to link petsc. <br>
<br>Thanks very much. It is really very kind of you.<br>Yours truly,<br>Weidong<br><br>***********************My makefile to linking the petsc into my programme***********************************************<br>#FOR PETSC<br>
ifdef HAVE_PETSC<br>DEFS := $(DEFS) -DHAVE_PETSC<br>DEPS := $(DEPS) SolverInterfaces/PetscSeq<br>#PETSC_DIR=$(DEVROOT)/Solver/petscSeq<br>PETSC_ARCH=$(ARCHOS)<br>PETSC_LIBDIR := $(PETSC_DIR)/$(PETSC_ARCH)/lib<br>INCLUDES := $(INCLUDES) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/include/mpiuni -I$(PETSC_DIR)/include/adic -I$(PETSC_DIR)/$(PETSC_ARCH)/include  <br>
<br>ADDLIB := $(ADDLIB) -llapack<br>ADDLIBSTATIC := $(ADDLIBSTATIC) $(PETSC_LIBDIR)/libmpiuni.a<br><br><span style="color: rgb(255, 0, 0);"># ######for shared library it worked well</span><br>#ADDLIB := $(ADDLIB) -L$(PETSC_LIBDIR) -Wl,-rpath,$(PETSC_LIBDIR) -lpetsccontrib -lpetscksp -lpetscsnes -lpetscvec -lpetsc -lpetscdm -lpetscmat -lpetscts<br>
<br><span style="color: rgb(255, 0, 0);">#####for static library it told me that many unreferenced sysbol as blow</span><br>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<br>
<br>ifndef PARALLEL<br>LIBS:= $(LIBS) PetscSeq<br>endif<br><br>endif<br>#End For PETSC<br><br>*************************************************************************************************<br><br><br>##################error information###############################<br>
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:797: undefined reference to `MPIUNI_TMP&#39;<br>/home/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscmat.a(mpiaij.o): In function `MatZeroRows_MPIAIJ(_p_Mat*, int, int const*, double)&#39;:<br>
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612: undefined reference to `MPIUNI_TMP&#39;<br>/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612: undefined reference to `MPIUNI_TMP&#39;<br>
/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612: undefined reference to `MPIUNI_TMP&#39;<br>/home/lian/Develop/Solver/petscSeq/src/mat/impls/aij/mpi/mpiaij.c:612: undefined reference to `MPIUNI_TMP&#39;<br>
##################################################<br><div class="gmail_quote">On Tue, Mar 10, 2009 at 9:37 PM, Satish Balay <span dir="ltr">&lt;<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Weidong,<br>
<br>
What do you have for the following?<br>
<br>
env |grep LANG<br>
cd src/benchmarks<br>
gcc sizeof.c<br>
gcc -PIC sizeof.c<br>
<div class="im">export LANG=en_US.UTF-8<br>
</div>gcc -PIC sizeof.c<br>
<br>
<br>
thanks,<br>
<font color="#888888">Satish<br>
</font></blockquote></div><br>