LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-17-2011, 04:12 AM   #1
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Rep: Reputation: Disabled
Question NS 2 compilation error: make: *** No rule to make target ‘VERSION’, needed by ‘gen/ve


Hi,

I did some changes to the existing aodv.cc, aodv.h, mac.h, channel.cc, mac_802.11.CC, MOBILENODE.C, NOBILENODE.H, /tcl/lib/ns-lib.tc, /tcl/lib/ns-mobilenode.tcl. After compiling my code with make clean and make commonds, got the following error:

make: *** No rule to make target ‘VERSION’, needed by ‘gen/version.c’ . Stop.

I am using ns-2.34 on OpenSuse. The suggested code modification was done based on this document: http://www2.ensc.sfu.ca/~ljilja/ENSC...esentation.pdf
which uses ns-2.32, whereas i made modification to ns-2.34.

The compilation runs for a while, and i end up with the above error.
Can you tell me where i am doing wrong…??



thanks
 
Old 11-18-2011, 02:12 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,929

Rep: Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588
Welcome to LQ.

Quote:
No rule to make target `VERSION', needed by `gen/version.c'
The text in "gen/version.c" asks for a file by name VERSION.
( ns-allinone-2.34/ns-2.34/VERSION , ns-allinone-2.34/nam-1.14/VERSION ).

Two file examples "VERSION" are attached to post # 23 here ..
http://www.linuxquestions.org/questi...612/page2.html

..

Last edited by knudfl; 11-18-2011 at 02:15 PM.
 
1 members found this post helpful.
Old 11-19-2011, 06:30 AM   #3
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
thanks knudfl,

In fact ns-allinone-2.34/ns-2.34/version.txt was there but i just renamed with capital 'VERSION' and the problem was solved. Thanks for the information.
Next i get the following msgg, which i dont know is either some compilation error or not?
-----------------------------------------
The last bits of the compilation output
-----------------------------------------
ltcl8.4 -lXext -lX11 -lnsl -ldl -lm -lm
for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make all; ) done
make[1]: Entering directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/dec'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ marzz/Documents/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/ucb'
marzz@linux-72a5:~/Documents/ns-allinone-2.34/ns-2.34>
--------------------------------------------------------------------

I tried the ns commond which now works fine. After running a basic script, there seems some other errors...which i am figuring out. Hope the compilation is successful and the above msggs are not soem sort of compilation errors.

Thanks once again.
 
Old 11-19-2011, 06:38 AM   #4
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
sorry, the ns commond gives the following error, when i tested after the above compilation:

