Closed Forsworns closed 4 years ago
seems that zmq library is not installed
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.
../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?
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
I have recently applied a pull request that replaced the deprecated zmq functions with the new ones: https://github.com/tkn-tub/ns3-gym/commit/19bfe0a583e641142609939a090a09dfc63a095f
Maybe you can revert this commit and check.
I built the repo on Ubuntu16.04 LTS and encountered the same error log as a closed issue:
But I have upgrade to the latest protobuf manually and run
./waf clean
each time before I run./waf configure
.here is my
./waf configure
output,And the
/src/opengym/model/ns3gym/ns3gym/messages_pb2.py
is not generated when I run./waf configure
before. After configuration, I runpip install ./src/opengym/model/ns3gym
and get this error message "Protocol Buffer messages are missing. Please run ./waf configure to generate the file").I removed the
scratch
dir and the other modules are built successfully, exceptopengym
. Do you have any idea why it is not built? I have run./waf clean
before the cofiguration.