LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2015, 04:35 AM   #1
newinubuntu
Member
 
Registered: Jan 2015
Location: India
Distribution: Ubuntu, RHEL
Posts: 37

Rep: Reputation: Disabled
[tools/random.o] Error 127 in ns-2.34 + ubuntu 12.04


Due to my project work i need to modify the ns-bgp modules...after modifying the cc file..i used the following command to recompile it..
$make clean
$make
it gives me the following error.

xxx@xxx-Aspire-4820TG:~/ns/ns-allinone-2.34/ns-2.34$ make
g++ -c -Wall -Wno-write-strings -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=no -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -I. -I. -I/home/parag/ns/ns-allinone-2.34/tclcl-1.19 -I/home/parag/ns/ns-allinone-2.34/otcl -I/home/parag/ns/ns-allinone-2.34/include -I/home/parag/ns/ns-allinone-2.34/include -I/home/parag/ns/ns-allinone-2.34/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -o tools/random.o tools/random.cc
make: g++: Command not found
make: *** [tools/random.o] Error 127
 
Old 01-27-2015, 07:04 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
make: g++: Command not found
You will of course have to install the compilers (g++-*).
I.e. you cannot use a command that isn't present on your OS.

Besides that : Don't use g++ . Please use `g++-4.4´.

Ns2 prerequisites : $ sudo apt-get install \
g++ g++-4.4 automake make patch libtool libxmu-dev xgraph

Building ns-allinone-2.34/ + BGP :
$ cd ns-allinone-2.34/
$ patch p0 < otcl_ns234_gcc-4.4.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ patch p0 < bgp_ns234.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install

If you want to reconfigure ns-2.34/ :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./configure
$ make clean && make

-
 
Old 01-29-2015, 12:15 AM   #3
newinubuntu
Member
 
Registered: Jan 2015
Location: India
Distribution: Ubuntu, RHEL
Posts: 37

Original Poster
Rep: Reputation: Disabled
@knudfl
I reconfigure my ns using:
reconfigure ns-2.34/ :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./configure
$ make clean && make

It shows me the following error.

In file included from bgp/Util/ipaddress.cc:21:
bgp/Util/ipaddress.h:89: error: too many decimal points in number
bgp/Util/ipaddress.cc: In member function ‘std::string IPaddress::bin2str(boolVector)’:
bgp/Util/ipaddress.cc:295: error: ‘sprintf’ was not declared in this scope
bgp/Util/ipaddress.cc: In member function ‘std::string IPaddress::val2str()’:
bgp/Util/ipaddress.cc:667: error: ‘sprintf’ was not declared in this scope
bgp/Util/ipaddress.cc: In member function ‘std::string IPaddress::toString()’:
bgp/Util/ipaddress.cc:698: error: ‘sprintf’ was not declared in this scope
make: *** [bgp/Util/ipaddress.o] Error 1
 
Old 01-29-2015, 10:13 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #3 .

Which Ubuntu 12.04 are you using ? i686 or x86_64 ?
This command will show : $ uname -m

Ns2 is for a 32bits OS (i686).
However the most protocols will also work with 64bits.


-
 
Old 01-30-2015, 01:07 AM   #5
newinubuntu
Member
 
Registered: Jan 2015
Location: India
Distribution: Ubuntu, RHEL
Posts: 37

Original Poster
Rep: Reputation: Disabled
ref#4

i686


I m using BGP protocol
 
Old 01-30-2015, 02:59 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
In post #1 you are saying :
Quote:
I need to modify the ns-bgp modules.
.
after modifying the cc file
I guess you can watch your coding errors in post #3 :
Quote:
In file included from bgp/Util/ipaddress.cc:21:
bgp/Util/ipaddress.h:89: error: too many decimal points in number
bgp/Util/ipaddress.cc: In member function ‘std::string IPaddress::bin2str(boolVector)’:
bgp/Util/ipaddress.cc:295: error: ‘sprintf’ was not declared in this scope
 
1 members found this post helpful.
Old 02-01-2015, 08:52 AM   #7
newinubuntu
Member
 
Registered: Jan 2015
Location: India
Distribution: Ubuntu, RHEL
Posts: 37

Original Poster
Rep: Reputation: Disabled
ref#6

I can remove the coding error, but what is this error.
Quote:
make: *** [bgp/Util/ipaddress.o] Error 1
 
Old 02-23-2015, 04:09 AM   #8
krkrajeshkannan
LQ Newbie
 
Registered: Feb 2015
Posts: 7

Rep: Reputation: Disabled
[QUOTE=newinubuntu;5310049]ref#6

make: *** [bgp/Util/ipaddress.o] Error 1

Im trying to patch up bgp on ns2.34 for my project work, i get the same error message. Kindly help if u got any solution please...
 
Old 02-23-2015, 04:31 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← Ref. post #8, @krkrajeshkannan : Welcome to LQ.

Please follow the text in post #2. Cannot fail.

If you have read all posts in the thread,
you will know that your OS must be specified, if you want answers.


Please read
http://www.linuxquestions.org/linux/...Ask_a_Question
http://www.catb.org/~esr/faqs/smart-questions.html


-
 
Old 02-23-2015, 05:11 AM   #10
krkrajeshkannan
LQ Newbie
 
Registered: Feb 2015
Posts: 7

Rep: Reputation: Disabled
Installing nsBGP in Ubuntu 12.4

Sorry sir, i am new to NS & Unix environment

My OS: Ubuntu 12.04 LTS
OS type: 32bit

I have gone through text of 2#, i need some step wise procedure please. I presume these steps, pl correct me..
a) Install Ns2 prerequisites
b) Install Ns2.34 (Procedure that i followed from http://ns2-ubuntu.blogspot.in/2013_03_01_archive.html)
c) Unzip nsBGP downloaded from http://www2.ensc.sfu.ca/~ljilja/cnl/...-2.34-BGP.html
d) Download the patches given in postings #2
e) Apply them and proceed as directed.

In other posting #28 (from http://www.linuxquestions.org/questi...984/page2.html), you were elaborating about bgp-ns-2.34-ubuntu1004_i386.deb; is this one step process for the above?

Pl bear with me if i am wrong.. Thanks in advance..

Last edited by krkrajeshkannan; 02-23-2015 at 05:23 AM.
 
Old 02-23-2015, 05:52 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #10.

? Any particular reason for using the old (and wrong) texts from
http://ns2-ubuntu.blogspot.in/2013_03_01_archive.html
The otcl-1.13/configure edit´s don't work with Ubuntu 12.04 - 32 any more.
Hence the patch otcl_ns234_gcc-4.4.patch : Made up for a reason.

Please use the 2015 updated, and easier / simpler steps from post #2 :
»»»»»»»» Ns2 prerequisites : $ sudo apt-get install \
g++ g++-4.4 automake make patch libtool libxmu-dev xgraph

Building ns-allinone-2.34/ + BGP :
$ cd ns-allinone-2.34/
$ patch -p0 < otcl_ns234_gcc-4.4.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ patch -p0 < bgp_ns234.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install
««««««««
And : $ cd ns-2.34/
$ sudo make install
$ cp ns ns234-bgp
$ sudo cp ns234-bgp /usr/local/bin/
... Then all simulation can be done with $ ns234-bgp file.tcl

And .... you can delete any entries made to .bashrc.
The old ~1999 text is meant for a "University Computer" only.
I.e. when you had no write or install permissions to /usr/.

Don't believe everything on the Internet.
Most ns2 "tutorials" are written by young students,
who are using ns2 and a Linux OS for the first time.
And texts are usually copied from texts written by other students.


-

Last edited by knudfl; 02-28-2015 at 04:17 AM.
 
1 members found this post helpful.
Old 02-24-2015, 12:16 AM   #12
krkrajeshkannan
LQ Newbie
 
Registered: Feb 2015
Posts: 7

Rep: Reputation: Disabled
reference post #11

Sir,
I am ok with the step Ns2 prerequisites.

Have some doubts regarding Building ns-allinone-2.34/ + BGP :

Is my steps correct? Pl correct me if i am wrong..

1) Unzip ns-allinone-2.34.tar.gz (Downloaded from sourceforge.net)
2) Copy downloaded patches (ref#2) otcl_ns234_gcc-4.4.patch and bgp_ns234.patch into ns-allinone-2.34 folder
3) $ patch p0 < otcl_ns234_gcc-4.4.patch
4) $ patch p0 < bgp_ns234.patch
5) $ export CC=gcc-4.4 CXX=g++-4.4 && ./install
6) $ cd ns-2.34/
$ sudo make install
$ cp ns ns234-bgp
$ sudo cp ns234-bgp /usr/local/bin/
Then all simulation can be done with $ ns234-bgp file.tcl

Sir my objective is to implement ns-2.34-BGP-rfd_mrai and study..

