ns-3 DCE with CMake

84 views
Skip to first unread message

Harsh Patel

unread,
May 2, 2023, 11:11:06 PM5/2/23
to ns-3-users
Hi all,

Is there any version of DCE that I can build with CMake? I want to use newer versions of ns-3 with DCE and was wondering if it is possible to build DCE with CMake and in turn use latest ns-3 versions with it?

I tried building bake from here but I ran into build error for ns-3-dce. Below is the error:
In file included from ../model/pipe-fd.h:24,
                 from ../model/pipe-fd.cc:21:
../model/unix-fd.h:7:10: fatal error: ns3/object.h: No such file or directory
    7 | #include "ns3/object.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

../model/dce-pwd.cc:2:10: fatal error: ns3/log.h: No such file or directory
    2 | #include "ns3/log.h"
      |          ^~~~~~~~~~~
compilation terminated.

In file included from ../model/dce-dl.cc:21:
../model/loader-factory.h:4:10: fatal error: ns3/object.h: No such file or directory
    4 | #include "ns3/object.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

../model/cmsg.cc:2:10: fatal error: ns3/log.h: No such file or directory
    2 | #include "ns3/log.h"
      |          ^~~~~~~~~~~
compilation terminated.

../model/dce-poll.cc:1:10: fatal error: ns3/log.h: No such file or directory
    1 | #include "ns3/log.h"
      |          ^~~~~~~~~~~
compilation terminated.

../model/file-usage.cc:22:10: fatal error: ns3/log.h: No such file or directory
   22 | #include "ns3/log.h"
      |          ^~~~~~~~~~~
compilation terminated.

In file included from ../model/unix-fd.cc:1:
../model/unix-fd.h:7:10: fatal error: ns3/object.h: No such file or directory
    7 | #include "ns3/object.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

In file included from ../model/dce-pthread.cc:4:
../model/dce-manager.h:26:10: fatal error: ns3/object.h: No such file or directory
   26 | #include "ns3/object.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

../model/dce-syslog.cc:4:10: fatal error: ns3/log.h: No such file or directory
    4 | #include <ns3/log.h>
      |          ^~~~~~~~~~~
compilation terminated.

In file included from ../model/dce.cc:1:
../model/dce-manager.h:26:10: fatal error: ns3/object.h: No such file or directory
   26 | #include "ns3/object.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

In file included from ../model/dce-manager.cc:20:
../model/dce-manager.h:26:10: fatal error: ns3/object.h: No such file or directory
   26 | #include "ns3/object.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

In file included from ../model/dce-credentials.cc:3:
../model/utils.h:8:10: fatal error: ns3/nstime.h: No such file or directory
    8 | #include "ns3/nstime.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

In file included from ../model/unix-datagram-socket-fd.cc:20:
../model/process.h:30:10: fatal error: ns3/callback.h: No such file or directory
   30 | #include "ns3/callback.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

../model/ipv4-dce-routing.cc:27:10: fatal error: ns3/log.h: No such file or directory
   27 | #include "ns3/log.h"
      |          ^~~~~~~~~~~
compilation terminated.

In file included from ../model/dce-global-variables.cc:3:
../model/process.h:30:10: fatal error: ns3/callback.h: No such file or directory
   30 | #include "ns3/callback.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

In file included from ../model/dce-stdio.cc:7:
../model/process.h:30:10: fatal error: ns3/callback.h: No such file or directory
   30 | #include "ns3/callback.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Waf: Leaving directory `/mnt/EXPIREMENT/bake/source/ns-3-dce/build'
Build failed
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)
 -> task in './lib/ns3-dce' failed with exit status 1 (run with -v to display more information)

 >> Building dce-linux-dev - Problem
   > Subprocess failed with error 1: ['/usr/bin/python3', '/mnt/EXPIREMENT/bake/source/ns-3-dce/waf', '-j', '16']


I noticed here that the ns-3-dev is built using cmake but ns-3-dce is built using waf. Should this be an issue? If not, can you help me resolve the error as seen above (unable to find .h files)?

Best,
Harsh

Harsh Patel

unread,
May 3, 2023, 3:57:03 PM5/3/23
to ns-3-users
I understand that the bake/build/install/ns3/ directory has all the necessary files (log.h, object.h, callback.h, etc) which are shown to be "no such file or directory" in the error. But the DCE waf build is not able to find it and hence, shows the error. 
How do I get DCE to detect and use these files for its build?

Tom Henderson

unread,
May 3, 2023, 6:06:28 PM5/3/23
to ns-3-...@googlegroups.com, Harsh Patel
It will probably be a bit of time before DCE is converted to CMake, but
it could still use Waf for the time being. There are two issues that
you will need to solve to make it work with ns-3.38.

1) DCE looks for pkgconfig files in the ../../build/lib directory
(installed by ns-3 CMake). In principle, DCE can stay on Waf and use
ns-3 libraries (and .pc files) installed by CMake, but I don't know
offhand whether the library names and .pc files are the same from
ns-3.35 to ns-3.38-- they should be, but I haven't checked. If these
are not similar from version 3.35 to version 3.38, they have to be
aligned or DCE Waf needs to know the new names.

2) DCE examples need to be updated to any API changes that occurred from
ns-3.35 -> ns-3.38. Usually this is not a big deal.

- Tom

On 5/3/23 12:57, Harsh Patel wrote:
> I understand that the bake/build/install/ns3/ directory has all the
> necessary files (log.h, object.h, callback.h, etc) which are shown to be
> "no such file or directory" in the error. But the DCE waf build is not
> able to find it and hence, shows the error.
> How do I get DCE to detect and use these files for its build?
>
> On Tuesday, 2 May 2023 at 20:11:06 UTC-7 Harsh Patel wrote:
>
> Hi all,
>
> Is there any version of DCE that I can build with CMake? I want to
> use newer versions of ns-3 with DCE and was wondering if it is
> possible to build DCE with CMake and in turn use latest ns-3
> versions with it?
>
> I tried building bake from here <https://gitlab.com/nsnam/bake/>but
> I ran into build error for ns-3-dce. Below is the error:
> /In file included from ../model/pipe-fd.h:24,
> '/mnt/EXPIREMENT/bake/source/ns-3-dce/waf', '-j', '16']/
>
> I noticed here that the ns-3-dev is built using cmake but ns-3-dce
> is built using waf. Should this be an issue? If not, can you help me
> resolve the error as seen above (unable to find .h files)?
>
> Best,
> Harsh
>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/ns-3-users/0ebde942-ac69-4d8a-baa5-d81cd0cd303fn%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/0ebde942-ac69-4d8a-baa5-d81cd0cd303fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Harsh Patel

unread,
May 4, 2023, 4:43:59 PM5/4/23
to ns-3-users
Thanks Tom. 

Setup: For the bakeconf.xml, I changed the ns-3 name from "ns-3-dev" to "ns-3.38" under the "dce-meta-dev" module. And I am configuring bake to "dce-linux-dev". 
After this I have the bake download and build running okay until the build gets to the "dce-linux-dev" build where we see the errors.
(Above info is to clarify the setup scenario)

Now coming onto the errors,
(1) For the version mismatch, I see that under directory "../../build/lib/" the DCE 1.12 (which installs ns-3.35) has libraries named libns3.33-*-debug.so while the new setup I did with ns-3.38 has libraries named libns3.38-*-default.so. Also, under directory ""../../build/lib/pkgconfig" I see libraries named libns3.33-*-debug.pc with the DCE 1.12 setup while the new setup has .pc files with name ns3-*.pc. 

I modified the files in the new setup under "../../build/lib" to be renamed from libns3.38-*-default.so to ns3.38-*-default.so. This is also the name used inside the ns3-*.pc files which is why I thought that would work but it still throws the same error. 

I tried a few different variations of this but I am not able to get the waf to find the right pkgconfig and library files to build the project. Could you help me with this? 

(2) I understand the examples can be updated for the API changes and I can do that for the examples I need to work on once the setup is ready. Thanks for that insight.

Apologies for the urgent request but I need to have this setup working as soon as possible and any kind of help debugging this and getting this setup to run would be highly appreciated. Thank you for your time.

Thanks & Regards,
Harsh
Reply all
Reply to author
Forward
0 new messages