Bug 221

Summary: need a scratch directory
Product: ns-3 Reporter: Mathieu Lacage <mathieu.lacage>
Component: build systemAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: gjcarneiro
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   

Description Mathieu Lacage 2008-06-14 11:42:55 UTC
For the tutorial, I think that it would be really nice to have a directory named 'scratch' in ns-3 releases (and ns-3-dev) that we can direct users to: every .cc file dropped there will be automatically built as a main program and linked against all ns-3 modules.

Tom and I discussed the name: "scratch" seems like a winner...
Comment 1 Gustavo J. A. M. Carneiro 2008-06-14 17:35:24 UTC
It's not bad idea, but we should look out for:

 1. It encourages monolithic programs; developers are not allowed to have multiple sources for the same  program; that may create bad habits;

 2. This way users won't be forced to know the wscript syntax for adding new programs, and so they will likely never learn it.

We can perhaps mitigate 1 by allowing not only .cc files but also subdirectories to trigger a program build.  When a subdirectory is found, all sources in it are added to a newly created program with the same name as the subdirectory.
Comment 2 Mathieu Lacage 2008-06-15 22:53:35 UTC
(In reply to comment #1)

>  2. This way users won't be forced to know the wscript syntax for adding new
> programs, and so they will likely never learn it.

I think that this is exactly the goal. If they want to contribute to ns-3, they will have to learn it. If they never do, they don't have to.

> We can perhaps mitigate 1 by allowing not only .cc files but also
> subdirectories to trigger a program build.  When a subdirectory is found, all
> sources in it are added to a newly created program with the same name as the
> subdirectory.

Sounds like a great extension.
Comment 3 Gustavo J. A. M. Carneiro 2008-06-16 09:15:02 UTC
Should be fixed now; reopen if a problem is found.