ns3-13 build fails, shared library libstdc++ problem (Debian)

828 views
Skip to first unread message

paszcior

unread,
Mar 7, 2012, 6:14:40 PM3/7/12
to ns-3-users
Hello everyone!

I'm trying to tackle a problem described here:
https://www.nsnam.org/bugzilla/show_bug.cgi?id=1174. It's not fixed in
this thread, neither in other threads which I came across (like this
one: http://groups.google.com/group/ns-3-users/browse_thread/thread/693c6a5f1533c89e)

The symptom is that when building the ns3-13 with "$./waf build" I get
the following error:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc+
+.a(functexcept.o): relocation R_X86_64_32 against
`std::bad_typeid::~bad_typeid()' can not be used when making a shared
object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/paszcior/ns3/ns-3-allinone/ns-3.13/
build'
Build failed

If I understand correctly, the problem is that the compiler is using
the static library libstdc++.a, while it should use the shared library
libstdc++.so instead?

And the question is: how to modify the configuration or compilation
scripts to force them to use the shared library, which can be found it
here:

$ locate libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
/usr/lib32/libstdc++.so.6
/usr/lib32/libstdc++.so.6.0.13

Could it be the way around the problem?
I will be grateful for help in solving this issue.

Here's also my configure output in case it's necessary:

$ ./waf configure
Setting top to : /home/paszcior/ns3/ns-3-
allinone/ns-3.13
Setting out to : /home/paszcior/ns3/ns-3-
allinone/ns-3.13/build
Checking for 'gcc' (c compiler) : /usr/bin/gcc
Checking for 'g++' (c++ compiler) : /usr/bin/g++
Checking for program pkg-config : /usr/bin/pkg-config
Checking for compilation flag -Wl,--soname=foo... support : ok
Checking for click location : not found
Checking for pkg-config flags for GTK_CONFIG_STORE : not found
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
Checking for pkg-config flags for LIBXML2 : not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Checking for type uint128_t : not found
Checking for type __uint128_t : yes
Checking high precision time implementation : 128-bit
integer
Checking for header stdint.h : yes
Checking for header inttypes.h : yes
Checking for header sys/inttypes.h : not found
Checking for header sys/types.h : yes
Checking for header sys/stat.h : yes
Checking for header dirent.h : yes
Checking for header stdlib.h : yes
Checking for header signal.h : yes
Checking for header pthread.h : yes
Checking for header stdint.h : yes
Checking for header inttypes.h : yes
Checking for header sys/inttypes.h : not found
Checking for library rt : yes
Checking for header netpacket/packet.h : yes
Checking for NSC location : ../nsc
(guessed)
Checking for library dl : yes
Checking for NSC supported architecture x86_64 : ok
Checking for header sys/socket.h : yes
Checking for header netinet/in.h : yes
Checking boost includes : not found
Checking for library sqlite3 : not found
Checking for pkg-config flags for SQLITE3 : not found
Package sqlite3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sqlite3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sqlite3' found
Checking for header linux/if_tun.h : yes
Checking for program python : /usr/bin/
python
Checking for python version : (2, 6, 6,
'final', 0)
Checking for library python2.6 in LIBDIR : yes
Checking for program python2.6-config,python-config-2.6,python2.6m-
config : /usr/bin/python2.6-config
Checking for header
Python.h : yes
Checking for compilation flag -fvisibility=hidden...
support : ok
Checking for pybindgen
location : ../pybindgen
(guessed)
Python module
pybindgen : ok
Checking for pybindgen
version : 0.15.0.795
Checking for types uint64_t and unsigned long
equivalence : yes
Checking for types uint64_t and unsigned long long
equivalence : no
Checking for the apidefs that can be used for Python
bindings : gcc-LP64
Checking for internal GCC
cxxabi : complete
Python module
pygccxml : not
found
Checking for program
sudo : /usr/bin/sudo
Checking for program
valgrind : not found
Checking for pkg-config flags for
GSL : not found
Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
Checking for compilation flag -Wno-error=deprecated-d...
support : ok
Checking for compilation flag -Wno-error=deprecated-d...
support : ok
Checking for compilation flag -fstrict-aliasing...
support : ok
Checking for compilation flag -fstrict-aliasing...
support : ok
Checking for compilation flag -Wstrict-aliasing...
support : ok
Checking for compilation flag -Wstrict-aliasing...
support : ok
Checking for program
doxygen : not found
---- Summary of optional NS-3 features:
NS-3 Click Integration : not enabled (nsclick not enabled (see
option --with-nsclick))
GtkConfigStore : not enabled (library 'gtk+-2.0 >=
2.12' not found)
XmlIo : not enabled (library 'libxml-2.0 >=
2.7' not found)
Threading Primitives : enabled
Real Time Simulator : enabled
Emulated Net Device : enabled
Network Simulation Cradle : not enabled (NSC library
liblinux2.6.26.so is missing: NSC has not been built?)
MPI Support : not enabled (option --enable-mpi not
selected)
NS-3 OpenFlow Integration : not enabled (Required boost libraries
not found)
SQlite stats data output : not enabled (library 'sqlite3' not
found)
Tap Bridge : enabled
Python Bindings : enabled
Python API Scanning Support : not enabled (Missing 'pygccxml' Python
module)
Use sudo to set suid bit : not enabled (option --enable-sudo not
selected)
Build tests : not enabled (defaults to disabled)
Build examples : not enabled (defaults to disabled)
GNU Scientific Library (GSL) : not enabled (GSL not found)
'configure' finished successfully (4.592s)

paszcior

unread,
Mar 9, 2012, 1:26:18 PM3/9/12
to ns-3-...@googlegroups.com
After several tries I finally managed to deal with this problem by compiling the ns-3-dev branch with

$ ./waf --enable-static

paszcior

unread,
Mar 11, 2012, 2:08:50 PM3/11/12
to ns-3-...@googlegroups.com
As the statistically linked ns3 took about 6 GB of disk space (with tests and examples) I kept on looking for a way to link libstdc++ dynamically.

The problem turned out to be my fault and it's not connected with ns3 at all. In the past I installed a newer version of libstdc++6 for 4.6 gcc version, without updating the gcc itself. gcc-4.4.5 which I currently use seemed not to accept the libstdc++6 package existing in my system. Downgrade to libstdc++6 for gcc 4.4 solved the problem.

Sorry for bothering!
Reply all
Reply to author
Forward
0 new messages