[Trilinos-Users] error with compilation of the shared libaries
Riccardo Rossi
rrossi at cimne.upc.edu
Mon Oct 20 04:34:10 MDT 2008
I get exactly the same error (missing -fPIC) while linking
Teuchos_BLAS.o on ubuntu 8.04 64bit
Riccardo
On Sun, 2008-10-19 at 12:00 -0600,
trilinos-users-request at software.sandia.gov wrote:
> Send Trilinos-Users mailing list submissions to
> trilinos-users at software.sandia.gov
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://software.sandia.gov/mailman/listinfo/trilinos-users
> or, via email, send a message with subject or body 'help' to
> trilinos-users-request at software.sandia.gov
>
> You can reach the person managing the list at
> trilinos-users-owner at software.sandia.gov
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Trilinos-Users digest..."
>
>
> Today's Topics:
>
> 1. shared LIBs cannot be built, possibly -fPIC is missing
> (Orlando.Rivera at lrz.de)
> 2. shared LIBs cannot be built, possibly -fPIC is missing
> (Orlando.Rivera at lrz.de)
> 3. Re: shared LIBs cannot be built, possibly -fPIC is missing
> (Bill Spotz)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 18 Oct 2008 09:47:52 +0200 (CEST)
> From: Orlando.Rivera at lrz.de
> Subject: [Trilinos-Users] shared LIBs cannot be built, possibly
> -fPIC is missing
> To: "trilinos-users at software.sandia.gov"
> <trilinos-users at software.sandia.gov>,
> trilinos-users-bounces at software.sandia.gov
> Cc: Orlando.Rivera at lrz.de
> Message-ID:
> <35911.91.12.240.138.1224316072.squirrel at webmail.lrz-muenchen.de>
> Content-Type: text/plain; charset=iso-8859-1
>
> Hi I have a problem when I want to build with shared libraries
>
> this is my configure
>
> ./configure CXXFLAGS=-O3 -64 -LANG:std -LANG:ansi -DMPI_NO_CPPBIND
> --prefix=/home/cluster/pr28fa/a2815ag/lib/trilinos-9.0.0
> --with-install=/usr/bin/install -p
> --with-blas=-L/lrz/sys/intel/mkl91/lib/64s -lmkl -lpthread
> --with-lapack=-L/lrz/sys/intel/mkl91/lib/64s -lmkl_lapack -lpthreads
> --enable-mpi --with-mpi-compilers --enable-shared --enable-amesos
> --enable-anasazi --enable-aztecoo --enable-belos --enable-didasko
> --enable-epetra --enable-epetraext --enable-external --enable-ifpack
> --enable-fei --enable-isorropia --enable-kokkos --enable-komplex
> --enable-meros --enable-ml --enable-moertel --enable-moocho --enable-nox
> --enable-phalanx --enable-phdmesh --enable-pliris --enable-pytrilinos
> --enable-rythmos --enable-sacado --enable-sundance --enable-teuchos
> --enable-pamgen --enable-rtop --enable-threadpool --enable-thyra
> --enable-stratimikos --enable-trilinoscouplings --enable-triutils
> --enable-galeri --enable-webtrilinos -enable-zoltan
> --enable-aztecoo-teuchos
> --with-swig=/home/cluster/pr28fa/a2815ag/lib/swig-1.3.36
>
> The problem comes with teuchos for example
>
> Linking teuchos as a shared library
> changing directory to ../../teuchos/src
> mpiCC -shared -Wl,-soname,libteuchos.so -o libteuchos.so *.o
> -L/ptmp2/pr28fa/a2815ag/trilinos/trilinos-9.0.0/packages/PyTrilinos/shared
> -L/ptmp2/pr28fa/a2815ag/trilinos/trilinos-9.0.0/packages/teuchos/src
> -L/lrz/sys/intel/mkl91/lib/64s -lmkl_lapack -lpthreads -lmkl -lpthread
> -L/usr/lib -L/lrz/sys/intel/ifort_101_18/lib
> -L/usr/lib/gcc/ia64-suse-linux/4.1.2 -lmpi -lffio -lsma -lifport -lifcore
> -limf -lm -lipgo -lirc -lirc_s -ldl
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9ESideCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EUploCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos11ETranspCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EDiagCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9ESideCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EUploCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos11ETranspCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EDiagCharE
>
>
> So when --shared is given, apparently Teuchos_BLAS.o was compiled
> without -fPIC
>
> any idea how can I solve that or should I pass FLAGS=-fPIC, what about the
> objects statically built , I assume you have 2 versions of the same
> object one statically and one dynamically linked , so the static *.o
> is packet with ar and the *.o build with -fPIC is to go in the *.so
> is that correct ?
>
> cheers
>
>
> --
> Orlando Rivera Mail: rivera at lrz.de
> Leibniz-Rechenzentrum Web: http://www.lrz.de
> Boltzmannstrasse 1, 85748 Garching
> Telefon:+49 89 35831-8827
> Fax: +49 89 35831-9700
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 18 Oct 2008 19:26:39 +0200 (CEST)
> From: Orlando.Rivera at lrz.de
> Subject: [Trilinos-Users] shared LIBs cannot be built, possibly
> -fPIC is missing
> To: "trilinos-users at software.sandia.gov"
> <trilinos-users at software.sandia.gov>,
> trilinos-users-bounces at software.sandia.gov
> Message-ID:
> <44411.91.12.212.44.1224350799.squirrel at webmail.lrz-muenchen.de>
> Content-Type: text/plain; charset=iso-8859-1
>
> Hi I have a problem when I want to build with shared libraries
>
> this is my configure
>
> ./configure CXXFLAGS=-O3 -64 -LANG:std -LANG:ansi -DMPI_NO_CPPBIND
> --prefix=/home/cluster/pr28fa/a2815ag/lib/trilinos-9.0.0
> --with-install=/usr/bin/install -p
> --with-blas=-L/lrz/sys/intel/mkl91/lib/64s -lmkl -lpthread
> --with-lapack=-L/lrz/sys/intel/mkl91/lib/64s -lmkl_lapack -lpthreads
> --enable-mpi --with-mpi-compilers --enable-shared --enable-amesos
> --enable-anasazi --enable-aztecoo --enable-belos --enable-didasko
> --enable-epetra --enable-epetraext --enable-external --enable-ifpack
> --enable-fei --enable-isorropia --enable-kokkos --enable-komplex
> --enable-meros --enable-ml --enable-moertel --enable-moocho --enable-nox
> --enable-phalanx --enable-phdmesh --enable-pliris --enable-pytrilinos
> --enable-rythmos --enable-sacado --enable-sundance --enable-teuchos
> --enable-pamgen --enable-rtop --enable-threadpool --enable-thyra
> --enable-stratimikos --enable-trilinoscouplings --enable-triutils
> --enable-galeri --enable-webtrilinos -enable-zoltan
> --enable-aztecoo-teuchos
> --with-swig=/home/cluster/pr28fa/a2815ag/lib/swig-1.3.36
>
> The problem comes with teuchos for example
>
> Linking teuchos as a shared library
> changing directory to ../../teuchos/src
> mpiCC -shared -Wl,-soname,libteuchos.so -o libteuchos.so *.o
> -L/ptmp2/pr28fa/a2815ag/trilinos/trilinos-9.0.0/packages/PyTrilinos/shared
> -L/ptmp2/pr28fa/a2815ag/trilinos/trilinos-9.0.0/packages/teuchos/src
> -L/lrz/sys/intel/mkl91/lib/64s -lmkl_lapack -lpthreads -lmkl -lpthread
> -L/usr/lib -L/lrz/sys/intel/ifort_101_18/lib
> -L/usr/lib/gcc/ia64-suse-linux/4.1.2 -lmpi -lffio -lsma -lifport -lifcore
> -limf -lm -lipgo -lirc -lirc_s -ldl
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9ESideCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EUploCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos11ETranspCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EDiagCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9ESideCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EUploCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos11ETranspCharE
> ld: Teuchos_BLAS.o: @gprel relocation against dynamic symbol
> _ZN7Teuchos9EDiagCharE
>
>
> So when --shared is given, apparently Teuchos_BLAS.o was compiled
> without -fPIC
>
> any idea how can I solve that or should I pass FLAGS=-fPIC, what about the
> objects statically built , I assume you have 2 versions of the same
> object one statically and one dynamically linked , so the static *.o
> is packet with ar and the *.o build with -fPIC is to go in the *.so
> is that correct ?
>
> cheers
>
>
> --
> Orlando Rivera Mail: rivera at lrz.de Leibniz-Rechenzentrum Web:
> http://www.lrz.de Boltzmannstrasse 1, 85748 Garching Telefon:+49 89
> 35831-8827 Fax: +49 89 35831-9700
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 18 Oct 2008 17:44:48 -0400
> From: Bill Spotz <wfspotz at sandia.gov>
> Subject: Re: [Trilinos-Users] shared LIBs cannot be built, possibly
> -fPIC is missing
> To: <Orlando.Rivera at lrz.de>
> Cc: "trilinos-users at software.sandia.gov
> trilinos-users at software.sandia.gov"
> <trilinos-users at software.sandia.gov>
> Message-ID: <726D6DBD-0FC2-4D47-866A-F697453935C2 at sandia.gov>
> Content-Type: text/plain; charset="US-ASCII"; format=flowed; delsp=yes
>
> On Oct 18, 2008, at 3:47 AM, Orlando.Rivera at lrz.de wrote:
>
> > any idea how can I solve that or should I pass FLAGS=-fPIC,
>
> Yes, and for CFLAGS and CXXFLAGS, too.
>
> > what about the
> > objects statically built , I assume you have 2 versions of the same
> > object one statically and one dynamically linked , so the static
> > *.o
> > is packet with ar and the *.o build with -fPIC is to go in the *.so
> > is that correct ?
>
>
> No. We only generate the PIC objects and they go into both the static
> and dynamic libraries.
>
> ** Bill Spotz **
> ** Sandia National Laboratories Voice: (505)845-0170 **
> ** P.O. Box 5800 Fax: (505)284-0154 **
> ** Albuquerque, NM 87185-0370 Email: wfspotz at sandia.gov **
>
>
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>
>
> End of Trilinos-Users Digest, Vol 38, Issue 16
> **********************************************
>
More information about the Trilinos-Users
mailing list