libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Libtool adding libraries differently than neededwith compilerwrapper


From: Kapoor, Nitin
Subject: RE: Libtool adding libraries differently than neededwith compilerwrappers
Date: Fri, 22 Apr 2011 12:38:33 -0400

I am having a similar issue where libtool is passing
(/usr/sfw/lib/libstdc++.so) to the linker. 

libtool: link: g++ -g -O2 -D_REENTRANT -pthreads -o .libs/EnumVal
src/EnumVal/EnumVal.o  ../src/.libs/libxerces-c.so
/usr/sfw/lib/libstdc++.so -L/usr/sfw/lib -lnsl -lsocket -licuuc
-licudata -pthreads -Wl,-R -Wl,/usr/local/lib -Wl,-R -Wl,/usr/sfw/lib
ld: warning: file /usr/sfw/lib/libstdc++.so: attempted multiple
inclusion of file

I found out that it is because of the postdeps variable in the libtool
script. If you search the libtool script, you will find a similar entry
to this:-
postdeps="-lstdc++ -lm -lgcc_s -lgcc_s". If I remove -lstdc++, then I
get clean compile ( no multiple inclusion warning).

I do not know how to configure libtool to remove it by itself. This may
be your issue as well.

Thanks,

Nitin.




-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of John R.
Cary
Sent: Friday, April 22, 2011 12:28 PM
To: address@hidden
Subject: Re: Libtool adding libraries differently than neededwith
compilerwrappers

Hi Nitin,

I take the link line output from libtool and throw it into a shell 
script, then
I remove those entries and run the script.

Thx...John

On 4/22/2011 10:25 AM, Kapoor, Nitin wrote:
> Hi John,
>
> How are you removing the following paths from you link:
>
> /opt/fftw/3.2.2.1/lib/libfftw3.so /opt/fftw/3.2.2.1/lib/libfftw3f.so
>     /opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64/libpmi.so
>     /usr/lib64/gcc/x86_64-suse-linux/4.1.2/libstdc++.so
>
> and
>
>     -lgcc_s
>
>
> Are you hand editing the libtool script ?
>
>
> Thanks
>
> Nitin.
>
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of John
R.
> Cary
> Sent: Friday, April 22, 2011 9:17 AM
> To: address@hidden
> Subject: Libtool adding libraries differently than needed with
> compilerwrappers
>
> We have a project using libtool on a Cray-XT4 using pathscale.
> For compiling in parallel, we are supposed to use the compiler
> wrapper, in this case ftn, that adds various libraries.  A particular
> complexity is that one has to switch libraries between front and
> back end nodes, and this is done with LD_LIBRARY_PATH.  We have
> a problem, in that libtool seems to extract libraries from
> the wrapper and put them at the end of the link line in a way
> that the linker exits with an error.
>
> System information
> x86_64-unknown-linux-gnu
> bash
> ftn (wrapping pathf90)
> -extend-source -byteswapio -fno-second-underscore -r8 -O2
> -fno-second-underscore
>
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin
> /ld
> libtool (GNU libtool) 2.4
> autoconf (GNU Autoconf) 2.68
> automake (GNU automake) 1.11.1
>
> The failure is
>
> /bin/sh ../../libtool --tag=FC --tag=FC  --mode=link ftn
> -I../../interfaces/wrap -I../../interfaces/src
>
-I/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r1
> 96-par/include
>
-I/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-
> r1341-par/include
> -I/opt/cray/hdf5-parallel/1.8.3.1/hdf5-parallel-pathscale/include
>
-I/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0
> .47-r114-par/include
> -extend-source -byteswapio -fno-second-underscore -r8 -O2
> -fno-second-underscore   -o runFlowShear runFlowShear.o libfmcfm.la
>
-L/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-
> r1341-par/lib/pathf
> -lglf23mpi -lmmm95 -lifspppl -lnclass -lkapisn
>
-L/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r1
> 96-par/lib/pathf
> -lGYRO -lNEO -lTGLF
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.
> 12-r51-ser/lib
> -llsode -lnlother -lr8slatec
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/l
> ib
> -lrfftw -lfftw /opt/acml/4.2.0/pathscale64/lib/libacml.a
> /opt/acml/4.2.0/pathscale64/lib/libacml.a
> /opt/acml/4.2.0/pathscale64/lib/libacml_mv.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0
> .47-r114-par/lib
> -lezcdf -lvshdf5
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par
> /lib
> -lnetcdf -lnetcdf_c++
> -L/opt/cray/hdf5-parallel/1.8.3.1/hdf5-parallel-pathscale/lib
> -lhdf5_fortran -lhdf5_hl -lhdf5
> /global/common/franklin/usg/szip/2.1/lib/libsz.a -lz
> libtool: link: ftn -I../../interfaces/wrap -I../../interfaces/src
>
-I/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r1
> 96-par/include
>
-I/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-
> r1341-par/include
> -I/opt/cray/hdf5-parallel/1.8.3.1/hdf5-parallel-pathscale/include
>
-I/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0
> .47-r114-par/include
> -extend-source -byteswapio -fno-second-underscore -r8 -O2
> -fno-second-underscore -o runFlowShear runFlowShear.o
> ./.libs/libfmcfm.a
>
-L/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-
> r1341-par/lib/pathf
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libglf23mpi.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libmmm95.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libifspppl.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libnclass.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libkapisn.a
>
-L/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r1
> 96-par/lib/pathf
>
/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r196
> -par/lib/pathf/libGYRO.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r196
> -par/lib/pathf/libNEO.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r196
> -par/lib/pathf/libTGLF.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.
> 12-r51-ser/lib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.12
> -r51-ser/lib/liblsode.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.12
> -r51-ser/lib/libnlother.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.12
> -r51-ser/lib/libr8slatec.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/l
> ib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/lib
> /librfftw.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/lib
> /libfftw.a
> /opt/acml/4.2.0/pathscale64/lib/libacml.a
> /opt/acml/4.2.0/pathscale64/lib/libacml_mv.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0
> .47-r114-par/lib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0.4
> 7-r114-par/lib/libezcdf.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0.4
> 7-r114-par/lib/libvshdf5.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par
> /lib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par/l
> ib/libnetcdf_c++.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par/l
> ib/libnetcdf.a
> /opt/fftw/3.2.2.1/lib/libfftw3.so /opt/fftw/3.2.2.1/lib/libfftw3f.so
> /opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64/libpmi.so -lpthread -ldl
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/libstdc++.so -lm -lc -lgcc_s
> -L/opt/cray/hdf5-parallel/1.8.3.1/hdf5-parallel-pathscale/lib
> -lhdf5_fortran -lhdf5_hl -lhdf5
> /global/common/franklin/usg/szip/2.1/lib/libsz.a -lz -pthread
-Wl,-rpath
>
> -Wl,/opt/fftw/3.2.2.1/lib -Wl,-rpath
> -Wl,/opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64 -Wl,-rpath
> -Wl,/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -Wl,-rpath
> -Wl,/opt/fftw/3.2.2.1/lib -Wl,-rpath
> -Wl,/opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64 -Wl,-rpath
> -Wl,/usr/lib64/gcc/x86_64-suse-linux/4.1.2
>
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin
> /ld:
> attempted static link of dynamic object
> `/opt/fftw/3.2.2.1/lib/libfftw3.so'
> collect2: ld returned 1 exit status
>
>
> So one sees that libtool put /opt/fftw/3.2.2.1/lib/libfftw3.so at the
> end of
> the link line when there was no need.  To get this to work, I remove
any
> .so files with full path:
> /opt/fftw/3.2.2.1/lib/libfftw3.so /opt/fftw/3.2.2.1/lib/libfftw3f.so
>     /opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64/libpmi.so
>     /usr/lib64/gcc/x86_64-suse-linux/4.1.2/libstdc++.so
>
> and
>
>     -lgcc_s
>
> from the link line and run it by hand.  Then it works.  (See below):
>
> So is there a way to tell libtool not to add any of these libraries
> to the link line?
>
> Thx...John Cary
>
> Working link:
>
> $ ftn -I../../interfaces/wrap -I../../interfaces/src
>
-I/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r1
> 96-par/include
>
-I/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-
> r1341-par/include
> -I/opt/cray/hdf5-parallel/1.8.3.1/hdf5-parallel-pathscale/include
>
-I/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0
> .47-r114-par/include
> -extend-source -byteswapio -fno-second-underscore -r8 -O2
> -fno-second-underscore -o runFlowShear runFlowShear.o
./.libs/libfmcfm.a
>
>
-L/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-
> r1341-par/lib/pathf
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libglf23mpi.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libmmm95.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libifspppl.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libnclass.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ntcc_transport-r1
> 341-par/lib/pathf/libkapisn.a
>
-L/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r1
> 96-par/lib/pathf
>
/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r196
> -par/lib/pathf/libGYRO.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r196
> -par/lib/pathf/libNEO.a
>
/project/projectdirs/facets/franklin/internal-path-3.2/ga_transport-r196
> -par/lib/pathf/libTGLF.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.
> 12-r51-ser/lib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.12
> -r51-ser/lib/liblsode.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.12
> -r51-ser/lib/libnlother.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netlib_lite-1.0.12
> -r51-ser/lib/libr8slatec.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/l
> ib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/lib
> /librfftw.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fftw-2.1.5-ser/lib
> /libfftw.a
> /opt/acml/4.2.0/pathscale64/lib/libacml.a
> /opt/acml/4.2.0/pathscale64/lib/libacml_mv.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0
> .47-r114-par/lib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0.4
> 7-r114-par/lib/libezcdf.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/fciowrappers-1.0.4
> 7-r114-par/lib/libvshdf5.a
>
-L/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par
> /lib
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par/l
> ib/libnetcdf_c++.a
>
/project/projectdirs/facets/franklin/contrib-path-3.2/netcdf-4.1.1-par/l
> ib/libnetcdf.a
> -lpthread -ldl -lm -lc
> -L/opt/cray/hdf5-parallel/1.8.3.1/hdf5-parallel-pathscale/lib
> -lhdf5_fortran -lhdf5_hl -lhdf5
> /global/common/franklin/usg/szip/2.1/lib/libsz.a -lz -pthread
-Wl,-rpath
>
> -Wl,/opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64 -Wl,-rpath
> -Wl,/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -Wl,-rpath
> -Wl,/opt/cray/pmi/1.0-1.0000.7901.22.1.ss/lib64 -Wl,-rpath
> -Wl,/usr/lib64/gcc/x86_64-suse-linux/4.1.2
> $
>
>
>
> _______________________________________________
> https://lists.gnu.org/mailman/listinfo/libtool
> -
> This message is intended only for the addressee and may contain
information that is company confidential or privileged.  Any technical
data in this message may be exported only in accordance with the U.S.
International Traffic in Arms Regulations (22 CFR Parts 120-130) or the
Export Administration Regulations (15 CFR Parts 730-774). Unauthorized
use is strictly prohibited and may be unlawful. If you are not the
intended recipient, or the person responsible for delivering to the
intended recipient, you should not read, copy, disclose or otherwise use
this message. If you have received this email in error, please delete
it, and advise the sender immediately.
> -
>
> _______________________________________________
> https://lists.gnu.org/mailman/listinfo/libtool
>


_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool
-
This message is intended only for the addressee and may contain information 
that is company confidential or privileged.  Any technical data in this message 
may be exported only in accordance with the U.S. International Traffic in Arms 
Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 
CFR Parts 730-774). Unauthorized use is strictly prohibited and may be 
unlawful. If you are not the intended recipient, or the person responsible for 
delivering to the intended recipient, you should not read, copy, disclose or 
otherwise use this message. If you have received this email in error, please 
delete it, and advise the sender immediately. 
-                                                                               
                                                                                
                                                                                
        



reply via email to

[Prev in Thread] Current Thread [Next in Thread]