ns-3-dev now using CMake

344 views
Skip to first unread message

Tom Henderson

unread,
Dec 2, 2021, 3:55:51ā€ÆPM12/2/21
to ns-3-users, Gabriel Ferreira
The development version of ns-3 (ns-3-dev) is in the process of changing
build systems from Waf to CMake; the next ns-3 release will be based on
CMake. Support for CMake was added yesterday. For the moment, Waf has
not been removed, but we plan to remove it once any lingering issues
with CMake are resolved.

CMake (version 3.10 or greater) will be required in the future, and will
need to be installed via your system's package manager.

CMake has a more complicated syntax than Waf, but we are providing a
small wrapper script called 'ns3' with a Waf-like API to allow people to
perform the main build steps with less typing.

In the past, if you typed:

./waf configure (or ./waf configure --enable-examples)

you should be able to now type:

./ns3 configure (or ./ns3 configure --enable-examples)

and the script will invoke the required CMake commands.

Similarly,

./waf build -> ./ns3 build
./waf --run first -> ./ns3 --run first (or ./ns3 --run-no-build first)

Not all Waf commands will be ported to 'ns3' but many of the most used
options will be supported. You can also just call CMake directly using
instructions documented in the updated ns-3 tutorial:
https://www.nsnam.org/docs/tutorial/html/quick-start.html#brief-summary
and
https://www.nsnam.org/docs/tutorial/html/getting-started.html#building-with-cmake

The second link above has guidance on how to better integrate with IDEs
using CMake.

Thanks are due to Gabriel Ferreira for developing and maintaining CMake
for ns-3, and for updating the tutorial.

- Tom

Charles Pandian

unread,
Dec 7, 2021, 10:44:56ā€ÆPM12/7/21
to ns-3-...@googlegroups.com
Mr. Tom and Developers,

IĀ  support the removal of 'waf' way of dong thing (for your information, I am using ns-3 for more than a decade even without trying to know what 'waf' is doing šŸ˜Š)

And even I will support if you remove the way of 'bake' based ns-3 install. Because I feel that they are notĀ a 'natural' way of doing things underĀ Linux forĀ decades.

Further, providing more than one way of installation (or compilation) is not providing more options for learnersā€”it is just providing more confusion to beginners.


In the past, if you typed:

./waf configure (or ./waf configure --enable-examples)

you should be able to now type:

./ns3 configure (or ./ns3 configure --enable-examples)

and the script will invoke the required CMake commands.

Similarly,

./waf build -> ./ns3 build
./waf --run first Ā -> ./ns3 --run first Ā (or ./ns3 --run-no-build first)


Why can't we simply do the following to build ns-3 using plain old 'make'? :

./configure
make


or Why can't we simply do the following to build ns-3 using 'cmake'? :

cmake .
cmake -build


I mean why can't we avoidĀ some additional scripts (like ns3 here)?


Note: theĀ above one is only my questionā€”not a feature request.

Sorry if I am misunderstanding theĀ developer's original scope of providing 'user-friendly' ways of doing ns-3 installation.Ā 
Ā 
Charles Pandian,



--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/889f0836-2e02-8f62-a176-667bbd9b7ce5%40tomh.org.

Tom Henderson

unread,
Dec 7, 2021, 11:17:58ā€ÆPM12/7/21
to ns-3-...@googlegroups.com

>
>
> Why can't we simply do the following to build ns-3 using plain old 'make'? :
>
> ./configure
> make
>
We actually have a Makefile for this purpose (it needs to be updated).
See Makefile in the top-level directory.

- Tom

Adil Alsuhaim

unread,
Dec 14, 2021, 5:50:30ā€ÆPM12/14/21
to ns-3-users
Dr. Henderson,Ā 

Does this mean that wscript files, such as the ones that are in every ns-3 module, would eventually be removed? I can see in GitLab that in each ns-3 module, there's a CMakeLists.txt file which is similar to the wscript files.

Cheers,
Adil

Tom Henderson

unread,
Dec 15, 2021, 2:11:57ā€ÆAM12/15/21
to ns-3-...@googlegroups.com
On 12/14/21 2:50 PM, Adil Alsuhaim wrote:
Dr. Henderson,Ā 

Does this mean that wscript files, such as the ones that are in every ns-3 module, would eventually be removed? I can see in GitLab that in each ns-3 module, there's a CMakeLists.txt file which is similar to the wscript files.

Yes, wscript files are planned to be removed, once CMake migration is finished.

- Tom

Charles Pandian

unread,
Dec 15, 2021, 6:23:48ā€ÆAM12/15/21
to ns-3-...@googlegroups.com
I vote for this good Move. We love to compile ns-3 in the same old 'make' way.šŸ˜Š

Charles Pandian,



--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages