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

Re: [Condor-users] Using condor_compile with STL + third party libraries



I've been having the same problem with STL and GSL. It compiles fine without condor_compile and fails miserably otherwise.

[bgoncalves@underdark EO]$ make wEO
g++  wEO.cpp -I. -I./include/ -I/home/bgoncalves/progs/include -lgsl -lgslcblas  -lm -o wEO.x
wEO.cpp:123:2: warning: no newline at end of file

[bgoncalves@underdark EO]$ /usr/local/condor/sbin/condor -version
$CondorVersion: 6.7.13 Nov  7 2005 $
$CondorPlatform: I386-LINUX_RH9 $

[bgoncalves@underdark EO]$ uname -a
Linux underdark.physics.emory.edu 2.6.12-1.1381_FC3 #1 Fri Oct 21 03:46:55 EDT 2005 i686 athlon i386 GNU/Linux

[bgoncalves@underdark EO]$ gcc --version
gcc (GCC) 3.4.4 20050721 (Red Hat 3.4.4-2)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[bgoncalves@underdark EO]$ condor_compile g++  wEO.cpp -I. -I./include/ -I/home/bgoncalves/progs/include -lgsl -lgslcblas  -lm -o wEO.x
wEO.cpp:123:2: warning: no newline at end of file

LINKING FOR CONDOR : /usr/bin/ld.real -L/usr/local/condor/lib -Bstatic --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld- linux.so.2 -o wEO.x /usr/local/condor/lib/condor_rt0.o /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../crti.o /usr/lib/gcc/i386-redhat-linux/3.4.4/crtbeginT.o -L/usr/lib/gcc/i386-redhat-linux/3.4.4 -L/usr/lib/gcc/i386-redhat-linux/3.4.4 -L/usr/lib/gcc/i386-redhat-linux/3.4.4/../../.. /tmp/ccTXPUgI.o -lgsl -lgslcblas /usr/local/condor/lib/libcondorzsyscall.a /usr/local/condor/lib/libcondor_z.a /usr/local/condor/lib/libcomp_libstdc++.a /usr/local/condor/lib/libcomp_libstdc++.a -lm /usr/local/condor/lib/libcomp_libgcc.a /usr/local/condor/lib/libcomp_libgcc_eh.a -lcondor_c -lcondor_nss_files -lcondor_nss_dns -lcondor_resolv -lcondor_c -lcondor_nss_files -lcondor_nss_dns -lcondor_resolv -lcondor_c /usr/local/condor/lib/libcomp_libgcc.a /usr/local/condor/lib/libcomp_libgcc_eh.a /usr/lib/gcc/i386-redhat-linux/3.4.4/crtend.o /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../crtn.o
/usr/local/condor/lib/libcondorzsyscall.a(condor_file_agent.o)(.text+0x250): In function `CondorFileAgent::open(char const*, int, int)':
/home/condor/execute/dir_17959/userdir/src/condor_ckpt/condor_file_agent.C:99: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/tmp/ccTXPUgI.o(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsSsESt10_Select1stIS2_ESt4lessISsESaIS2_EE9_M_insertEPSt18_Rb_tree_node_baseSA_RKS2_+0x87): In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)':
: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/tmp/ccTXPUgI.o(.gnu.linkonce.t._ZNSt17_Rb_tree_iteratorISt4pairIKSsSsEEmmEv+0x13): In function `std::_Rb_tree_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator--()':
: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
collect2: ld returned 1 exit status
[bgoncalves@underdark EO]$

Any idea on how to make it work as expected?

On 12/1/05, Peter Keller <psilord@xxxxxxxxxxx> wrote:
Hello,

On Mon, Nov 28, 2005 at 03:56:04PM +0100, Daniel R Figueiredo wrote:
> I've been trying to use condor_compile together with g++ to compile and
> link C++ code that makes use of STL. The code I'm trying to compile also
> links with a third party library (which has not been compiled with
> condor_compile). Unfortunately, I keep getting error messages in the link
> phase to undefined references to functions. However, these references are
> to classes and methods in the std library.

While there is no theoretical reason why Condor's standard universe cannot
work with STL, there might be some practical ones. My advice to you would
be to ensure that ALL of your source code that you wish to link together
with condor_compile is compiled with the same compiler revision, including the
third party librariy (_especially_ if it is C++ based).

If you do this with gcc 3.4.4, and things *still* fail to link with
similar undefined reference errors, then things get a little more
complicated.

In effect, there would be an internal STL ABI backwards compatibility
failure between the STL that shipped with the gcc 3.4.4 compiler, and
the STL shipped along with Condor's libstdc++ implementation gotten from
the gcc 3.2.2 compiler.

If this ends up being the case, then you'll have to move to the gcc 3.2.2
compiler and recompile all of the potential C++ libraries you want to link
against before linking everything together with condor_compile.

Thank you.

Peter Keller
Condor Project
UW-Madison
_______________________________________________
Condor-users mailing list
Condor-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/condor-users



--
*******************************************
Bruno Miguel Tavares Goncalves, MS
PhD Candidate
Emory University
Department of Physics
Office No. N117-C
400 Dowman Drive
Atlanta, Georgia 30322
Homepage: www.bgoncalves.com
Email: bgoncalves@xxxxxxxxx
Phone: (404) 712-2441
Fax:   (404) 727-0873
*******************************************