LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-23-2015, 06:14 PM   #1
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Rep: Reputation: Disabled
protolib


hi
i want to work with ns2 and i want use java code,then i must use AGENTJ.my question is that may i install protolib for installation AGENTJ?
thanks
 
Old 02-24-2015, 12:14 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Welcome to LQ.

Agentj is (also) "agentj-1.1.jar"
http://trianacode.org/maven/agentj/agentj/1.1/
I don't think you have to build a new "agentj-1.1.jar".

`agentj-1.1.jar´ should run with $ java -jar agentj-1.1.jar
( No luck here today, using java-1.7.0-sun (The latest Oracle java7).)

Protolib :
There is an `ns-allinone-2.35´ patched with protolib here
https://github.com/mohaslan/nsj
Can be downloaded with $ git clone https://github.com/mohaslan/nsj

-
 
1 members found this post helpful.
Old 02-24-2015, 01:04 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Ref. #2.

You will actually get a new agenj**jar, with "nsj" :
nsj/ns-2.35/agentj/core/target/agentj-core-1.1.jar

A build test :
$ cd nsj/
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install
... No issues, if you have all the "java libraries"
.. in a known LD_LIBRARY_PATH.
 
1 members found this post helpful.
Old 02-24-2015, 05:46 PM   #4
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Dear knudfl
i istall ns2.34 and my code is java.i must install AGENTJ and i read AgentJ Java Network Simulations in NS-2.pdf it have this instruction:
Chapter 2
Installing the AgentJ Toolkit
This chapter describes the installation of AgentJ toolkit and is divided into two sections.
The rst describes how to install the native implementation of AgentJ into NS-2, which
involves several stages and modi cation to the Ns-2 make le, and the second involves the
somewhat simpler installation of the Java code.
2.1 Installing the C++ Code
AgentJ has two dependencies, which have to be downloaded and installed rst before
AgentJ can be added. These are:
1. Ns-2: Full instructions for downloading and installation of ns-2.34 can be found at
the project's Web site at http://www.isi.edu/nsnam/ns/ or type \ns-2" into Google
and hit \I'm Feeling Lucky".
2. Protolib: can be downloaded and installed from
http://cs.itd.nrl.navy.mil/work/protolib/ or again \protolib" and \I'm Feeling
Lucky" in Google will also do the trick.
.
.
.
but i cant find anything to install protolib?if you can explain it for me step by step like installation of NS-2 with all installation detail,please help me. i really need that.
 
Old 02-25-2015, 05:34 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
← ref. #4.
Quote:
I read AgentJ Java Network Simulations in NS-2.pdf
Please show the link to the PDF, just for the sake of completeness.
( I already know the text you refer, from elsewhere.)


All your text in post #4 :
That's what you get with $ git clone https://github.com/mohaslan/nsj
→ An ´ns-allinone-2.35´ patched with protolib and agentj.
→ → See post #3 : $ export CC=gcc-4.4 CXX=g++-4.4 && ./install
... will build ns2 with protolib, and {ns-2.35/agentj/core/lib/libagentj.so}, etc.

Please don't do things in an old / outdated / over-complicated way.
Unless you are looking for trouble.
The author of "nsj" already packed up all what's required ...
https://github.com/mohaslan/nsj
... to make the build of everything very easy.

? Any questions ? Then please specify your OS :
a) Please show the output from this command : $ uname -m
b) OS name and version.

-
 
1 members found this post helpful.
Old 03-05-2015, 04:00 AM   #6
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
tank you but after $ git clone https://github.com/mohaslan/nsj i have this:
"The program 'git' is currently not installed. You can install it by typing:
sudo apt-get install git"

then i "type sudo apt-get install git"
i have follow text and errors:

"Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
git-email git-gui gitk gitweb
The following NEW packages will be installed:
git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 767 not upgraded.
Need to get 6,644 kB of archives.
After this operation, 15.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://ir.archive.ubuntu.com/ubuntu/ precise/main liberror-perl all 0.17-1
Something wicked happened resolving 'ir.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Err http://ir.archive.ubuntu.com/ubuntu/ precise-updates/main git-man all 1:1.7.9.5-1ubuntu0.1
Something wicked happened resolving 'ir.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Err http://security.ubuntu.com/ubuntu/ precise-security/main git-man all 1:1.7.9.5-1ubuntu0.1
Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
Err http://security.ubuntu.com/ubuntu/ precise-security/main git i386 1:1.7.9.5-1ubuntu0.1
Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
Failed to fetch http://ir.archive.ubuntu.com/ubuntu/...0.17-1_all.deb Something wicked happened resolving 'ir.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Failed to fetch http://security.ubuntu.com/ubuntu/po...ntu0.1_all.deb Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
Failed to fetch http://security.ubuntu.com/ubuntu/po...tu0.1_i386.deb Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

WHAT should do i do now?
thanks alot
 
Old 03-05-2015, 05:14 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
ref. #6.
Quote:
No address associated with hostname
You will have to switch "Server".

Synaptic > Settings >> Repositories : Choose country / link.

I'd suggest Finland >>> funet http://mirrors.nic.funet.fi/ubuntu
Or Ireland >>> heanet. Or a local one that works.

Can also be done manually :
$ sudo gedit /etc/apt/sources.list
... and then edit the lines in use, to the new URL.


