Running Ns and Nam Under Windows 9x/2000/XP Using Cygwin
Since version 2.1b9, ns has been tested to build and validate under Windows 9x/2000/XP using [http://www.cygwin.com Cygwin]. Cygwin provides a Linux-like environment under Windows. The ns-allinone for the current version (2.30) builds straight out-of-the-box, [http://sourceforge.net/tracker/index.php?func=detail&aid=1393985&group_id=149743&atid=775392 although a few validation tests may fail]. Questions regarding Cygwin should be addressed to the [mailto:email@example.com ns-users] mailinglist with "Cygwin" indicated in the subject. == Cygwin Feature Set in Comparison to the main *NIX Version == ''Important: the primary ns build platform are various flavors of Unix, so build and validation problems on Windows are more frequent'''. Patches from Windows users to correct any problems are always welcome (Add them to [http://sourceforge.net/tracker/?group_id=149743&atid=775394 Sourceforge Patches]). Not all the features from the *NIX version are available in the Cygwin port. This includes network emulation (nse). If you're interested in this feature, you'll have to stick to the *NIX version. Patches are welcome to fix this for the Cygwin port!. == Cygwin 1.7.1 and ns-2 == ''Posted February 2010:'' The Cygwin project recently released version 1.7.1, which is a major release that breaks some programs, including ns-2. Presently, there is no working version of the ns-allinone-2 series that works with Cygwin 1.7.1 There is a "legacy" installation that will allow you to install Cygwin 1.5 series and then install ns-allinone-2 package. However, note that Cygwin 1.5 is reported to not run on Windows 7. For info on the legacy setup.exe, see: http://www.fruitbat.org/Cygwin/index.html ns-allinone-2.35 (planned for February or March 2010) is planned have support for Cygwin 1.7.1. == Windows Support for Ns-2.27 and Earlier == Ns versions up to 2.1b9 work under Windows using Visual C++ (Native Port). However, this method is not actively supported anymore in more recent versions. If you need to use such a version on Windows, you can still find the old instructions on the [http://www.isi.edu/nsnam/ns/ns-win32-build.html Windows / Visual C++] page. Since version 2.1b9, ns has used Cygwin/gcc instead of Visual C++. Instructions for running ns 2.1b9, 2.26, and 2.27 under Cygwin are available [http://www.isi.edu/nsnam/ns/ns-cygwin-old.html here]. == What Is Different With the Cygwin Port in Comparison to the Native Port? == * You can build allinone, without the need for downloading separate components. [[Category:Installation]] * The build process doesn't require Visual Studio to compile any component. * [[Nam]] won't run as a standalone Windows application, but within the [http://x.cygwin.com/ Cygwin X server]. * Unless you are using an older version of Cygwin, nearly all validation tests should work. * As of ns-2.26, the native Win32 build is not actively maintained anymore. == Requirements and Installation Tips == You'll need: * Windows 9x/2000/XP. The current test system is Windows XP SP2. * Cygwin-1.3.12 or later. May work with older versions but it's not tried. The current test system uses version 1.5.21.<br>When installing Cygwin with the <code>setup.exe</code> program, you'll have to consider some points: ** Make sure you have installed Cygwin with the UNIX text type. (It's the default during the Cygwin install procedure.) Using the DOS text type hasn't been tested, but is likely to lead to a number of errors in the validation tests. It's pretty easy to check which text type you are using, just at the prompt, do a<br><code>mount | grep textmode</code><br> and if you don't get anything (i.e., it returns an empty string), you should be fine. If the above command does return something, you are quite likely using the DOS text type, and you may be in trouble. **Also, make sure your Cygwin installation directory does not contain any spaces. Spaces in the root directory seem to be causing a lot of problems. In particular, <code>C:\Cygwin</code> (the default) is a good installation directory, <code>C:\Program Files\Cygwin</code> is not. **To avoid potential problems, make sure you don't have spaces in your login name. If you do, change your login name. **You'll need X11. Depending on which version of Cygwin you'll use, this might be either Xfree86 (packages <code>XFree86-base</code>, <code>XFree86-bin</code>, <code>XFree86-prog</code>, <code>XFree86-lib</code>, and <code>XFree86-etc</code>) or X.org (packages <code>xorg-x11-bin</code>, <code>xorg-x11-bin-dlls</code>, <code>xorg-x11-devel</code>, <code>xorg-x11-libs-data</code>, and <code>xorg-x11-etc</code>). **If you are unfamiliar with X11, we recommend you take a look at the [http://x.cygwin.com/docs/ug/cygwin-x-ug.html Cygwin/X User Guide], and the references therein. **Additionally, you'll need the following packages installed: <code>diffutils</code>, <code>gcc</code>, <code>gcc-g++</code>, <code>gawk</code>, <code>tar</code>, <code>gzip</code>, <code>make</code>, <code>patch</code>, <code>perl</code>, and <code>w32api</code>. Any missing packages will be detected by the setup program and can be added with Cygwin's <code>setup.exe</code>. *Ns-allinone, either source code or prebuilt binaries. == Building Ns-allinone Under Cygwin == Building ns from pieces requires some tweaking of the included components, which has already been done for the allinone package. These instructions only cover ns-allinone. '''Note: Running ns under Cygwin should be handled only in the Cygwin environment''', otherwise you might get into trouble. This includes * All commands for ns operation should be issued from the Cygwin shell (<code>bash</code>) and '''not''' from the Windows shell (<code>cmd.exe</code>). * All ns files should be stored in the Cygwin enviroment, e.g. under <code>/usr/local</code> or <code>/home</code>. Especially, files should '''not''' be placed somewhere under <code>/cygdrive</code> ! From Windows you can confirm this, by checking if your ns files are in a subdirectory somewhere under your Cygwin installation directory (usually <code>C:\Cygwin</code>). After you've setup Cygwin, get [http://www.isi.edu/nsnam/ns/ns-build.html#allinone <code>the lastest ns</code>] and unpack it with <code>tar xvfz ns-allinone-x.xx.x.tar.gz</code> to a directory reachable from Cygwin. Start the Cygwin Shell (<code>bash</code>), <code>cd</code> into your ns directory and issue ./install at the command prompt. The installer will check if all prerequisites are met, and if so, will build the whole package. The installation is similar to Unix install, so at the end of the build process you're advised to set some environment variables. This step is '''required''' for ns to work. You might want to add these variables to your <code>~/.bashrc</code>, so you don't have to retype them every time. '''Note:''' If you choose to add the environment variables to your <code>~/.bashrc</code> file, please run Cygwin setup again. This will properly setup your Cygwin profile with the new environment variables. Finally, you might want to check your installation with ./validate Note, that since version 2.28 a couple of regression tests don't pass using Cygwin. This is a known issue, see the [http://sourceforge.net/tracker/index.php?func=detail&aid=1393985&group_id=149743&atid=775392 Sourceforge Bug entry]. == Using Pre-Built Binaries Under Cygwin == Prebuilt binaries for ns-allinone are only available up to ns version 2.28. It comes in a package that has all binaries and the required library files that the binaries depend on. Download the zipfile [http://www.isi.edu/nsnam/dist/binary/ns-allinone-2.28-cygwin-binaries.zip <code>ns-allinone-2.28-cygwin-binaries.zip</code>]. Note, that you need to have Cygwin installed as described above. '''Especially, Cygwin has to be installed in C:\Cygwin!'''<br> Once you have Cygwin and other required packages installed, * Unzip the zipfile <code>ns-allinone-2.28-cygwin-binaries.zip</code> under your Cygwin root directory (<code>C:/cygwin</code>). It will place all binary files under <code>/usr/bin</code> and libraries under <code>/usr/lib</code>. * Next setup the path to the Tcl library by typing <code>export TCL_LIBRARY=/usr/lib/tcl8.4/</code> at the Cygwin (<code>bash</code>) shell prompt. * In order to run nam, you need to start the X server (type <code>startx</code> at the prompt) first and then run <code>nam.exe</code> from one of the X terminals. Note:You'll likely encounter the following message: <code>When configured, ns found the right version of tclsh in /home/dukat/ns-allinone-2.28/tcl8.4.5/unix/tclsh but it doesn't seem to be there anymore, so ns will fall back on running the first tclsh in your path. The wrong version of tclsh may break the test suites. Reconfigure and rebuild ns if this is a problem.</code> This is a cosmetical annoyance and doesn't hinder proper operation. To get rid of this message you'll have to compile ns from source. '''From ns 2.29 on, there will be no official prebuilt binaries!''' User contributions are welcome.
Running Ns and Nam Under Windows 9x/2000/XP Using Cygwin
Retrieved from "
What links here