Giter Site home page Giter Site logo

Comments (4)

pgawlowicz avatar pgawlowicz commented on May 23, 2024

seems that zmq library is not installed

from ns3-gym.

Forsworns avatar Forsworns commented on May 23, 2024

seems that zmq library is not installed

Thanks. I directly used apt-get to install the zmq as the README. And it told me that the libzmq5 has been installed so I didn't notice the library zmq is not found during building.

Note, selecting 'libzmq3-dev' instead of 'libzmq5-dev'
libzmq5 is already the newest version (4.1.4-7ubuntu0.1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libzmq3-dev : Depends: libzmq5 (= 4.1.4-7) but 4.1.4-7ubuntu0.1 is to be installed
E: Unable to correct problems, you have held broken packages.

So I degrade the libzmq5 to 4.1.4-7 and runsudo apt install libzmq5-dev again. The apt-get told me that the libzmq3-dev is selected instead of libzmq5-dev. I check the packages in the ubuntu source. They didn't supply the libzmq5-dev package. It's kinda weird... Do you use another apt source? Like the PPA of protobuf.

And I also check the source codes of the team zeromq on the Github, I cannot find a repo labeled by version 5.


Building your source with libzmq3-dev throws the following errors.

The first one is that the ByteSize() is deprecated, so I replace them to ByteSizeLong() as recommended in the opengym_interface.cc. It works. I think maybe you should replace them, too, since it is an error from google::protobuf.

../src/opengym/model/opengym_interface.cc:258:69: error: ‘int google::protobuf::MessageLite::ByteSize() const’ is deprecated: Please use ByteSizeLong() instead [-Werror=deprecated-declarations]
   envStateMsg.SerializeToArray(request.data(), envStateMsg.ByteSize());

The second one maybe comes from the libzmq3-dev.

I just found this error is the same as another opening issue.

../src/opengym/model/opengym_interface.cc: In member function ‘void ns3::OpenGymInterface::Init()’:
../src/opengym/model/opengym_interface.cc:192:36: error: ‘zmq::send_flags’ has not been declared
   m_zmq_socket.send (request, zmq::send_flags::none);
                                    ^~~~~~~~~~
../src/opengym/model/opengym_interface.cc:197:41: error: ‘zmq::recv_flags’ has not been declared
   (void) m_zmq_socket.recv (reply, zmq::recv_flags::none);
                                         ^~~~~~~~~~
../src/opengym/model/opengym_interface.cc: In member function ‘void ns3::OpenGymInterface::NotifyCurrentState()’:
../src/opengym/model/opengym_interface.cc:259:36: error: ‘zmq::send_flags’ has not been declared
   m_zmq_socket.send (request, zmq::send_flags::none);
                                    ^~~~~~~~~~
../src/opengym/model/opengym_interface.cc:264:41: error: ‘zmq::recv_flags’ has not been declared
   (void) m_zmq_socket.recv (reply, zmq::recv_flags::none);

The zmq::recv_flags is not declared.
Do you have any ideas about this?

from ns3-gym.

Forsworns avatar Forsworns commented on May 23, 2024

In fact, I'm working on using DRL in ns3 these days, too. So I really appreciate your marvellous jobs on creating gym environments for ns3.

Since I cannot build your files these days, I found another interesting way to use the existing python DRL source codes in ns3. It origins from the document of the waf tool.

I simply modified the wscript of the ns3, such that the python scripts can be embedded in to the cpp files as described in Python document.

def options(opt):
    # options provided by the modules
    opt.load('compiler_c')
    opt.load('compiler_cxx')
    opt.load('cflags')
    opt.load('gnu_dirs')
    opt.load('python') # add this command
    # other commands

def create_ns3_program(bld, name, dependencies=('core',)):
    program = bld(features='cxx cxxprogram pyembed') # modify here
    program.is_ns3_program = True
    program.name = name

:) But sure, if I can use your framework, my code would be much more readable, considering that embedding python files into the cpp is too ugly, XD

from ns3-gym.

pgawlowicz avatar pgawlowicz commented on May 23, 2024

I have recently applied a pull request that replaced the deprecated zmq functions with the new ones:
19bfe0a

Maybe you can revert this commit and check.

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.