PDA

View Full Version : [ubuntu] ns-2.30/ns-2.31 do not build with gcc/g++ 4.1



ariel.goldberg9
January 27th, 2009, 05:25 PM
ns-2.30/ns-2.31 do not build with gcc/g++ 4.1
I am having a little trouble installing ns2.33 on Intrepid
I have found this workaround for the problem, but i don't know how to implement it. Can someone help me understand what i am supposed to do to patch an configure.in file.
Workaround at this link
http://nsnam.isi.edu/nsnam/index.php/Troubleshooting#ns-2.30.2Fns-2.31_do_not_build_with_gcc.2Fg.2B.2B_4.1
Basically what you have to do is "Solution: Apply the following patch to configure.in in otcl-1.12 or otcl-1.13"
diff -uNr otcl-1.12/configure.in otcl-1.12-patched/configure.in
--- otcl-1.12/configure.in 2006-09-25 01:02:37.000000000 -0400
+++ otcl-1.12-patched/configure.in 2007-04-12 11:45:09.000000000 -0400
@@ -74,7 +74,7 @@
;;
Linux*)
SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
+ SHLIB_LD="${CC} -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""
What does that mean in English....?
Many thanks
Ariel

deceaseddolphin
July 28th, 2010, 06:36 PM
ns-2.30/ns-2.31 do not build with gcc/g++ 4.1
I am having a little trouble installing ns2.33 on Intrepid
I have found this workaround for the problem, but i don't know how to implement it. Can someone help me understand what i am supposed to do to patch an configure.in file.
Workaround at this link
http://nsnam.isi.edu/nsnam/index.php/Troubleshooting#ns-2.30.2Fns-2.31_do_not_build_with_gcc.2Fg.2B.2B_4.1
Basically what you have to do is "Solution: Apply the following patch to configure.in in otcl-1.12 or otcl-1.13"
diff -uNr otcl-1.12/configure.in otcl-1.12-patched/configure.in
--- otcl-1.12/configure.in 2006-09-25 01:02:37.000000000 -0400
+++ otcl-1.12-patched/configure.in 2007-04-12 11:45:09.000000000 -0400
@@ -74,7 +74,7 @@
;;
Linux*)
SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
+ SHLIB_LD="${CC} -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""
What does that mean in English....?
Many thanks
Ariel
I'm struck installing Aqua-sim simulator for wireless sensor networks as the package involves otcl-1.12 which does not install. The error is:

make: *** [libotcl.so] Error 1
otcl-1.12 make failed! Exiting ...

Please let me know if you've fixed the error!

Thanks,

juanka
January 8th, 2011, 01:14 AM
Hy:

I've tried these things on Ubuntu 10.04 LTS i386 on an Athlond AMD 64:


Using Synaptic look for “g++” , choose it and force it for 4:4.0.3-1 dapper.
Then, write:

# export CC="gcc-4.0"
# export CXX="g++-4.0"

Installing TCL
# cd /usr/src/ns-allinone-2.30/tcl8.4.13/unix/
#./configure
# make
# make install

Before installing TK, edit tk8.4.13/generic/tkBind.c
At line 588 introduce:
/* ColormapNotify */ COLORMAP,
/* ClientMessage */ 0,
/* MappingNotify */ 0,
#ifdef GenericEvent
/* GenericEvent */ 0,
#endif
/* VirtualEvent */ VIRTUAL,
/* Activate */ ACTIVATE,
/* Deactivate */ ACTIVATE,

Installing Tk
# cd /usr/src/ns-allinone-2.30/tk8.4.13/unix/
# ./configure
# make
# make install

Installing OTCL
# cd /usr/src/ns-allinone-2.30/otcl-1.12/
#./configure --with-tcl=/usr/src/ns-allinone-2.30/tcl8.4.13/
# make

you need to Modifiy Makefile: (line 31) INST_OLIBSH= /usr/local/lib
# make install

Installing TCLCL
# cd /usr/src/ns-allinone-2.30/tclcl-1.18/
# ./configure --with-tcl=/usr/src/ns-allinone-2.30/tcl8.4.13/
# make
# make install

Finally, NS2
# cd /usr/src/ns-allinone-2.30/ns-2.30/
# ./configure
# make
# make install
# echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:' > /etc/profile.d/ns.sh
# chmod 0733 /etc/profile.d/ns.sh
# echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:' > /etc/profile.d/ns.sh


But I get errors after writing the "make" for the ns at otcl-1.12
make: *** [libotcl.so] Error 1
at tclcl-1.18
make: *** [install] Error 1
at ns-2.30
make: *** [queue/red.o] Error 1
and at ns-2.30 after "make install"
make: *** [install-ns] Error 1

Would somebody help me on these issues, please? I'm about to install ns-2.30 properly. I bless god I did it, but now i'm trying to install the eurane extension and just can' t:
1) uninstall the previous installation of ns-2.30; it keeps working even if it's folder is erased!! wow!!
2) I can't re-install ns-2.30 properly, neither the patch for eurane.

Thanks a lot. Any contribution will be very welcome
Happy new Year, Merry Christmas and all that stuff

juanka
February 12th, 2012, 11:36 PM
Easier way to keep the compiler versions:
First of all, follo instructions at:
http://nsnam.isi.edu/nsnam/index.php/User_Information#Ubuntu_Installation_Guide
and then, when compiling, you would get error of type "deprecated ... string to char". Very easy. Look for the line of the file where the error happens and cast the error. I mean, substitute this:
p = (char *) “string”
where you see this:

p = “string”


by the way, don't forget to lock the compiler versions anyway or you could get new error if the systems update them.