我想在 Windows 上安装 ns2,Bloggers 建议使用 cygwin,但这需要很长时间。有没有其他方法可以在 Windows 上安装 ns2。
问候,
安装速度非常快。首先安装 Cygwin 的默认配置。和 gcc-g++ GNU Compiler Collection (C++), make, patch,mingw-w32api,gcc4, gcc4-g++ ,w32api,perl,xorg-servers, xinit,libx11-devel, libXmu-devel
对于 NS 安装 ns-allinone-2.35
实际上,Cygwin 是在 Windows 中安装 ns2 的唯一完美方法。所有其他方法都无济于事。为了最大限度地减少安装时间,您可以在安装 cygwin 时跳过一些额外的软件包。
你必须有一个 linux 操作系统,你可以尝试下载 Cygwin 并在这个链接中使用它你会看到这里的方式
A better way is to install VMware and then install ubuntu on it. Then you can install very easily ns2 on it. A very good link to install ns2 on ubuntu is:
https://www.youtube.com/watch?v=DiAqKK28Qn0&list=PLIRIdFuHppH5Do4E0SRxWRC6QRCUPwD9l
I am reiterating the steps below for NS2 after installing VMWare and ubuntu, just in case if the link is not accessible:
Installation of NS2 (ns-2.35) in Ubuntu 20.04 LTS
Step 1: Install the basic libraries like
$] sudo apt install build-essential autoconf automake libxmu-dev
Step 2: install gcc-4.8 and g++-4.8
open the file using sudo mode
$] sudo nano /etc/apt/sources.list
Include the following line
deb http://in.archive.ubuntu.com/ubuntu bionic main universe
$] sudo apt update
$] sudo apt install gcc-4.8 g++-4.8
Step 3:
Unzip the ns2 packages to home folder
$] tar zxvf ns-allinone-2.35.tar.gz
$] cd ns-allinone-2.35/ns-2.35
Modify the following make files.
~ns-2.35/Makefile.in
Change @CC@ to gcc-4.8
change @CXX@ to g++-4.8
~nam-1.15/Makefile.in
~xgraph-12.2/Makefile.in
~otcl-1.14/Makefile.in
Change in all places
@CC@ to gcc-4.8
@CPP@ or @CXX@ to g++-4.8
open the file:
~ns-2.35/linkstate/ls.h
Change at the Line no 137
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
to This
void eraseAll() { this- erase(baseMap::begin(), baseMap::end()); }
All changes made
Step 4: Open a new terminal
$] cd ns-allinone-2.35/
$] ./install
Step 5 - Set the PATH
Open a new Terminal,
$] gedit .bashrc
Paste the following lines
export PATH=$PATH:/home/yourusername/ns-allinone-2.35/bin:/home/yourusername/ns-allinone-2.35/tcl8.5.10/unix:/home/yourusername/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=/home/yourusername/ns-allinone-2.35/otcl-1.14:/home/yourusername/ns-allinone-2.35/lib