Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

NS3 3.43 not finding packages

81 views
Skip to first unread message

Noel Huibers

unread,
Nov 8, 2024, 11:31:34 AM11/8/24
to ns-3-users
I wanted SQLite support and Eigen3 support of NS-3 and tried to use
./ns3 configure

This outputs me:
SQLite support                : OFF (Missing headers: "sqlite3.h" and missing libraries: "sqlite3")
Eigen3 support                : OFF (Eigen was not found)


Are there possiblities to check why it says its not found?
I can do sqlite3 --version for example and get my current version:
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)

I use NixOS and have the following packages:

packages = with pkgs; [
firefox
neovim
git
python3
# Building NS-3
binutils
libclang
cmake
gnumake
glibc
gcc
libcxx
# Enabling Support
sqlite
eigen
# Doxygen
doxygen
];

Gabriel Ferreira

unread,
Nov 8, 2024, 12:59:11 PM11/8/24
to ns-3-users
Well, these libraries are searched in their default directories. Where are the sqlite3.h and eigen.h headers located in NixOS?

Tommaso Pecorella

unread,
Nov 8, 2024, 1:01:56 PM11/8/24
to ns-3-users
I don't know much about NixOS, but it looks a similar issue to the one described here: https://discourse.nixos.org/t/error-with-cargo-rust-cannot-find-lsqlite3-no-such-file-or-directory/30498

In other terms, you need the "development" package, or to export the headers and library, not just the "sqlite3" binary.

Message has been deleted

Noel Huibers

unread,
Nov 15, 2024, 10:13:50 AM11/15/24
to ns-3-users
For other NixOS enthusiasts:

Using a nix flake setup you need to setup your devshell.

Minimal example to recreate:

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
}
outputs =
{
self,
nixpkgs,
...
}@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
devShell = pkgs.mkShell {
name = "dev-environment";

packages = with pkgs; [
cmake
sqlite
eigen
];
};
in
{
devShells.${system}.default = devShell;
}
}


When configuring your Nixshell you need to add CMake as a dependency, otherwise your shell will use your CMake installation of the system.
This can lead to the problem of CMake not finding your packages, since its stored in a different nix store, then your Headers (of SQLite or Eigen or other additional Packages for NS3).

I'm also trying to find a way to make cppyy work on NixOS. If someone has some good Links for this let me know.

Tom Henderson

unread,
Nov 15, 2024, 10:31:22 AM11/15/24
to ns-3-...@googlegroups.com, Noel Huibers
Thanks for posting; it would be nice to include here in the Linux
chapter (as a separate NixOS section) or else in a separate chapter.

https://www.nsnam.org/docs/installation/html/linux.html

- Tom
> https://discourse.nixos.org/t/error-with-cargo-rust-cannot-find-lsqlite3-no-such-file-or-directory/30498 <https://discourse.nixos.org/t/error-with-cargo-rust-cannot-find-lsqlite3-no-such-file-or-directory/30498>
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <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
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion visit
> https://groups.google.com/d/msgid/ns-3-users/c470eec1-b9c9-44f8-8160-a634196ad50bn%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/c470eec1-b9c9-44f8-8160-a634196ad50bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Noel Huibers

unread,
Nov 21, 2024, 10:36:23 AM11/21/24
to ns-3-users
Hey,

a quick update. With help of some other developers we got a cppyy nix package running for NixOS.

Importing:

inputs = {
cppyy = {
url = "github:m-bdf/cppyy-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}

To use the package:

cppyy.packages.${system}.cppyy


After including it my Python bindings are on, however they don't seem to work yet.

I saw my build is not making a /lib directory. I get a /lib64 though, should I cp it to /lib?

After cp, when trying to run the example of the docs using ns3 shell or ns3 run i get:

 Failed to find libstdc++.so. Make sure its library directory is in LD_LIBRARY_PATH.
Command 'python3 /home/noel/repos/ns-3-dev/examples/wireless/mixed-wired-wireless.py' returned non-zero exit status 1.

I saw the ns3 shell seems to override the LD_LIBRARY_PATH

cd .; export PATH=$PATH:/home/noel/repos/ns-3-dev/build/lib PYTHONPATH=/home/noel/repos/ns-3-dev/build/bindings/python LD_LIBRARY_PATH=/home/noel/repos/ns-3-dev/build/lib ; bash

It therefore makes sense that in the build/lib it doesn't find libstdc++.so.

I'm wondering if this is a known error, or i have gone somewhere wrong.

Gabriel Ferreira

unread,
Nov 21, 2024, 2:52:20 PM11/21/24
to ns-3-users
I don't believe that is the cause, because this is just the printer help. What it actually does also include whatever is on environment LD_LIBRARY_PATH and PYTHONPATH, as you can see here
https://gitlab.com/nsnam/ns-3-dev/-/blob/master/ns3?ref_type=heads#L1405
Reply all
Reply to author
Forward
0 new messages