ns:
[code omitted because of length]
: invalid command name "NNode/MobileNode"
while executing
"NNode/MobileNode instproc reset {} {
$self instvar arptable_ nifs_ netif_ mac_ ifq_ ll_ imep_
for {set i 0} {$i < $nifs_} {incr i} {
$netif_($i) reset..."
marzz@linux-72a5:~/Documents/ns-allinone-2.34/ns-2.34>

Thanks
 
Old 11-20-2011, 12:32 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,929

Rep: Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588
Quote:
I am using ns-2.34 on OpenSuse
Which Suse <version> ? ?
 
1 members found this post helpful.
Old 11-20-2011, 04:42 PM   #6
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Which Suse <version> ? ?
Its OpenSuse 11.1

Last edited by Marz22; 11-20-2011 at 05:01 PM.
 
Old 11-21-2011, 01:42 AM   #7
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Which Suse <version> ? ?
Hi Knudfl,

The problem was infact with the version.
I have now stucked in another problem. i-e after running the ns on a my mrmc.tcl file, i get the following error:

linux-p84p:/usr/local/src/ns-2.34/MRMC-Protocol # ns mrmc.tcl
Wireless Mesh Network in Chain Topologies - 4 Nodes, 3 Channels,
2 Interfaces
num_nodes is set 12

(_o3 cmd line 1)
invoked from within
"_o3 cmd change-numifs 3"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"$ns_ change-numifs $val(nc)"
(file "mrmc.tcl" line 74)

---------------------------------
mrmc.tcl
--------------------------------

# Description: Simulation script for multi-Channel multi-Interface Wireless Mesh Networks
# File: mrmc.tcl
#===============================================================================
#======================================
# MAC Layer Setup
#======================================
Mac/802_11 set dataRate_ 5.4e6 ;# rate for data frames in Mbps
#======================================
# Simulation Parameters Setup
#======================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(rp) AODV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 1000 ;# Y dimension of topography
set val(stop) 70 ;# nam stop time
set val(nn) 4 ;# number of mobilenodes
set val(nc) 3 ;# number of channels
set val(ni) 2 ;# number of interfaces, <= number of channels
set pktsize 1000 ;# packet size in bytes
set pktrate 0.0014 ;# packet rate in seconds
set filename wireless_chain_n$val(nn)_c$val(nc)_i$val(ni)
puts "Wireless Mesh Network in Chain Topologies - $val(nn) Nodes, $val(nc) Channels,
$val(ni) Interfaces"
#======================================
# Initialization
#======================================
# Create a ns simulator
set ns_ [new Simulator]
# Setup topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
set god_ [create-god [expr $val(nn)*$val(nc)]]
# Open the NS trace file
set tracefd [open $filename.tr w]
$ns_ trace-all $tracefd
$ns_ use-newtrace
# Open the NAM trace file
set namfile [open $filename.nam w]
$ns_ namtrace-all $namfile
$ns_ namtrace-all-wireless $namfile $val(x) $val(y)
# Create wireless channels
for {set i 0} {$i < $val(nc)} {incr i} {
set chan($i) [new $val(chan)]
}
#======================================
# Mobile Node Parameter Setup
#======================================
$ns_ node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan(0) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF \
-ifNum $val(ni)
#======================================
# Nodes Definition
#======================================
$ns_ change-numifs $val(nc)
for {set i 0} {$i < $val(nc)} {incr i} {
$ns_ add-channel $i $chan($i)
}
# Create nodes
for {set i 0} {$i < $val(nn)} {incr i} {
set n($i) [$ns_ node]
$god_ new_node $n($i)
}
# Set node positions in horizontal chain topology
set nodedist 250
for {set i 0} {$i < $val(nn)} {incr i} {
$n($i) set X_ [expr $i * $nodedist + 20]
$n($i) set Y_ 50
$n($i) set Z_ 0.0
$ns_ initial_node_pos $n($i) 40
$n($i) random-motion 0
}
#======================================
# Agents Definition
#======================================
set udp0 [new Agent/UDP]
$ns_ attach-agent $n(0) $udp0
set sink0 [new Agent/Null]
set last_node_id [expr $val(nn)-1]
$ns_ attach-agent $n($last_node_id) $sink0
$ns_ connect $udp0 $sink0
#======================================
# Applications Definition
#======================================
# Setup a CBR Application over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ $pktsize
$cbr0 set interval_ $pktrate
$ns_ at 1.0 "$cbr0 start"
$ns_ at 61.0 "$cbr0 stop"
#======================================
# Simulation Termination
#======================================
# Define a finish procedure
proc finish {} {
global ns_ tracefd filename pktsize last_node_id
global namfile
$ns_ flush-trace
close $tracefd
close $namfile
exec nam $filename.nam &
# Call throughput analyzer exec awk -f avgStats.awk src=0 dst=$last_node_id flow=0 pkt=$pktsize $filename.tr &
exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
$ns_ at $val(stop) "\$n($i) reset"
}
$ns_ at $val(stop) "$ns_ nam-end-wireless $val(stop)"
$ns_ at $val(stop) "finish"
$ns_ at $val(stop) "puts \"done\" ; $ns_ halt"
$ns_ run

--------------

Please note: line 74 in the error msg is>>$ns_ change-numifs $val(nc) under the 'node definition'.

ns2.34/tcl/ns-lib.tcl modifications for change-numifs is in the following post.

Last edited by Marz22; 11-22-2011 at 05:16 AM.
 
Old 11-21-2011, 01:56 AM   #8
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
some changes to ns-2.34/tcl/ns-lib.tcl

Added the below four procedure as per the document given in first post.

# MRMC: Procedure to change the number of interfaces
Simulator instproc change-numifs {newnumifs} {
$self instvar numifs_
set numifs_ $newnumifs
}
# MRMC: Procedure to add an interface on a node
Simulator instproc add-channel {indexch ch} {
$self instvar chan
set chan($indexch) $ch
}
# MRMC: Procedure to get the number of interfaces
Simulator instproc get-numifs { } {
$self instvar numifs_
if [info exists numifs_] {
return $numifs_
} else {
return ""
}
}
# Procedure to add multiple interfaces as an argument to node-config label
Simulator instproc ifNum {val} {
$self set numifs_ $val
}

I have defined the above procedures before creating node in ns-lib.tcl.

please help.

Last edited by Marz22; 11-21-2011 at 01:58 AM.
 
Old 11-21-2011, 02:20 AM   #9
Marz22
LQ Newbie
 
Registered: Nov 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Further, note these changes to /tcl/lib/ns-lib.tcl: in procedure.. Simulator instproc create-wireless-node args {

------------------


XXX This should be moved into the node initialization procedure instead
# of standing here in ns-lib.tcl.
Simulator instproc create-wireless-node args {
$self instvar routingAgent_ wiredRouting_ propInstance_ llType_ \
macType_ ifqType_ ifqlen_ phyType_ chan antType_ \
energyModel_ initialEnergy_ txPower_ rxPower_ \
idlePower_ sleepPower_ sleepTime_ transitionPower_ transitionTime_ \
topoInstance_ level1_ level2_ inerrProc_ outerrProc_ FECProc_ \
numifs_

.............

............

#################################################################
## Second Change Starts here
#################################################################

# MRMC: Add main node interface
if {[info exists numifs_]} {
for {set i 0} {$i < $numifs_} {incr i} {
# Add one interface per channel
#puts "chan $i: $chan($i)"
$node add-interface $chan($i) $propInstance_ $llType_ $macType_ \
$ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ \
$inerrProc_ $outerrProc_ $FECProc_
}
} else {
$node add-interface $chan $propInstance_ $llType_ $macType_ \
$ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ \
$inerrProc_ $outerrProc_ $FECProc_

###################################################################
## Second Change Ends here
###################################################################

........
........

Last edited by Marz22; 11-21-2011 at 02:22 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
NS2 installation problem: no rule to make target 'VERSION' , needed by gen/version.c bilabongster Linux - Newbie 23 12-07-2011 11:54 AM
No rule to make target `VERSION', needed by `gen/version.c' Salahedin Linux - Software 3 04-08-2011 06:34 AM
No rule to make target `VERSION', needed by `gen/version.c' Salahedin Linux - Networking 2 04-07-2011 02:49 PM


All times are GMT -5. The time now is 04:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration