全部博文(180)
分类: 系统运维
2010-03-13 19:17:34
sudo apt-get install gcc g++ python python-dev 或者: sudo apt-get update sudo apt-get install build-essentials |
---- Summary of optional NS-3 features: Threading Primitives : enabled Real Time Simulator : enabled GtkConfigStore : not enabled (library 'gtk+-2.0 >= 2.12' not found) SQlite stats data output : enabled Network Simulation Cradle : not enabled (--enable-nsc configure option not given) Python Bindings : enabled Python API Scanning Support : not enabled (Missing 'pygccxml' Python module) Configuration finished successfully; project is now ready to build. |
Waf: Entering directory `/home/cat/ns-allinone-3.7/ns-3.7/build' [669/670] get-unit-tests-list [670/670] print-introspected-doxygen [671/704] run-unit-test(AddressHelper) . . [701/704] run-unit-test(Object) [702/704] run-unit-test(Ptr) [703/704] run-unit-test(Callback) [704/704] collect-unit-tests-results C++ UNIT TESTS: all 33 tests passed. Waf: Leaving directory `/home/cj/ns-allinone-3.7/ns-3.7/build' 'build' finished successfully (5.670s) |
ns-3安装问题解决Supported platformsns-3 is primarily developed on GNU/Linux platforms, and the minimal requirements to run basic simulations are a gcc installation of gcc-3.4/g++-3.4 or greater, and python 2.4 or greater. ns-3 is supported on the following primary platforms:
sudo apt-get install gcc g++ python
sudo apt-get install gcc g++ python python-dev
sudo apt-get install mercurial
sudo apt-get install bzr
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
sudo apt-get install gdb valgrind
sudo apt-get install doxygen graphviz imagemagick
sudo apt-get install texinfo dia texlive texlive-pdf texlive-latex-extra texlive-extra-utils texlive-generic-recommended texi2html
sudo apt-get install flex bison
sudo apt-get install libgoocanvas-dev
sudo apt-get install g++-4.0 gcc-4.0
sudo apt-get install tcpdump
sudo apt-get install sqlite sqlite3 libsqlite3-dev
sudo apt-get install libxml2 libxml2-dev
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas InstallationThe ns-3 code is available in Mercurial repositories on the server (look for the latest release e.g., "ns-3.4"). You can download a tarball of the latest release at or you can work with our repositories using Mercurial. We recommend using Mercurial unless there's a good reason not to (See the end of this section for instructions on how to get a tarball release). The simplest way to get started using Mercurial repositories is to use the ns-3-allinone environment. This is a set of scripts that manages the downloading and building of various subystems of ns-3 for you. We recommend that you begin your ns-3 adventures in this environment as it can really simplify your life at this point. Downloading ns-3 Using a TarballThe process for downloading ns-3 via tarball is simpler than the Mercurial process since all of the pieces are pre-packaged for you. You just have to pick a release, download it and decompress it. As mentioned above, one practice is to create a directory called repos in one's home directory under which one can keep local Mercurial repositories. One could also keep a tarballs directory. If you adopt the tarballs directory approach, you can get a copy of a release by typing the following into your Linux shell (substitute the appropriate version numbers, of course): cd If you change into the directory ns-allinone-3.7.1 you should see a number of files: build.py* ns-3.7.1/ nsc-0.5.1/ README You are now ready to build the ns-3 distribution. Building ns-3 with ns-3-allinoneThe first time you build the ns-3 project you should build using the allinone environment. This will get the project configured for you in the most commonly useful way. Change into the directory you created in the download section above. If you downloaded using Mercurial you should have a directory called ns-3-allinone under your ~/repos directory. If you downloaded using a tarball you should have a directory called something like ns-3-allinone-3.4 under your ~/tarballs directory. Type the following: ./build.py You will see lots of typical compiler output messages displayed as the build script builds the various pieces you downloaded. Eventually you should see the following magic words: Build finished successfully (00:02:37) Once the project has built you typically will not use ns-3-allinone scripts. You will now interact directly with Waf and we do it in the ns-3-dev directory and not in the ns-3-allinone directory. Configuration with WafTo see valid configure options, type ./waf --help. The most important option is -d CXXFLAGS="-O3" ./waf configure or, alternately, the gcc compiler CXX=g++-4.0 ./waf configure Note: Unlike some other build tools, to change the build target, the option must be supplied during the configure stage rather than the build stage (i.e., "./waf -d optimized" will not work; instead, do ./waf -d optimized configure; ./waf The resulting binaries are placed in build/ ./waf --shell Of course, you can run gdb in emacs, or use your favorite debugger such as ddd or insight just as easily. In an optimized build you can find the executable for the first.cc example as build/optimized/examples/first. In order to forcibly disable python bindings, you can provide the following option: ./waf --disable-python configure In order to tell the build system to use the sudo program to set the suid bit if required, you can provide the following option: ./waf --enable-sudo configure To start over a configuration from scratch, type: ./waf distclean Or if you get stuck and all else fails: rm -rf build followed by changing back into ns-3-allinone and doing: ./build.py will basically reset your build state. To see all waf options: ./waf --help Validatingns-3 has unit tests that can be run to verify the installation: ./test.py which should produce output like: PASS: TestSuite histogram To run the regression tests mentioned above: ./waf --regression Remember to cd back into the top-level Running a ScriptWe typically run scripts under the control of Waf. This allows the build system to ensure that the shared library paths are set correctly and that the libraries are available at run time. To run a program, simply use the ./waf --run hello-simulator Waf first checks to make sure that the program is built correctly and executes a build if required. Waf then executes the program, which produces the following output. Hello Simulator Congratulations. You are now an ns-3 user. What do I do if I don’t see the output? If you don’t see ./waf -d debug configure to tell ./waf Now, if you run the If you want to run programs under another tool such as gdb or valgrind, see this . |