Hello,<br><br>I did not configure the flag -PIC, can you tell me how to change the -PIC to -fPIC.<br>By the way, why there are two types lib *.so and *.lib in the library path. But when I change option to FC=g77, it only left *.lib in the library path.<br>
<br>Thank you very much.<br>Weidong<br><br><div class="gmail_quote">On Tue, Mar 10, 2009 at 6:58 PM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>></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;">
Sugest doing the following:<br>
<br>
cd src/ksp/ksp/examples/tutorials<br>
make ex2<br>
<br>
And now make sure *all* compile and include options are also used in<br>
your makefile. [-PIC is an error - configure should have picked up<br>
-fPIC - not -PIC]<br>
<br>
One easy way to do this is to use PETSc makefiles [check<br>
src/ksp/ksp/examples/tutorials/makefile]. This shows how to use PETSc<br>
'make targets and variables.<br>
<br>
But since you want to use your own targets - you can pickup atleat the<br>
variables by Perhaps doing the following:<br>
<br>
include ${PETSC_DIR}/conf/variables<br>
< now use $(PETSC_LIB) ><br>
<font color="#888888"><br>
Satish<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Tue, 10 Mar 2009, Wei-Dong Lian wrote:<br>
<br>
> Hello,<br>
> I am so sorry for that, but you are right. Thanks for your advice and I will<br>
> pay more attention from now on. Thank you very much.<br>
> Weidong<br>
><br>
> On Tue, Mar 10, 2009 at 6:43 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
> ><br>
> > The order that libraries are listed in a makefile IS IMPORTANT.<br>
> ><br>
> > DDLIBSTATIC := $(ADDLIBSTATIC) $(PETSC_LIBDIR)/libmpiuni.a<br>
> > $(PETSC_LIBDIR)/libpetsccontrib.a $(PETSC_LIBDIR)/libpetscksp.a<br>
> > $(PETSC_LIBDIR)/libpetscsnes.a $(PETSC_LIBDIR)/libpetscvec.a<br>
> > $(PETSC_LIBDIR)/libpetsc.a $(PETSC_LIBDIR)/libpetscdm.a<br>
> > $(PETSC_LIBDIR)/libpetscmat.a $(PETSC_LIBDIR)/libpetscts.a<br>
> ><br>
> > Here you have some crazy, nonsense ordering of the libraries. Whoever made<br>
> > this "makefile" doesn't have a clue about unix; you cannot just dump random<br>
> > strings of characters into files and expect to develop software! It requires<br>
> > some basic understanding of what you are doing.<br>
> ><br>
> ><br>
> > Barry<br>
> ><br>
> ><br>
> ><br>
> > On Mar 10, 2009, at 11:56 AM, Wei-Dong Lian wrote:<br>
> ><br>
> > Hello,<br>
> >> Following are my makefile for link petsc. Before I configure with option<br>
> >> fortrun compiler with gfortran, it generates the shared library, now in my<br>
> >> computer with g77, so there is no shared library, I use the static library<br>
> >> as below.<br>
> >> Thanks for your information.<br>
> >> Weidong<br>
> >><br>
> >> ****************************************************<br>
> >> #FOR PETSC<br>
> >> ifdef HAVE_PETSC<br>
> >> DEFS := $(DEFS) -DHAVE_PETSC<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<br>
> >> -I$(PETSC_DIR)/include/mpiuni -I$(PETSC_DIR)/include/adic<br>
> >> -I$(PETSC_DIR)/$(PETSC_ARCH)/include<br>
> >><br>
> >> ADDLIB := $(ADDLIB) -llapack<br>
> >> #ADDLIB := $(ADDLIB) -L$(PETSC_LIBDIR) -Wl,-rpath,$(PETSC_LIBDIR)<br>
> >> -lpetsccontrib -lpetscksp -lpetscsnes -lpetscvec -lpetsc -lpetscdm<br>
> >> -lpetscmat -lpetscts<br>
> >> ADDLIBSTATIC := $(ADDLIBSTATIC) $(PETSC_LIBDIR)/libmpiuni.a<br>
> >> $(PETSC_LIBDIR)/libpetsccontrib.a $(PETSC_LIBDIR)/libpetscksp.a<br>
> >> $(PETSC_LIBDIR)/libpetscsnes.a $(PETSC_LIBDIR)/libpetscvec.a<br>
> >> $(PETSC_LIBDIR)/libpetsc.a $(PETSC_LIBDIR)/libpetscdm.a<br>
> >> $(PETSC_LIBDIR)/libpetscmat.a $(PETSC_LIBDIR)/libpetscts.a<br>
> >><br>
> >> endif<br>
> >> #End For PETSC<br>
> >><br>
> >> *****************************************************************************************<br>
> >> On Tue, Mar 10, 2009 at 5:34 PM, Wei-Dong Lian <<a href="mailto:weidong.lian@gmail.com">weidong.lian@gmail.com</a>><br>
> >> wrote:<br>
> >> Hi,<br>
> >> I did not use the PETSc makefiles. First I do not know where it located.<br>
> >> Second, I have configured my makefile to link my programme, before it<br>
> >> worked, that's in another computer, the difference lies in the fact that<br>
> >> this time in the lib directory, there were not *.so library, but *.lib<br>
> >> library. Maybe I think it is the problem.<br>
> >> Thanks.<br>
> >> Weidong<br>
> >><br>
> >><br>
> >> On Tue, Mar 10, 2009 at 5:07 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>><br>
> >> wrote:<br>
> >> On Tue, Mar 10, 2009 at 10:59 AM, Wei-Dong Lian <<a href="mailto:weidong.lian@gmail.com">weidong.lian@gmail.com</a>><br>
> >> wrote:<br>
> >> Hello everyone,<br>
> >><br>
> >> I compiled the petsc-3.0.0-p3 with GCC 3.4.3 under linux 64. But the<br>
> >> compiler gave me the following information, see result_1.<br>
> >> I also ran the "make test" and it worked successfully, but when I linked<br>
> >> petsc to compile my programme, it told me that information see results_2.<br>
> >> Any suggestion will be appreciated.<br>
> >> Thank you in advance.<br>
> >><br>
> >> 1) Any report like this should be sent to <a href="mailto:petsc-maint@mcs.anl.gov">petsc-maint@mcs.anl.gov</a> because<br>
> >> we need configure.log and make*.log.<br>
> >><br>
> >> 2) The warning about -PIC comes about because we cannot parse the warning<br>
> >> messages from your compiler. We can try to<br>
> >> add this in when we get the log.<br>
> >><br>
> >> 3) If 'make test' works and your link does not, then you have constructed<br>
> >> your link line incorrectly. Are you using the PETSc makefiles?<br>
> >><br>
> >> Matt<br>
> >><br>
> >><br>
> >> Weidong<br>
> >><br>
> >> $$$$$$$$$$$$$$$$$$$$$Result_1$$$$$$$$$$$$$$$$$$$$$$$$$$$$$<br>
> >> /ftn-custom<br>
> >> g++: option « -PIC » non reconnue<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/explicit<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/explicit/euler<br>
> >> g++: option « -PIC » non reconnue<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/explicit/rk<br>
> >> g++: option « -PIC » non reconnue<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/explicit/rk/ftn-auto<br>
> >> g++: option « -PIC » non reconnue<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/implicit<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/implicit/beuler<br>
> >> g++: option « -PIC » non reconnue<br>
> >> libfast in:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/ts/impls/implicit/cn<br>
> >><br>
> >><br>
> >> #####################################results_2################################<br>
> >> /usr/local/temp/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscdm.a(daint.o)(.text+0x2aaf):<br>
> >> In function `DAGetWireBasketInterpolation(_p_DA*, _p_Mat*, MatReuse,<br>
> >> _p_Mat**)':<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/dm/da/utils/daint.c:201:<br>
> >> undefined reference to `PetscTableCreate(int, _n_PetscTable**)'<br>
> >> /usr/local/temp/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscdm.a(daint.o)(.text+0x2b3d):/usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/dm/da/utils/daint.c:203:<br>
> >> undefined reference to `PetscTableAddCount(_n_PetscTable*, int)'<br>
> >> /usr/local/temp/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscdm.a(daint.o)(.text+0x2ba1):/usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/dm/da/utils/daint.c:205:<br>
> >> undefined reference to `PetscTableGetCount(_n_PetscTable*, int*)'<br>
> >> /usr/local/temp/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscdm.a(daint.o)(.text+0x2d24):/usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/dm/da/utils/daint.c:209:<br>
> >> undefined reference to `PetscTableFind(_n_PetscTable*, int, int*)'<br>
> >> /usr/local/temp/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscdm.a(daint.o)(.text+0x2d8d):/usr/local/temp/lian/Develop/latest/Solver/petscSeq/src/dm/da/utils/daint.c:212:<br>
> >> undefined reference to `PetscTableDestroy(_n_PetscTable*)'<br>
> >> /usr/local/temp/lian/Develop/Solver/petscSeq/x86_64_linux/lib/libpetscdm.a(daint.o)(.text+0x5adf):<br>
> >> In function `DAGetFaceInterpolation(_p_DA*, _p_Mat*, MatReuse, _p_Mat**)':<br>
> >><br>
> >> #####################################################################################<br>
> >><br>
> >><br>
> >> My configuration of petsc:<br>
> >> &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&<br>
> >><br>
> >> Pushing language C<br>
> >> Popping language C<br>
> >> Pushing language Cxx<br>
> >> Popping language Cxx<br>
> >> Pushing language FC<br>
> >> Popping language FC<br>
> >> sh: /bin/sh<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/config/BuildSystem/config/packages/config.gue<br>
> >> ss<br>
> >> Executing: /bin/sh<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/config/BuildSystem/config/packages/con<br>
> >> fig.guess<br>
> >> sh: x86_64-unknown-linux-gnu<br>
> >><br>
> >> sh: /bin/sh<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/config/BuildSystem/config/packages/config.sub<br>
> >> x86_64-unknown-linux-gnu<br>
> >><br>
> >> Executing: /bin/sh<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/config/BuildSystem/config/packages/con<br>
> >> fig.sub x86_64-unknown-linux-gnu<br>
> >><br>
> >> sh: x86_64-unknown-linux-gnu<br>
> >><br>
> >><br>
> >><br>
> >> ================================================================================<br>
> >><br>
> >> ================================================================================<br>
> >> Starting Configure Run at Tue Mar 10 16:23:30 2009<br>
> >> Configure Options: --configModules=PETSc.Configure<br>
> >> --optionsModule=PETSc.compilerOptions --with-cc=gcc --with-fc=g77 --with-cx<br>
> >> x=g++ --with-mpi=0 --with-x=0 --with-clanguage=cxx --with-shared=1<br>
> >> --with-dynamic=1<br>
> >> Working directory:<br>
> >> /usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3<br>
> >> Machine uname:<br>
> >> ('Linux', 'frioul', '2.6.9-22.ELsmp', '#1 SMP Sat Oct 8 21:32:36 BST<br>
> >> 2005', 'x86_64')<br>
> >> Python version:<br>
> >> 2.3.4 (#1, Feb 17 2005, 21:01:10)<br>
> >> [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)]<br>
> >><br>
> >> ================================================================================<br>
> >> Pushing language C<br>
> >> Popping language C<br>
> >> Pushing language Cxx<br>
> >> Popping language Cxx<br>
> >> Pushing language FC<br>
> >> Popping language FC<br>
> >><br>
> >> ================================================================================<br>
> >> TEST configureExternalPackagesDir from<br>
> >> config.framework(/usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/c<br>
> >> onfig/BuildSystem/config/framework.py:815)<br>
> >> TESTING: configureExternalPackagesDir from<br>
> >> config.framework(config/BuildSystem/config/framework.py:815)<br>
> >><br>
> >> ================================================================================<br>
> >> TEST configureLibrary from<br>
> >> PETSc.packages.NetCDF(/usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/config/P<br>
> >> ETSc/packages/NetCDF.py:10)<br>
> >> TESTING: configureLibrary from<br>
> >> PETSc.packages.NetCDF(config/PETSc/packages/NetCDF.py:10)<br>
> >> Find a NetCDF installation and check if it can work with PETSc<br>
> >><br>
> >> ================================================================================<br>
> >> TEST configureLibrary from<br>
> >> PETSc.packages.PVODE(/usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/config/PE<br>
> >> TSc/packages/PVODE.py:10)<br>
> >> TESTING: configureLibrary from<br>
> >> PETSc.packages.PVODE(config/PETSc/packages/PVODE.py:10)<br>
> >> Find a PVODE installation and check if it can work with PETSc<br>
> >><br>
> >> ================================================================================<br>
> >> TEST configureDebuggers from<br>
> >> PETSc.utilities.debuggers(/usr/local/temp/lian/Develop/latest/Solver/OpenSource/petsc-3.0.0-p3/co<br>
> >> nfig/PETSc/utilities/debuggers.py:22)<br>
> >> TESTING: configureDebuggers from<br>
> >> PETSc.utilities.debuggers(config/PETSc/utilities/debuggers.py:22)<br>
> >> Find a default debugger and determine its arguments<br>
> >><br>
> >><br>
> >><br>
> >><br>
> >> --<br>
> >> What most experimenters take for granted before they begin their<br>
> >> experiments is infinitely more interesting than any results to which their<br>
> >> experiments lead.<br>
> >> -- Norbert Wiener<br>
> >><br>
> >><br>
> >><br>
> ><br>
> </div></div></blockquote></div><br>