Giter Site home page Giter Site logo

Porting to ns 3.36 about ns3-gym HOT 9 OPEN

prototact avatar prototact commented on September 25, 2024 2
Porting to ns 3.36

from ns3-gym.

Comments (9)

pgawlowicz avatar pgawlowicz commented on September 25, 2024 1

Hi Orfeas (@prototact),
Thank you for the provided files. I have applied your changes to the start_sim.py file and pushed it into a new branch.
BR,
Piotr

from ns3-gym.

ahmadmr81 avatar ahmadmr81 commented on September 25, 2024

I second this. I tried installing NS3-Gym in NS3-3.36.1 (including converting wscript files to CMakeLists.txt), but I am facing to many errors while building it.

(Just a note, using NS3-3.35 is OK, however, I am using other tools that are built for NS3-3.36 and it is difficult for me to convert them to work on NS3-3.35)

I hope the developers consider this soon

from ns3-gym.

prototact avatar prototact commented on September 25, 2024

I worked on it a bit, and currently it is good enough. I attach two files, a CMakeLists.txt that needs to be added in the opengym directory and a start_sim script that goes into the opengym/model/ns3gym/ns3gym subdirectory.

opengym-assist.zip

from ns3-gym.

ahmadmr81 avatar ahmadmr81 commented on September 25, 2024

Thank you, prototact, for the files. They were very helpful to me (I am a beginner in the CMake world). However, I still get the same errors:

_> In file included from /home/*******/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/model/opengym_interface.h:26,

             from /home/*******/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/model/opengym_interface.cc:27:

/usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’?
638 | blocky = ZMQ_BLOCKY,
| ^~~~~~~~~~
| ZMQ_NOBLOCK
/usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope
642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope
643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope
644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX,
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’?
645 | max_msgsz = ZMQ_MAX_MSGSZ,
| ^~~~~~~~~~~~~
| ZMQ_MAXMSGSIZE
/usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope
652 | msg_t_size = ZMQ_MSG_T_SIZE
| ^~~~~~~~~~~~~~
In file included from /home//ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/model/opengym_interface.h:26,
from /home/
/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/model/opengym_env.cc:27:
/usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’?
638 | blocky = ZMQ_BLOCKY,
| ^~~~~~~~~~
| ZMQ_NOBLOCK
/usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope
642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope
643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope
644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX,
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’?
645 | max_msgsz = ZMQ_MAX_MSGSZ,
| ^~~~~~~~~~~~~
| ZMQ_MAXMSGSIZE
/usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope
652 | msg_t_size = ZMQ_MSG_T_SIZE
| ^~~~~~~~~~~~~~
make[2]: *** [contrib/opengym/CMakeFiles/libopengym-obj.dir/build.make:115: contrib/opengym/CMakeFiles/libopengym-obj.dir/model/opengym_env.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [contrib/opengym/CMakeFiles/libopengym-obj.dir/build.make:63: contrib/opengym/CMakeFiles/libopengym-obj.dir/model/opengym_interface.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5064: contrib/opengym/CMakeFiles/libopengym-obj.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Finished executing the following commands:
cd cmake-cache; cmake --build . -j 11 ; cd .._

This error happened after I also copied the zmq.hpp file from the ZeroMQ repository.

Anyone is facing these errors? it only occurs with NS3-3.36.x version, not with previous versions (e.g., 3.35)

from ns3-gym.

rukyr97 avatar rukyr97 commented on September 25, 2024

I'm also not succeeding to patch the porting with the examples you provided @prototact
The image below shows the output of ./ns3 configure after moving the files to the directories you mentioned.

image

from ns3-gym.

ahmadmr81 avatar ahmadmr81 commented on September 25, 2024

I'm also not succeeding to patch the porting with the examples you provided @prototact The image below shows the output of ./ns3 configure after moving the files to the directories you mentioned.

Here is the corrected CMakeLists.txt file. @prototact had a couple of missed brackets :) However, NS3-Gym still won't work.

Another point: NS3-Gym requires SQLite to be installed.

from ns3-gym.

rukyr97 avatar rukyr97 commented on September 25, 2024

I'm also not succeeding to patch the porting with the examples you provided @prototact The image below shows the output of ./ns3 configure after moving the files to the directories you mentioned.

Here is the corrected CMakeLists.txt file. @prototact had a couple of missed brackets :) However, NS3-Gym still won't work.

Another point: NS3-Gym requires SQLite to be installed.

Thank you for the quick reply @ahmadmr81 ... I decided to run an older version of ns-3.35 as i have no experience in porting software. I'd be glad to help contributing if someone could provide me some guidelines on how to do it.

from ns3-gym.

mhmd97z avatar mhmd97z commented on September 25, 2024

I have a problem porting the module to ns3.36 even with the two files provided.

I get the following error when I run "./ns3"

../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::internal::WireFormatLite::SkipField(google::protobuf::io::CodedInputStream*, unsigned int)'
../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::MessageLite::ParseFromArray(void const*, int)'
../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::internal::VerifyVersion(int, int, char const*)'

The complete output of "./ns3 build" can be found here.

And in the output of "./ns3 configure" :

-- Processing src/opengym
-- find_external_library: zmq was found.
Protobuf messages generated, good!
Protobuf messages generated, good!
...

More in detail, I have successfully compiled opengym in previous versions of ns3 using waf on the same machine, so I guess there should be sth wrong with new CMake stuff.

from ns3-gym.

rukyr97 avatar rukyr97 commented on September 25, 2024

I have a problem porting the module to ns3.36 even with the two files provided.

I get the following error when I run "./ns3"

../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::internal::WireFormatLite::SkipField(google::protobuf::io::CodedInputStream*, unsigned int)'
../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::MessageLite::ParseFromArray(void const*, int)'
../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../build/lib/libns3.36.1-opengym-default.so: undefined reference to `google::protobuf::internal::VerifyVersion(int, int, char const*)'

The complete output of "./ns3 build" can be found here.

And in the output of "./ns3 configure" :

-- Processing src/opengym
-- find_external_library: zmq was found.
Protobuf messages generated, good!
Protobuf messages generated, good!
...

More in detail, I have successfully compiled opengym in previous versions of ns3 using waf on the same machine, so I guess there should be sth wrong with new CMake stuff.

I opened a new issue but actually im having exactly the same errors...

from ns3-gym.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.