Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] ns-3: init at 28.0 #31346

Merged
merged 1 commit into from Apr 6, 2018
Merged

[RFC] ns-3: init at 28.0 #31346

merged 1 commit into from Apr 6, 2018

Conversation

teto
Copy link
Member

@teto teto commented Nov 7, 2017

ns-3 is a discrete event C++ network simulator developed at www.nsnam.org popular in the networking research community.

Python bindings might not be functional yet, I could not test them as the required libraries are still in PR #30473 but I have yet to meet someone using the bindings.
The manual building doesn't complete yet but it's mostly useful for core developers upon release.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

# All modules can be enabled by choosing 'all_modules'.
# included here the DCE mandatory ones
, modules ? [ "core" "network" "internet" "point-to-point"]
, pkgs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add pkgs and pass gcc6, python and castxml directly here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you already warned me on that for other PRs. Sorry. I used to start writing the packages from the overlay, hence the pkgs remaining from "super.pkgs" which I forgot to remove. It's more convenient then writing callPackage ../ns3 { inherit (super.pkgs) gcc6 python castxml }. In fact I am curious how people create their package while waiting for a merge. If I add it to nixpkgs, then I lose the package once switching to another branch so it's hard to develop several packages at the same time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally use a nixpkgs checkout instead of channels: http://anderspapitto.com/posts/2015-11-01-nixos-with-local-nixpkgs-checkout.html

, dia, tetex ? null, ghostscript ? null, texlive ? null

, withDoc ? false
, withManual ? false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove these flags and add an extra output for documentation/manual: outputs = [ "out" "man" "doc"];

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how that will work but I'll look into it. Like if you don't call $outputDoc, it won't be built (or ns-3.doc) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can opt-out from installing documentation.

, withExamples ? false

# --enable-tests
, withTests ? true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not make testing optional here. This is done by hydra, so most people will not care.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

texlive.combined.scheme-medium ];

propagatedBuildInputs = with python.pythonPackages; with pkgs; [ gcc6 python ]
++ stdenv.lib.optional withGsl [ gsl-bin libgsl2 libgsl ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the downside on enable this library by default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ns3 supports many optional libraries and configurations, i prefer to keep the build small rather than list all of them. I made an exception for this one because it's supposed to improve simulation speed but I wouldn't mind removing it altogether.

Copy link
Member

@Mic92 Mic92 Nov 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it increases speed significantly, then I would enable it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked on the channel and in fact it seems to just increase the wifi precision according to https://www.nsnam.org/wiki/Installation#Installation and not necessarily increase speed. I fixed the package names (locally), just gsl was enough

@Mic92
Copy link
Member

Mic92 commented Nov 7, 2017

If the manual does not build yet, please do not advertise this as an option.

@teto
Copy link
Member Author

teto commented Nov 9, 2017

While building the manual I meet

(/nix/store/4agl46x083dpanpbsdydbzpqy1frgd66-texlive-combined-medium-2016/share
/texmf/tex/generic/babel/babel.def)))
(/nix/store/4agl46x083dpanpbsdydbzpqy1frgd66-texlive-combined-medium-2016/share
/texmf/tex/latex/psnfss/times.sty)

! LaTeX Error: File `fncychap.sty' not found.

which apparently belongs to

nix-locate fncychap.sty                                                                                           ~/nixpkgs
python36Packages.sphinx_1_2.out                  18,775 r /nix/store/1sydasckcwpwnm635mcjkm9g1r36958n-python3.6-sphinx-1.2.3/lib/python3.6/site-packages/sphinx/texinputs/fncychap.sty
(arelle.doc)                                     18,775 r /nix/store/p829jnd9jvhismkyf8b0ja0qylpcyyyp-python3.4-sphinx-1.2.3/lib/python3.4/site-packages/sphinx/texinputs/fncychap.sty
python27Packages.sphinx_1_2.out                  18,775 r /nix/store/n7cdj6jmjf5vhvq32r4v05m097hgfc1n-python2.7-sphinx-1.2.3/lib/python2.7/site-packages/sphinx/texinputs/fncychap.sty
python27Packages.gateone.out                     18,775 r /nix/store/f6k1gcn281xgw1nipqq5fc26sqrny524-python2.7-gateone-1.2-0d57c3/gateone/docs/build/latex/fncychap.sty
python27Packages.gateone.out                     18,775 r /nix/store/f6k1gcn281xgw1nipqq5fc26sqrny524-python2.7-gateone-1.2-0d57c3/lib/python2.7/site-packages/gateone/docs/build/latex/fncychap.sty

I wonder where the problem lies: should sphinx or ns3 export some value for latex to find teh files ? maybe the problem has already been met

@teto
Copy link
Member Author

teto commented Nov 14, 2017

I removed the gsl part as it' not about speed but about precision and this is not used in core so I had not tested it.
I added the --profile switch so that people can build in release mode (ns3 default is debug)
People should instead override the package to use their own library. I suspect there is not much value in having this in binary cache as ns3 users are likely to override the defaults buildInputs and so on. I think I could add the attribute to enforce local build.

As for the options that don't work, I moved them to a let ... inso that the current progress is not lost.

+let
+  # there are various problems with manual generation see PR #31346
+  # once those are solved, promote it to an option
+  withManual = false;
+
+  # required packages are not in mainline yet
+  generateBindings = false;
+in

@FRidh
Copy link
Member

FRidh commented Nov 22, 2017

As for the options that don't work, I moved them to a let ... inso that the current progress is not lost.

If it doesn't work, then it should not go in. You can keep the relevant changes in your own branch.

@@ -19014,6 +19014,10 @@ with pkgs;

megam = callPackage ../applications/science/misc/megam { };

ns-3 = callPackage ../development/libraries/science/networking/ns3 {
python=python3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Python 3 required? If so, make the parameter python3 instead of python. is it compatible with 2 and 3? Then just use python.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to force python3 wherever I can't but ok I fixed it.

@teto teto changed the title ns-3: init at 27.0 [WIP] ns-3: init at 27.0 Jan 9, 2018
@teto teto mentioned this pull request Apr 5, 2018
8 tasks
@teto teto changed the title [WIP] ns-3: init at 27.0 [RFC] ns-3: init at 28.0 Apr 6, 2018
@teto
Copy link
Member Author

teto commented Apr 6, 2018

I updated the package for ns3.28. Bindings and manual now work (though I disabled them by default as it can be pretty expansive to compile stuff).

ns-3 is a discrete event C++ network simulator developed at www.nsnam.org .

Python bindings & manual building are disabled by default but you can
override it.
@Mic92
Copy link
Member

Mic92 commented Apr 6, 2018

Thanks!

@teto teto deleted the ns3 branch April 6, 2018 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants