simulatorns-3

NS-3: module errors while building


I have problem in newest ns-3.26 with nsc-0.5.3 and gccxml-ns3 - system is very up-to-date so that's not the case.

Building nsc-0.5.3 - Problem

Problem: Optional dependency, module "nsc-0.5.3" failed

This may reduce the functionality of the final build. However, bake will continue since "nsc-0.5.3" is not an essential dependency. For more information call bake with -v or -vvv, for full verbose mode.


Solution

  • Found the solution - NSC doesn't work properly with gcc/g++-6 so I had to change default version of gcc and g++ (for example from 6.3.0 to 5.4.1)

    1) Find installed compilers:

    dpkg --list | grep compiler
    

    2) Change default gcc, g++, cc and c++ (via https://askubuntu.com/questions/26498/choose-gcc-and-g-version):

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20
    
    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10
    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 20
    
    sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
    sudo update-alternatives --set cc /usr/bin/gcc
    
    sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
    sudo update-alternatives --set c++ /usr/bin/g++
    

    Also, to check if changes are saved:

    gcc -v
    

    It should say: "gcc version 5.4.1" at the end.

    After that, NSC was installed successfully.

    It's worth mentioning that it didn't fix gccxml's problem, but in my case I needed NSC working so...