LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-11-2012, 06:36 PM   #1
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Rep: Reputation: Disabled
make command gives errror message


This is my first question.
i made certain changes in the files (.cc , .h ) in ns2 .
After that i typed configure command in the terminal(in the ns2 main folder).


Code:
./configure

and then the make command

Code:
./make
got the following error message

"No such file or directory"

when typed like this,

Code:
make
got error message as

"Makefile:332:*** commands commence before first target.Stop.

plz it's urgent.help me!

Last edited by revathhy; 02-05-2012 at 07:33 AM.
 
Old 01-12-2012, 01:32 AM   #2
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
Did the configure return any error ?
Did you modify the makefile ?
 
1 members found this post helpful.
Old 01-12-2012, 02:14 AM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Quote:
Originally Posted by revathhy
./configure
Correct


Quote:
Originally Posted by revathhy
and then the make command

./make
Incorrect

The make command is a system-installed application like "ls" or "mkdir" or "diff." You do not execute it with the leading "./" because make will be found in your PATH.

You only use a leading "./" when you try to run something from your current directory.


Quote:
got error message as

"Makefile:332:*** commands commence before first target.Stop
This means that your Makefile has commands (i.e. lines beginning with a tab) before you declare a make target. Any command lines must be associated with a target. If you do not know what a target is, then you need to review the make documentation.

Specifically, the error seems to tell you that line 332 of the Makefile is the first occurrence of the pre-target command. Open the Makefile and look at line 332.

Last edited by Dark_Helmet; 01-12-2012 at 02:18 AM.
 
2 members found this post helpful.
Old 01-12-2012, 04:56 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
I think, the error can happen some times with an edited Makefile / Makefile.in
where an unnecessary <space> is added after the back slashes ( \ )
The example is an ns-2.34 Makefile :
Code:
164	OBJ_CC = \
.
.
331		apps/pbc.o \
332		new0.o new1.o new2.o \ <space>
333		$(OBJ_STL)
Remove the space(s), and the Makefile should be OK.

.

Last edited by knudfl; 01-12-2012 at 04:57 AM.
 
2 members found this post helpful.
Old 01-12-2012, 09:39 AM   #5
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks for the replies. now the make command works . but again i get the following error


Code:
In file included from common/packet.h:48,
                 from common/packet.cc:40:
common/ns-process.h:94: error: syntax error before `,' token
common/ns-process.h:107: error: field `type_' has incomplete type
common/ns-process.h: In constructor `AppData::AppData(AppDataType)':
common/ns-process.h:109: error: `type' has incomplete type
common/ns-process.h:60: error: forward declaration of `enum AppDataType'
common/ns-process.h:109: error: `type_' undeclared (first use this function)
common/ns-process.h:109: error: (Each undeclared identifier is reported only
   once for each function it appears in.)
common/ns-process.h: In constructor `AppData::AppData(AppDataType)':
common/ns-process.h:109: error: `type' has incomplete type
common/ns-process.h:60: error: forward declaration of `enum AppDataType'
common/ns-process.h: In constructor `AppData::AppData(AppDataType)':
common/ns-process.h:109: error: `type' has incomplete type
common/ns-process.h:60: error: forward declaration of `enum AppDataType'
common/ns-process.h: In copy constructor `AppData::AppData(AppData&)':
common/ns-process.h:110: error: 'class AppData' has no member named 'type_'
common/ns-process.h: In member function `AppDataType AppData::type() const':
common/ns-process.h:113: error: return type `enum AppDataType' is incomplete
In file included from common/packet.cc:40:
common/packet.h: At global scope:
common/packet.h:176: error: syntax error before `,' token
common/packet.h: In member function `const char* p_info::name(packet_t) const':
common/packet.h:273: error: `p' has incomplete type
common/packet.h:77: error: forward declaration of `enum packet_t'
common/packet.h: In static member function `static bool
   p_info::data_packet(packet_t)':
common/packet.h:277: error: `type' has incomplete type
common/packet.h:77: error: forward declaration of `enum packet_t'
common/packet.h:278: error: conversion to incomplete type
common/packet.h: In constructor `PacketData::PacketData(int)':
common/packet.h:311: error: no matching function for call to `AppData::AppData(
   int)'
common/ns-process.h:110: error: candidates are: AppData::AppData(AppData&)
common/ns-process.h:109: error:                 AppData::AppData(AppDataType)
common/packet.h: At global scope:
common/packet.h:458: error: field `ptype_' has incomplete type
common/packet.h: In member function `packet_t& hdr_cmn::ptype()':
common/packet.h:507: error: `ptype_' undeclared (first use this function)
common/packet.cc: In member function `virtual void
   CommonHeaderClass::export_offsets()':
common/packet.cc:119: error: 'struct hdr_cmn' has no member named 'ptype_'
make: *** [common/packet.o] Error 1
How can i rectify this...

Last edited by revathhy; 02-04-2012 at 09:03 PM.
 
Old 01-12-2012, 09: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
Which version of ns-allinone-2.xx are you working with ? ?


And which Linux OS ? Like CentOS5, Fedora 16, Ubuntu 10.04.
http://www.linuxquestions.org/linux/...Ask_a_Question
http://linuxsilo.net/docs/smart-questions_en.html
 
1 members found this post helpful.
Old 01-12-2012, 07:00 PM   #7
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
i am working with ns-allinone-2.29 and fedora2 .now make command works fine. i have patched ns2 with mannasim patch . i have followed the steps given in mannasim homepage.

http://www.mannasim.dcc.ufmg.br

http://www.mannasim.dcc.ufmg.br/download.htm

but the sample tcl examples given in that website are giving error message.

i got this error when i executed the tcl code given for hierarchial network at the bottom of that webpage


Code:
INITIALIZE THE LIST xListHead
invalid command name "EnergyModel/BATTERY"
    while executing
"EnergyModel/BATTERY create _o33 _o15 100.0 0.5 0.2"
    invoked from within
"catch "$className create $o $args" msg"
    invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
    (procedure "new" line 3)
    invoked from within
"new $energyModel_ $node  $initialEnergy_ $l1 $l2"
    invoked from within
"if [info exists energyModel_] {
if  [info exists level1_] {
set l1 $level1_
} else {
set l1 0.5
}
if  [info exists level2_] {
set l2 $level2_
} else {..."
    (procedure "_o3" line 98)
    (Simulator create-wireless-node line 98)
    invoked from within
"_o3 create-wireless-node"
    ("eval" body line 1)
    invoked from within
"eval $self create-wireless-node $args"
    (procedure "_o3" line 14)
    (Simulator node line 14)
    invoked from within
"$ns_ node"
    (procedure "create_sink" line 8)
    invoked from within
"create_sink"
    (file "mannasim-rede-hierarquica.tcl" line 351)

Last edited by revathhy; 02-04-2012 at 09:02 PM.
 
Old 01-13-2012, 01:39 AM   #8
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
An answer to your post # 187 here
http://www.linuxquestions.org/questi...ml#post4573210
Please do not use another members thread for an off topic question.
Use your own thread instead.
That thread is about this LEACH in ns-2.34 only :
http://www.linuxquestions.org/questi...34-a-870368/#5

Fedora 2 is ancient. Unsupported, dead for about 6 years.
( But may work.)
Quote:
If i have to install ns2.34 , have i to uninstall ns2.29.
No. You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. Just do not add any of them to a *PATH.

The mannasim patch is for ns-allinone-2.29 version 3. ( Not ns-2.34 ).
ns-allinone-2.29.3.tar.gz http://sourceforge.net/projects/nsna...ar.gz/download
cd ns-allinone-2.29/ && zcat mannasim-patch-ns2.29.tar.gz | patch -p1
&& ./install ( Usually the g++34 compiler is used for ns-2.29 ).

......

The above post # 7 :
Copy the file mannasim-rede-hierarquica.tcl to ns-allinone-2.29/ns-2.29/ , and ...
cd ns-allinone-2.29/ns-2.29/ && ./ns mannasim-rede-hierarquica.tcl :
Code:
[knudfl@localhost ns-2.29]$ ./ns mannasim-rede-hierarquica.tcl
num_nodes is set 14
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
Node 10 - Temperature Data 24.322831 - Time 9.153541
Node 11 - Temperature Data 25.043827 - Time 9.182337
Node 04 - Temperature Data 27.431498 - Time 9.230162
Node 06 - Temperature Data 25.308177 - Time 9.418064
Node 05 - Temperature Data 23.035929 - Time 9.629627
Node 13 - Temperature Data 26.608114 - Time 9.630934
Node 07 - Temperature Data 25.228390 - Time 9.655668
Node 09 - Temperature Data 26.208888 - Time 9.730951
Node 12 - Temperature Data 24.730716 - Time 9.732257
Node 08 - Temperature Data 25.663836 - Time 9.832123
Common Node 10 - Disseminating data -  Time 11.154 - Destination node 2
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 129.1
SORTING LISTS ...DONE!
Cluster Head Node 2 - Received message - Time 11.158 - Source Node 10!
Common Node 11 - Disseminating data -  Time 11.182 - Destination node 3
Cluster Head Node 3 - Received message - Time 11.187 - Source Node 11!
Common Node 4 - Disseminating data -  Time 11.230 - Destination node 2
Cluster Head Node 2 - Received message - Time 11.234 - Source Node 4!
Common Node 6 - Disseminating data -  Time 11.418 - Destination node 3
Cluster Head Node 3 - Received message - Time 11.422 - Source Node 6!
Common Node 5 - Disseminating data -  Time 11.630 - Destination node 3
Common Node 13 - Disseminating data -  Time 11.631 - Destination node 2
Cluster Head Node 3 - Received message - Time 11.635 - Source Node 5!
Cluster Head Node 2 - Received message - Time 11.639 - Source Node 13!
Common Node 7 - Disseminating data -  Time 11.656 - Destination node 2
Cluster Head Node 2 - Received message - Time 11.660 - Source Node 7!
Common Node 9 - Disseminating data -  Time 11.731 - Destination node 2
Common Node 12 - Disseminating data -  Time 11.732 - Destination node 3
Cluster Head Node 2 - Received message - Time 11.735 - Source Node 9!
Cluster Head Node 3 - Received message - Time 11.740 - Source Node 12!
Common Node 8 - Disseminating data -  Time 11.832 - Destination node 2
Cluster Head Node 2 - Received message - Time 11.836 - Source Node 8!
Node 10 - Temperature Data 24.308915 - Time 12.153541
Node 11 - Temperature Data 25.157340 - Time 12.182337
Node 04 - Temperature Data 23.518178 - Time 12.230162
Node 06 - Temperature Data 25.148741 - Time 12.418064
Node 05 - Temperature Data 23.996935 - Time 12.629627
Node 13 - Temperature Data 25.215901 - Time 12.630934
Node 07 - Temperature Data 26.363497 - Time 12.655668
Node 09 - Temperature Data 25.182589 - Time 12.730951
Node 12 - Temperature Data 24.574205 - Time 12.732257
Node 08 - Temperature Data 23.918326 - Time 12.832123
Cluster Head Node 3 - Disseminating Data - Destination Node 1 - Time 13.026
Access point - Received a message with 4 elements
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Cluster Head Node 2 - Disseminating Data - Destination Node 1 - Time 13.545
Access point - Received a message with 6 elements
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
NS EXITING...
... And the trace file 'mannasim-rede-hierarquica.tr' is created.

.

Last edited by knudfl; 01-13-2012 at 07:54 AM.
 
Old 02-04-2012, 04:21 AM   #9
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
how to remove ns-allinone from PATH

Quote:
No. You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. Just do not add any of them to a *PATH.
i have ns-allinone-2.28 on the *PATH . how to remove it from *PATH.

thanks in advance.
 
Old 02-04-2012, 05:02 AM   #10
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:
I have ns-allinone-2.28 on the *PATH . How to remove it from *PATH.
Probably delete the added text about the ns-allinone *PATH's
in /home/<name>/.bashrc

( .bashrc is a hidden file.)
 
Old 02-04-2012, 09:10 AM   #11
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
How to open .bashrc file

How to go to .bashrc file.

when i typed

Code:
vi ~/.bashrc
in the terminal ,it was like this


Code:
# .bashrc
                                                                                
# User specific aliases and functions
                                                                                
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
~
~
~
~
~
~
~
~
~
~
~
"~/.bashrc" 12L, 188C                                         1,2           All
is this .bashrc file?
 
Old 02-04-2012, 10:47 AM   #12
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
OK then.

? What do you men by ""I have ns-allinone-2.28 on the *PATH"" ? ?



( ns works with no PATH settings : Is hard coded to find
it's libraries.)

.
 
Old 02-05-2012, 07:32 AM   #13
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
? What do you men by ""I have ns-allinone-2.28 on the *PATH"" ? ?
when i type

Code:
echo $PATH
i get the following as output

Code:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/root/Desktop/ns-allinone-2.28/bin:/root/Desktop/ns-allinone-2.28/tcl8.4.5/unix:/root/Desktop/ns-allinone-2.28/tk8.4.5/unix
whenever i login, i add ns-allinone-2.29 to the PATH using

Code:
export PATH=<PATH>:/root/Desktop/ns-allinone-2.29/bin:/root/Desktop/ns-allinone-2.29/tcl8.4.11/unix:/root/Desktop/ns-allinone-2.29/tk8.4.11/unix
So how to remove ns-allinone-2.28 from PATH .how to add ns-allinone-2.29 permanently to PATH .
 
Old 02-05-2012, 07:44 AM   #14
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
Please check '/root/.bashrc' for "ns-2.28 text" and delete it.

? And may the same for /etc/bashrc ?

And please never run any ns commands as root.
The default ns2 build location is /home/<user-name/<folder>/ ,
so all commands etc. can be done as unprivileged user.
Do not log in as root, and do not use /root/Desktop/ for anything.

"root" is for administrative tasks only, not development.


Installing ns (2.29) to a system path :
cd ns-allinone-2.29/ns-2.29/ ; su ; make install && exit
( 'make install' will copy ns to /usr/local/bin/ ).

.
 
1 members found this post helpful.
Old 02-08-2012, 07:09 AM   #15
revathhy
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks knudl . Thanks a lot.

I found the "ns-2.28 text" in .bash_profile , deleted it. Also added ns-2.29 to the system path .
Now the mannasim-rede-hierarquica.tcl works fine.
 
  


Reply

Tags
mannasim, 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
make: CC: Command not found make: *** [main.o] Error 127 on opensuse 11.3 Leo89 Linux - Newbie 6 11-30-2012 05:13 PM
Can't build RRDTool on RHEL4 - 'make' command give error message Dialkia Linux - Newbie 3 03-22-2010 04:33 AM
glibc 2.5.1 errror @d4M Linux From Scratch 2 01-18-2009 12:06 AM
neat command not working azx_get_response timeout message in /var/log/message ninadshaha Red Hat 1 02-19-2008 02:32 PM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 07:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:25 PM.

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