Error - ​build.ninja

1,001 views
Skip to first unread message

Adnan Rashid

unread,
Mar 18, 2022, 9:41:29 AM3/18/22
to ns-3-users
Please tell me why I am facing the below error? What is the solution?

even with hello simulator


adnan@adnan:~/git/ns-3-dev$ ./ns3 run hello-simulator

ninja: error: loading '​​build.ninja': No such file or directory

Tom Henderson

unread,
Mar 18, 2022, 10:04:38 AM3/18/22
to ns-3-...@googlegroups.com
--


Please provide more information:

- what operating system are you using?

- how are you calling the './ns3 configure' command?

- can you please try to call './ns3 clean' and start over and see if the problem persists?

Adnan Rashid

unread,
Mar 18, 2022, 10:14:31 AM3/18/22
to ns-3-...@googlegroups.com
Hi Tom,

I am using Ubuntu 20.04.4 LTS Let me show you the output

adnan@adnan:~/git/ns-3-dev$ ./ns3 clean
Finished executing the following commands:
rm -R build
rm -R cmake-cache
rm .lock-ns3_linux_build
adnan@adnan:~/git/ns-3-dev$ ./ns3 configure --build-profile=debug --enable-examples --enable-tests
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Using default output directory /home/adnan/git/ns-3-dev/build
-- Harfbuzz is required by GTK3 and was not found.
-- LibXML2 was found.
..
.
..
.

CMake Error at examples/CMakeLists.txt:6 (add_subdirectory):
  The source directory

    /home/adnan/git/ns-3-dev/examples/build

  does not contain a CMakeLists.txt file.
..
..
.
.

-- Configuring incomplete, errors occurred!
See also "/home/adnan/git/ns-3-dev/cmake-cache/CMakeFiles/CMakeOutput.log".
See also "/home/adnan/git/ns-3-dev/cmake-cache/CMakeFiles/CMakeError.log".
Finished executing the following commands:
mkdir cmake-cache
cd cmake-cache; /usr/bin/cmake -DCMAKE_BUILD_TYPE=debug -DNS3_NATIVE_OPTIMIZATIONS=OFF -DNS3_EXAMPLES=ON -DNS3_TESTS=ON -G Ninja .. ; cd ..
adnan@adnan:~/git/ns-3-dev$ ./ns3 build

ninja: error: loading 'build.ninja': No such file or directory
Finished executing the following commands:
cd cmake-cache; cmake --build . -j 11 ; cd ..
adnan@adnan:~/git/ns-3-dev$ 



--
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 a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/XSpx0LnmYH4/unsubscribe.
To unsubscribe from this group and all its topics, 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/7af30abd-e578-7646-6505-882955abbdf8%40tomh.org.


--
Regards,

Adnan

Adnan Rashid

unread,
Mar 18, 2022, 10:35:28 AM3/18/22
to ns-3-...@googlegroups.com
With simple Configure command the way you told me , it works but actually not. have look plz


adnan@adnan:~/git/ns-3-dev$ ./ns3 clean
Finished executing the following commands:
rm -R build
rm -R cmake-cache
rm .lock-ns3_linux_build
adnan@adnan:~/git/ns-3-dev$ ./ns3 configure
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info

.
.
.
.

.
-- Configuring done
-- Generating done

-- Build files have been written to: /home/adnan/git/ns-3-dev/cmake-cache

Finished executing the following commands:
mkdir cmake-cache
cd cmake-cache; /usr/bin/cmake -DCMAKE_BUILD_TYPE=debug -DNS3_NATIVE_OPTIMIZATIONS=OFF -G Ninja .. ; cd ..
adnan@adnan:~/git/ns-3-dev$ ./ns3 build
[1011/1017] Building CXX object scratch/CMakeFiles/scratch_route-over-topology.dir/route-over-topology.cc.o
FAILED: scratch/CMakeFiles/scratch_route-over-topology.dir/route-over-topology.cc.o
/usr/bin/c++  -DHAVE_GSL -DHAVE_LIBXML2 -DNS3_ASSERT_ENABLE -DNS3_BUILD_PROFILE_DEBUG -DNS3_LOG_ENABLE -DPROJECT_SOURCE_PATH=\"/home/adnan/git/ns-3-dev\" -D__LINUX__ -I../build/include -I/usr -I/usr/include/libxml2 -g -fPIE   -fno-semantic-interposition -Wall -Werror -std=gnu++17 -MD -MT scratch/CMakeFiles/scratch_route-over-topology.dir/route-over-topology.cc.o -MF scratch/CMakeFiles/scratch_route-over-topology.dir/route-over-topology.cc.o.d -o scratch/CMakeFiles/scratch_route-over-topology.dir/route-over-topology.cc.o -c ../scratch/route-over-topology.cc
../scratch/route-over-topology.cc: In function ‘void SixLowCallback(std::string, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::SixLowPanNetDevice>, uint32_t)’:
../scratch/route-over-topology.cc:142:36: error: ‘ns3::Ipv6Address ns3::Ipv6Header::GetDestinationAddress() const’ is deprecated:  [-Werror=deprecated-declarations]
  142 |  if (ipv6Hdr.GetDestinationAddress()==Ipv6Address::GetAllRoutersMulticast())
      |                                    ^
In file included from ../build/include/ns3/ipv6-l3-protocol.h:30,
                 from ../build/include/ns3/internet-stack-helper.h:30,
                 from ../build/include/ns3/internet-module.h:6,
                 from ../scratch/route-over-topology.cc:44:
../build/include/ns3/ipv6-header.h:280:15: note: declared here
  280 |   Ipv6Address GetDestinationAddress (void) const;
      |               ^~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
[1014/1017] Building CXX object scratch/CMakeFiles/scratch_neighbordiscovery.dir/neighbordiscovery.cc.o
ninja: build stopped: subcommand failed.

Finished executing the following commands:
cd cmake-cache; cmake --build . -j 11 ; cd ..
adnan@adnan:~/git/ns-3-dev$ 




route-over-topology.cc is the file on which I am working, it was fine when there was a waf. But anyway, I removed the file from scratch even though I am facing errors. 



--
Regards,

Adnan

Tom Henderson

unread,
Mar 18, 2022, 11:25:20 AM3/18/22
to ns-3-...@googlegroups.com
On 3/18/22 07:34, Adnan Rashid wrote:
> With simple Configure command the way you told me , it works but
> actually not. have look plz

The below looks like a compilation issue with your code, and also it
seems that you may have a problem with CMakeLists.txt in the new
examples directory that you appear to have created:

> CMake Error at examples/CMakeLists.txt:6 (add_subdirectory):
> The source directory
>
> /home/adnan/git/ns-3-dev/examples/build
>
> does not contain a CMakeLists.txt file.

- Tom


>
>
> *adnan@adnan:~/git/ns-3-dev$ ./ns3 clean*
> Finished executing the following commands:
> rm -R build
> rm -R cmake-cache
> rm .lock-ns3_linux_build
> *adnan@adnan:~/git/ns-3-dev$ ./ns3 configure*
> -- The CXX compiler identification is GNU 9.4.0
> -- The C compiler identification is GNU 9.4.0
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
>
> .
> .
> .
> .
>
> .
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/adnan/git/ns-3-dev/cmake-cache
> Finished executing the following commands:
> mkdir cmake-cache
> cd cmake-cache; /usr/bin/cmake -DCMAKE_BUILD_TYPE=debug
> -DNS3_NATIVE_OPTIMIZATIONS=OFF -G Ninja .. ; cd ..
> *adnan@adnan:~/git/ns-3-dev$ ./ns3 build*
> *adnan@adnan:~/git/ns-3-dev$ *
>
>
>
>
> *route-over-topology.cc *is the file on which I am working, it was fine
> when there was a *waf. *But anyway, I removed the file from scratch even
> though I am facing errors.
>
>
>
>
> On Fri, Mar 18, 2022 at 3:13 PM Adnan Rashid <adnanr...@gmail.com
> <mailto:adnanr...@gmail.com>> wrote:
>
> Hi Tom,
>
> I am using *Ubuntu 20.04.4 LTS* Let me show you the output
>
> *adnan@adnan:~/git/ns-3-dev$ ./ns3 clean*
> Finished executing the following commands:
> rm -R build
> rm -R cmake-cache
> rm .lock-ns3_linux_build
> *adnan@adnan:~/git/ns-3-dev$ ./ns3 configure --build-profile=debug
> --enable-examples --enable-tests*
> *adnan@adnan:~/git/ns-3-dev$ ./ns3 build*
> ninja: error: loading 'build.ninja': No such file or directory
> Finished executing the following commands:
> cd cmake-cache; cmake --build . -j 11 ; cd ..
> *adnan@adnan:~/git/ns-3-dev$ *
>
>
>
> On Fri, Mar 18, 2022 at 3:04 PM Tom Henderson <to...@tomh.org
> <mailto:to...@tomh.org>> wrote:
>
> On 3/18/22 06:41, Adnan Rashid wrote:
>> Please tell me why I am facing the below error? What is the
>> solution?
>>
>> even with hello simulator
>>
>> ​
>> adnan@adnan:~/git/ns-3-dev$ ./ns3 run hello-simulator
>>
>> ninja: error: loading '​​build.ninja': No such file or directory
>> --
>
>
> Please provide more information:
>
> - what operating system are you using?
>
> - how are you calling the './ns3 configure' command?
>
> - can you please try to call './ns3 clean' and start over and
> see if the problem persists?
>
> --
> 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 a topic
> in the Google Groups "ns-3-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ns-3-users/XSpx0LnmYH4/unsubscribe
> <https://groups.google.com/d/topic/ns-3-users/XSpx0LnmYH4/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email
> to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ns-3-users/7af30abd-e578-7646-6505-882955abbdf8%40tomh.org?utm_medium=email&utm_source=footer>.
>
>
>
> --
> Regards,
>
> Adnan
>
>
>
> --
> Regards,
>
> Adnan
>
> 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 on the web visit
> https://groups.google.com/d/msgid/ns-3-users/CAGm_170LK60yAdnKCiBzsrAJP5kC-LK3QMB33cp1o9OMSE3DMw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ns-3-users/CAGm_170LK60yAdnKCiBzsrAJP5kC-LK3QMB33cp1o9OMSE3DMw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Adnan Rashid

unread,
Mar 18, 2022, 12:55:02 PM3/18/22
to ns-3-users
On Friday, March 18, 2022 at 4:25:20 PM UTC+1 Tom Henderson wrote:
On 3/18/22 07:34, Adnan Rashid wrote:
> With simple Configure command the way you told me , it works but
> actually not. have look plz

The below looks like a compilation issue with your code, and also it
seems that you may have a problem with CMakeLists.txt in the new
examples directory that you appear to have created:

> CMake Error at examples/CMakeLists.txt:6 (add_subdirectory):
> The source directory
>
> /home/adnan/git/ns-3-dev/examples/build
>
> does not contain a CMakeLists.txt file.

Lesson learned - always search for error messages that might be several lines above.
The offending directory was created by ... no idea. Maybe VSCode, maybe Eclipse, maybe aliens.

[Tommaso taking over the keyboard]
... we can't even blame Adnan for being drunk as he doesn't drink.
[Tommaso releasing the keyboard]

Thanks for the help,

A.

Gabriel Ferreira

unread,
Mar 19, 2022, 12:33:16 PM3/19/22
to ns-3-users
I have to admit I didn't notice errors were not color coated when using ns3, since I usually work on CLion that colours them.
I've added some coloring support and should be easier to spot errors https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/913
This error specifically was also fixed. It should not be processing folders with no CMakeLists.txt.

Sorry for the trouble.

Manoj Bommali

unread,
Apr 21, 2024, 10:44:17 AM4/21/24
to ns-3-users
HI is  ./ns3 clean  working 
i am getting the same error

Gabriel Ferreira

unread,
Apr 21, 2024, 11:09:17 AM4/21/24
to ns-3-users
It is. 
Reply all
Reply to author
Forward
0 new messages