-

Last edited by knudfl; 03-05-2015 at 05:16 AM.
 
1 members found this post helpful.
Old 03-05-2015, 12:01 PM   #8
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
i do your istruction(Synaptic > Settings >> Repositories : Choose country / link.) and i have:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

now what do i do???
 
Old 03-05-2015, 01:38 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Quote:
Unable to lock ..... (/var/lib/dpkg/)
You can stop the other process :
Find the process number with $ top
And stop the process with $ sudo kill <process-number>.

You can also change configuration,
to stop the automatic update attempts.
Probably look into the Ubuntu documentation, to know how to do it.

-
 
1 members found this post helpful.
Old 03-06-2015, 12:31 PM   #10
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by knudfl View Post
← ref. #4.

Please show the link to the PDF, just for the sake of completeness.
( I already know the text you refer, from elsewhere.)


All your text in post #4 :
That's what you get with $ git clone https://github.com/mohaslan/nsj
→ An ´ns-allinone-2.35´ patched with protolib and agentj.
→ → See post #3 : $ export CC=gcc-4.4 CXX=g++-4.4 && ./install
... will build ns2 with protolib, and {ns-2.35/agentj/core/lib/libagentj.so}, etc.

Please don't do things in an old / outdated / over-complicated way.
Unless you are looking for trouble.
The author of "nsj" already packed up all what's required ...
https://github.com/mohaslan/nsj
... to make the build of everything very easy.

? Any questions ? Then please specify your OS :
a) Please show the output from this command : $ uname -m
b) OS name and version.

-
i do your instruction.and i successed but now after install ns2.35,ns dont make:
agentj/core/src/main/c/agentj/AgentjVirtualMachine.h:11: fatal error: jni.h: No such file or directory
compilation terminated.
make: *** [agentj/core/src/main/c/agentj/AgentjVirtualMachine.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
now what do i do now?
i really thank you for your best step by step helping.
 
Old 03-06-2015, 01:27 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
ref. post #10.

Please do not quote entire posts. A one word reference will do.


Quote:
jni.h: No such file
This is what I did : Copied the java headers to /usr/local/include:
{jawt.h, jawt_md.h, jdwpTransport.h jni.h, jni_md.h, jvmticmlr.h, jvmti.h}.
And libjvm.so to /usr/local/lib/libjvm.so ( Also required.)
That's a cheat to avoid exporting the <path to actual location>.
* The above files all come with the `Oracle java 7'.

Example :
java-1.7.0*/include/{ jawt.h, jdwpTransport.h, jni.h, jvmticmlr.h, jvmti.h }
java-1.7.0*/include/linux/{ jawt_md.h, jni_md.h }
java-1.7.0*/jre/lib/i386/client/libjvm.so


-

Last edited by knudfl; 03-06-2015 at 01:30 PM.
 
1 members found this post helpful.
Old 03-08-2015, 03:10 PM   #12
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
ref. post #10.

Copied the java headers to /usr/local/include:



-
excuse me but i confused! how i get that headers?with download oracle java 7?and i must copy them to which address?
may i install oracle 7?why?

Last edited by samankarami; 03-08-2015 at 04:21 PM.
 
Old 03-08-2015, 05:19 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Installing Java7 :

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer
... and hit <Enter> for 'OK', and 'Yes' when asked about License.
( Ref. https://www.digitalocean.com/communi...u-with-apt-get )

Testing the install : $ java -version
And the reply should be :
java version "1.7.0_76"
Java(TM) SE Runtime Environment ( .... )

The install location is /usr/lib/jvm/java-7-oracle/
Headers : /usr/lib/jvm/java-7-oracle/include/
... and /usr/lib/jvm/java-7-oracle/include/linux/
`libjvm.so' : /usr/lib/jvm/java-7-oracle/jre/lib/i386/client/libjvm.so

-

Last edited by knudfl; 03-08-2015 at 05:20 PM.
 
1 members found this post helpful.
Old 03-08-2015, 06:44 PM   #14
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
[QUOTE=.


$ sudo apt-get install oracle-java6-installer
... and hit <Enter> for 'OK', and 'Yes' when asked about License.


-[/QUOTE]

i have problem with install processing:
download failed
Oracle JDK 6 is NOT installed.
dpkg: error processing oracle-java6-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up gsfonts-x11 (0.22) ...
Errors were encountered while processing:
oracle-java6-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
what is solution now?
thank you

Last edited by samankarami; 03-08-2015 at 06:46 PM.
 
Old 03-22-2015, 12:21 PM   #15
samankarami
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Installing Java7 :


The install location is /usr/lib/jvm/java-7-oracle/
Headers : /usr/lib/jvm/java-7-oracle/include/
... and /usr/lib/jvm/java-7-oracle/include/linux/
`libjvm.so' : /usr/lib/jvm/java-7-oracle/jre/lib/i386/client/libjvm.so

-
please answer this question.i install jdk7
now how i copy headers to that direction? please type commands for me?
i really need that.
 
  


Reply

Tags
agentj, ns2, protolib


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
protolib installation problem bluetooth Linux - Newbie 1 02-28-2011 09:08 AM

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

All times are GMT -5. The time now is 03:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration