Hello for compiled problem

Wei-Dong Lian weidong.lian at gmail.com
Tue Mar 10 14:33:35 CDT 2009


Hello,

I did not configure the flag -PIC, can you tell me how to change the -PIC to
-fPIC.
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.

Thank you very much.
Weidong

On Tue, Mar 10, 2009 at 6:58 PM, Satish Balay <balay at mcs.anl.gov> wrote:

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


More information about the petsc-users mailing list