For implementing ns-2.34-BGP-rfd_mrai, whether i need to complete the above steps and proceed with the procedure given in http://www2.ensc.sfu.ca/~ljilja/cnl/...-rfd_mrai.html (ref#25 on http://www.linuxquestions.org/questi...984/page2.html)

OR (ref#28 on http://www.linuxquestions.org/questi...984/page2.html) by downloading the package bgp-ns-2.34-ubuntu1004_i386.deb?

Thank you..

Last edited by krkrajeshkannan; 02-24-2015 at 12:33 AM.
 
Old 02-24-2015, 08:38 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #12.

Please "read" the patch, bgp_ns234.patch :
$ grep -n Makefile.in bgp_ns234.patch
... to know that MRAI is present :
12229 ..... bgp/Timing/mraitimer.o bgp/Timing/mraiperpeertimer.o \

And : $ grep -n mrai bgp_ns234.patch

So I think that I included rfd_mrai.
You have : ns-2.34/bgp/{files.cc, .h, Comm/*, Path/*, Timing/*, Util/*}.

The older? "patch package", ns-2.34-bgp-rfd-mrai.tar.gz is with fewer files:
ns-2.34/bgp/{files.cc, .h, Timing/* }.

Suggest : Setup another ns-allinone-2.34/ to check differences.
You can have as many ns-allinone-2.34/ as you want, installed at the same time.
But do not add any *PATH text to .bashrc ( Never required.)


The (6.6 MB) package bgp-ns-2.34-ubuntu1004_i386.deb :
Provides /usr/local/bin/{ ns-bgp, ns-bgp-rfd }.
And is just an easy way for running the simulations,
.. without having to build ns-allinone-2.34 + [bgp, rfd_mrai].


-
 
Old 02-25-2015, 05:27 AM   #14
krkrajeshkannan
LQ Newbie
 
Registered: Feb 2015
Posts: 7

Rep: Reputation: Disabled
patch p0 < otcl_ns234_gcc-4.4.patch

ref#13

Dear Sir,

1) I extracted the ns-allinone-2.34.tar.gz file
2) Copied otcl_ns234_gcc-4.4.patch file into ns-allinone-2.34 folder
3) Executed patch p0 < otcl_ns234_gcc-4.4.patch command, it shows the following error

bsnl@bsnl-HCL-Notebook:~/Desktop/ns-allinone-2.34$ patch p0 < otcl_ns234_gcc-4.4.patch
patching file p0
Hunk #1 FAILED at 13.
1 out of 1 hunk FAILED -- saving rejects to file p0.rej
bsnl@bsnl-HCL-Notebook:~/Desktop/ns-allinone-2.34$
--------------------
p0.ref file contents is as follows...

--- Makefile.in 2009-06-14 19:35:49.000000000 +0200
+++ Makefile.in 2014-09-30 11:31:47.000000000 +0200
@@ -13,7 +13,7 @@
# how to compile, link, and name shared libraries
#

-SHLIB_LD= @SHLIB_LD@
+SHLIB_LD= gcc -shared
SHLIB_CFLAGS= @SHLIB_CFLAGS@
SHLIB_SUFFIX= @SHLIB_SUFFIX@
SHLD_FLAGS= @SHLD_FLAGS@

please advice..
 
Old 02-25-2015, 07:00 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #14.

Ubuntu will often fail with patches.
But luckily it's just about one word in the patch `otcl_ns234_gcc-4.4.patch´.

And you can edit "otcl-1.13/Makefile" line 16, from
SHLIB_LD= @SHLIB_LD@
to :
SHLIB_LD= gcc -shared

... If not already done :
Sometimes "patch" replies with FAILED, when everything has been done OK.


-
 
  


Reply

Tags
bgp, bgp-ns2, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ns-allinone-2.31 make: *** [tools/random.o] Error 127 bilalPolito Linux - Newbie 8 02-05-2015 08:25 AM
Multipath-tools occur an error with Ubuntu server11.10 garasgaras Linux - Server 0 11-15-2011 02:06 AM
Unable to compile C++ programs.make:g++ command not found error.Error 127 PrathuD Programming 3 03-16-2009 12:44 PM
module-init-tools-3.1 error 127 Homer Glemkin Linux - Software 0 11-23-2004 11:11 AM
DSN: Data format error & relay=[127.0.0.1] [127.0.0.1] calmbomb Linux - Software 0 11-07-2004 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration