HOWTO get ns-3 running on Mac OS X Lion (10.7 Intel)

1,474 views
Skip to first unread message

Nicholas Loulloudes

unread,
Sep 4, 2011, 12:16:33 PM9/4/11
to ns-3-...@googlegroups.com
1) Install XCode

You will find XCode in the App Store. Alternatively, you can download the most recent version of XCode from the Apple Developer Connection website (http://developer.apple.com/mac/). The XCode development environment includes the gcc compiler and critical libraries required to build applications to be run in Mac OS X. Mac OS X Lion, requires XCode 4.1+.

2) Install MacPorts

2.1) Download MacPorts package installer for Lion release version 2.02 from https://distfiles.macports.org/MacPorts/MacPorts-2.0.2-10.7-Lion.dmg

2.2) Click on the downloaded "pkg" file, to install MacPorts.

2.3) This will place a fully-functioning MacPorts installation on your system

3) Install Required packages for ns-3

3.1) Open a Terminal window and run each command to install the required package

3.2) Install Mercurial and Python:

>> sudo port install mercurial python26

3.3) Install Bzr

>> sudo port install bzr

3.4) Install LibXML

>> sudo port install libxml2

3.5) Install GDB

>> sudo port install gdbm

4) Download ns3 source code

>> hg clone http://code.nsnam.org/ns-3-allinone

>> cd ns-3-allinone

>> ./download.py

5) Build the local repository

>> ./build.py

6) Test the installation

>> cd ns-3-dev

>> ./test.py

Tien Viet Nguyen [K53]

unread,
Sep 4, 2011, 11:28:27 PM9/4/11
to ns-3-...@googlegroups.com
hey everybody, i've a problem when i install ns3. i downloaded ns3 and installed it via link http://wirelesscafe.wordpress.com/2011/01/15/how-to-install-ns3-on-linux/. But when i bult successfully, it showed a error as:

viet@viet:~/ns-allinone-3.12/ns-3.12$ ./test.py
Waf: Entering directory `/home/viet/ns-allinone-3.12/ns-3.12/build'
Waf: Leaving directory `/home/viet/ns-allinone-3.12/ns-3.12/build'
'build' finished successfully (4.089s)

Modules built:
aodv                      applications              bridge                   
config-store              core                      csma                     
csma-layout               dsdv                      emu                      
energy                    flow-monitor              internet                 
lte                       mesh                      mobility                 
mpi                       netanim                   network                  
nix-vector-routing        ns3tcp                    ns3wifi                  
olsr                      point-to-point            point-to-point-layout    
propagation               spectrum                  stats                    
tap-bridge                template                  test                     
tools                     topology-read             uan                      
virtual-net-device        visualizer                wifi                     
wimax                    

Modules not built:
click                     openflow                 

0 of 0 tests passed (0 passed, 0 skipped, 0 failed, 0 crashed, 0 valgrind errors)

***  Note: ns-3 tests are currently disabled. Enable them by adding
***  "--enable-tests" to ./waf configure or modifying your .ns3rc file.

***  Note: ns-3 examples are currently disabled. Enable them by adding
***  "--enable-examples" to ./waf configure or modifying your .ns3rc file.

now what do i have to do?
thanks so much!

-- Viet Nguyen Tien --
-HUST-Hanoi University of Science and Technology
-SET-School of Electronics and Telecommunication
GoGreen Club - InD (Infomation and Design) Group.
Gmail: tienvietn...@gmail.com
Y!M: tienvietn...@yahoo.com.vn
Skype: tienvietnguyen1110
Mobile: 01689924896 /01642669018
Birth: 10-11

     Viet Tien
      -Htpro!-
-httvhutceoscop-



--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/xGcrYLrykoMJ.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Michael W.S. Yee

unread,
Sep 4, 2011, 11:53:02 PM9/4/11
to ns-3-...@googlegroups.com
hi, Tien. u can enable the test by running the command "./waf configure --enable-test --enable-examples" in the directory ns-3-dev. then run "./waf " to build  ns-3. Once done, try to run "test.py" again. 
Regards,
Michael W.S. Yee



Tien Viet Nguyen [K53]

unread,
Sep 5, 2011, 12:30:10 AM9/5/11
to ns-3-...@googlegroups.com
i don't find the directory ns-3-dev as you said. Can you get me its path? Thanks so much!

-- Viet Nguyen Tien --
-HUST-Hanoi University of Science and Technology
-SET-School of Electronics and Telecommunication
GoGreen Club - InD (Infomation and Design) Group.
Gmail: tienvietn...@gmail.com
Y!M: tienvietn...@yahoo.com.vn
Skype: tienvietnguyen1110
Mobile: 01689924896 /01642669018
Birth: 10-11

     Viet Tien
      -Htpro!-
-httvhutceoscop-



--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.

Viet Nguyen Tien [K53]

unread,
Sep 5, 2011, 12:34:30 AM9/5/11
to ns-3-...@googlegroups.com
can you give me...

-- Viet Nguyen Tien --
-HUST-Hanoi University of Science and Technology
-SET-School of Electronics and Telecommunication
GoGreen Club - InD (Infomation and Design) Group.
Gmail: tienvietn...@gmail.com
Y!M: tienvietn...@yahoo.com.vn
Skype: tienvietnguyen1110
Mobile: 01689924896 /01642669018
Birth: 10-11

     Viet Tien
      -Htpro!-
-httvhutceoscop-



Michael W.S. Yee

unread,
Sep 5, 2011, 12:36:29 AM9/5/11
to ns-3-...@googlegroups.com
it's the directory where i run "test.py", if u use the latest release version, then the directory name should be ns-3.12.
Regards,
Michael W.S. Yee

Viet Nguyen Tien [K53]

unread,
Sep 5, 2011, 1:08:51 AM9/5/11
to ns-3-...@googlegroups.com
thank you so much!. I done and i received result as above link. This my result:

viet@viet:~/ns-allinone-3.12/ns-3.12$ ./waf --run myfirst
Waf: Entering directory `/home/viet/ns-allinone-3.12/ns-3.12/build'
Waf: Leaving directory `/home/viet/ns-allinone-3.12/ns-3.12/build'
'build' finished successfully (1.740s)
Sent 1024 bytes to 10.1.1.2
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.1.2

but i don't still understand when i type command "./waf", it show as: 

Waf: Leaving directory `/home/viet/ns-allinone-3.12/ns-3.12/build'
'build' finished successfully (4m34.499s)

Modules built:
aodv                      applications              bridge                   
config-store              core                      csma                     
csma-layout               dsdv                      emu                      
energy                    flow-monitor              internet                 
lte                       mesh                      mobility                 
mpi                       netanim                   network                  
nix-vector-routing        ns3tcp                    ns3wifi                  
olsr                      point-to-point            point-to-point-layout    
propagation               spectrum                  stats                    
tap-bridge                template                  test                     
tools                     topology-read             uan                      
virtual-net-device        visualizer                wifi                     
wimax                    

Modules not built:
click                     openflow        


why don't module openflow build? 
-- Viet Nguyen Tien --
-HUST-Hanoi University of Science and Technology
-SET-School of Electronics and Telecommunication
GoGreen Club - InD (Infomation and Design) Group.
Gmail: tienvietn...@gmail.com
Y!M: tienvietn...@yahoo.com.vn
Skype: tienvietnguyen1110
Mobile: 01689924896 /01642669018
Birth: 10-11

     Viet Tien
      -Htpro!-
-httvhutceoscop-



Michael W.S. Yee

unread,
Sep 5, 2011, 1:28:46 AM9/5/11
to ns-3-...@googlegroups.com
because it's not a necessary module of ns-3, if u need to use OpenFlow switches, u can see how to enable and install it in the file ns-3.12/src/openflow/doc/openflow-swithch.rst.

伟伟

unread,
Sep 5, 2011, 8:29:54 AM9/5/11
to ns-3-...@googlegroups.com
can u show me the packages you have installed? the output of mine is this:
Modules built:
aodv                      applications              bridge                   
config-store              core                      csma                     
csma-layout               dsdv                      energy                   
flow-monitor              internet                  lte                      
mesh                      mobility                  mpi                      
netanim                   network                   nix-vector-routing       
ns3tcp                    ns3wifi                   olsr                     
point-to-point            point-to-point-layout     propagation              
spectrum                  stats                     template                 
test                      tools                     topology-read            
uan                       virtual-net-device        visualizer               
wifi                      wimax                    

Modules not built:
click                     emu                       openflow                 
tap-bridge     
why is the emu and tap-bridge is not built?
---==Steve @ MBP==---



2011/9/5 Michael W.S. Yee <hcysm...@gmail.com>

Tom Henderson

unread,
Sep 5, 2011, 10:20:17 AM9/5/11
to ns-3-...@googlegroups.com
On 09/05/2011 05:29 AM, 伟伟 wrote:
> can u show me the packages you have installed? the output of mine is this:
> Modules built:
> aodv applications bridge
> config-store core csma
> csma-layout dsdv energy
> flow-monitor internet lte
> mesh mobility mpi
> netanim network nix-vector-routing
> ns3tcp ns3wifi olsr
> point-to-point point-to-point-layout propagation
> spectrum stats template
> test tools topology-read
> uan virtual-net-device visualizer
> wifi wimax
>
> Modules not built:
> click emu openflow
> tap-bridge
> why is the emu and tap-bridge is not built?

They are not compatible with OS X, so they are disabled automatically by
waf. It may be possible to get those modules working with OS X but I
don't know if anyone has tried to make such changes.

Viet Nguyen Tien [K53]

unread,
Sep 5, 2011, 10:26:08 PM9/5/11
to ns-3-...@googlegroups.com
ok. thank Michael. i tested.

-- Viet Nguyen Tien --
-HUST-Hanoi University of Science and Technology
-SET-School of Electronics and Telecommunication
GoGreen Club - InD (Infomation and Design) Group.
Gmail: tienvietn...@gmail.com
Y!M: tienvietn...@yahoo.com.vn
Skype: tienvietnguyen1110
Mobile: 01689924896 /01642669018
Birth: 10-11

     Viet Tien
      -Htpro!-
-httvhutceoscop-



Konstantinos

unread,
May 24, 2012, 12:33:58 PM5/24/12
to ns-3-...@googlegroups.com, h.ra...@surrey.ac.uk
Hi all,

A collegue of mine has some trouble installing ns-3 on Mac OS X (10.7). For some reason he can't post to this list (yet) so he asked me to forward his question.

I attach the outputs from ./waf configure and ./waf
The configure is successful but some libraries are missing (gtk+-2.0) and I think that that's the reason for the problem. He told me that he followed the instructions above to install it.

Any help would be appreciated.

Regards,
Konstantinos
waf-configure.log
waf.log
Reply all
Reply to author
Forward
0 new messages