262 ``ns-allinone-3.10`` under your ``~/tarballs`` directory. Take a deep |
262 ``ns-allinone-3.10`` under your ``~/tarballs`` directory. Take a deep |
263 breath and type the following: |
263 breath and type the following: |
264 |
264 |
265 :: |
265 :: |
266 |
266 |
267 ./build.py |
267 ./build.py --enable-tests |
|
268 |
|
269 Because we are working with tests in this tutorial, and because they |
|
270 are not built by default in |ns3|, the argument for build.py tells it |
|
271 to build them for us. In the future you can build |ns3| without tests |
|
272 if you wish. |
268 |
273 |
269 You will see lots of typical compiler output messages displayed as the build |
274 You will see lots of typical compiler output messages displayed as the build |
270 script builds the various pieces you downloaded. Eventually you should see the |
275 script builds the various pieces you downloaded. Eventually you should see the |
271 following magic words: |
276 following magic words: |
272 |
277 |
291 We use Waf to configure and build the |ns3| project. It's not |
296 We use Waf to configure and build the |ns3| project. It's not |
292 strictly required at this point, but it will be valuable to take a slight |
297 strictly required at this point, but it will be valuable to take a slight |
293 detour and look at how to make changes to the configuration of the project. |
298 detour and look at how to make changes to the configuration of the project. |
294 Probably the most useful configuration change you can make will be to |
299 Probably the most useful configuration change you can make will be to |
295 build the optimized version of the code. By default you have configured |
300 build the optimized version of the code. By default you have configured |
296 your project to build the debug version. Let's tell the project to do |
301 your project to build the debug version. Let's tell the project to |
297 make an optimized build. To explain to Waf that it should do optimized |
302 make an optimized build. To explain to Waf that it should do optimized |
298 builds you will need to execute the following command, |
303 builds that include the tests, you will need to execute the |
299 |
304 following command, |
300 :: |
305 |
301 |
306 :: |
302 ./waf -d optimized configure |
307 |
|
308 ./waf -d optimized --enable-tests configure |
303 |
309 |
304 This runs Waf out of the local directory (which is provided as a convenience |
310 This runs Waf out of the local directory (which is provided as a convenience |
305 for you). As the build system checks for various dependencies you should see |
311 for you). As the build system checks for various dependencies you should see |
306 output that looks similar to the following, |
312 output that looks similar to the following, |
307 |
313 |
371 system. If this library were not found, the corresponding |ns3| feature |
377 system. If this library were not found, the corresponding |ns3| feature |
372 would not be enabled and a message would be displayed. Note further that there is |
378 would not be enabled and a message would be displayed. Note further that there is |
373 a feature to use the program ``sudo`` to set the suid bit of certain programs. |
379 a feature to use the program ``sudo`` to set the suid bit of certain programs. |
374 This is not enabled by default and so this feature is reported as "not enabled." |
380 This is not enabled by default and so this feature is reported as "not enabled." |
375 |
381 |
376 Now go ahead and switch back to the debug build. |
382 Now go ahead and switch back to the debug build that includes the tests. |
377 |
383 |
378 :: |
384 :: |
379 |
385 |
380 ./waf -d debug configure |
386 ./waf -d debug --enable-tests configure |
381 |
387 |
382 The build system is now configured and you can build the debug versions of |
388 The build system is now configured and you can build the debug versions of |
383 the |ns3| programs by simply typing, |
389 the |ns3| programs by simply typing, |
384 |
390 |
385 :: |
391 :: |
386 |
392 |
387 ./waf |
393 ./waf |
388 |
394 |
389 Some waf commands are meaningful during the build phase and some commands are valid |
395 Some waf commands are meaningful during the build phase and some commands are valid |
390 in the configuration phase. For example, if you wanted to use the emulation |
396 in the configuration phase. For example, if you wanted to use the emulation |
391 features of |ns3| you might want to enable setting the suid bit using |
397 features of |ns3|, you might want to enable setting the suid bit using |
392 sudo as described above. This turns out to be a configuration-time command, and so |
398 sudo as described above. This turns out to be a configuration-time command, and so |
393 you could reconfigure using the following command |
399 you could reconfigure using the following command that also includes the tests |
394 |
400 |
395 :: |
401 :: |
396 |
402 |
397 ./waf -d debug --enable-sudo configure |
403 ./waf -d debug --enable-sudo --enable-tests configure |
398 |
404 |
399 If you do this, waf will have run sudo to change the socket creator programs of the |
405 If you do this, waf will have run sudo to change the socket creator programs of the |
400 emulation code to run as root. There are many other configure- and build-time options |
406 emulation code to run as root. There are many other configure- and build-time options |
401 available in waf. To explore these options, type: |
407 available in waf. To explore these options, type: |
402 |
408 |
491 "optimized out." If you don't see the "Hello Simulator" output, |
497 "optimized out." If you don't see the "Hello Simulator" output, |
492 type the following, |
498 type the following, |
493 |
499 |
494 :: |
500 :: |
495 |
501 |
496 ./waf -d debug configure |
502 ./waf -d debug --enable-tests configure |
497 |
503 |
498 to tell ``waf`` to build the debug versions of the |ns3| |
504 to tell ``waf`` to build the debug versions of the |ns3| |
499 programs. You must still build the actual debug version of the code by |
505 programs that includes the tests. You must still build |
500 typing, |
506 the actual debug version of the code by typing, |
501 |
507 |
502 :: |
508 :: |
503 |
509 |
504 ./waf |
510 ./waf |
505 |
511 |