tkn-tub / ns3-gym

ns3-gym - The Playground for Reinforcement Learning in Networking Research
GNU General Public License v2.0
521 stars 197 forks source link

user's python environment issue #4

Closed zhuwenxing closed 5 years ago

zhuwenxing commented 5 years ago

log informations attached as follow .It seems that protoc and protobuf version are incompatible.But i have no idea how to solve it! Here are protoc and protobuf version information :

wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~/ns3-gym$ protoc --version
libprotoc 3.2.0

wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~$ pip install protobuf 
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: protobuf in ./anaconda3/lib/python3.6/site-packages (3.5.2.post1)
Requirement already satisfied: six>=1.9 in ./anaconda3/lib/python3.6/site-packages (from protobuf) (1.10.0)
Requirement already satisfied: setuptools in ./anaconda3/lib/python3.6/site-packages (from protobuf) (36.5.0.post20170921)
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~$ pip install --upgrade protobuf
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting protobuf
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c2/f9/28787754923612ca9bfdffc588daa05580ed70698add063a5629d1a4209d/protobuf-3.6.1-cp36-cp36m-manylinux1_x86_64.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 454kB/s 
Requirement not upgraded as not directly required: setuptools in ./anaconda3/lib/python3.6/site-packages (from protobuf) (36.5.0.post20170921)
Requirement not upgraded as not directly required: six>=1.9 in ./anaconda3/lib/python3.6/site-packages (from protobuf) (1.10.0)
Installing collected packages: protobuf
  Found existing installation: protobuf 3.5.2.post1
    Uninstalling protobuf-3.5.2.post1:
      Successfully uninstalled protobuf-3.5.2.post1
Successfully installed protobuf-3.6.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

informations after ./waf configure

   wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~/ns3-gym$ ./waf configure
    Setting top to                           : /home/wxzhu/ns3-gym 
    Setting out to                           : /home/wxzhu/ns3-gym/build 
    Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
    Checking for cc version                  : 5.4.0 
    Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
    Checking for compilation flag -Wl,--soname=foo support : ok 
    Checking for compilation flag -std=c++11 support       : ok 
    Checking for program 'python'                          : /home/wxzhu/anaconda3/bin/python 
    Checking for python version                            : (3, 6, 2, 'final', 0) 
    python-config                                          : /home/wxzhu/anaconda3/bin/python3.6-config 
    Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes 
    Testing pyembed configuration                                      : Could not build a python embedded interpreter 
    Testing pyembed configuration                                      : Could not build a python embedded interpreter 
    Checking boost includes                                            : 1_58 
    Checking boost libs                                                : ok 
    Checking for boost linkage                                         : ok 
    Checking for click location                                        : not found 
    Checking for program 'pkg-config'                                  : /usr/bin/pkg-config 
    Checking for 'gtk+-2.0' >= 2.12                                    : yes 
    Checking for 'libxml-2.0' >= 2.7                                   : yes 
    Checking for type uint128_t                                        : not found 
    Checking for type __uint128_t                                      : yes 
    Checking high precision implementation                             : 128-bit integer (default) 
    Checking for header stdint.h                                       : yes 
    Checking for header inttypes.h                                     : yes 
    Checking for header sys/inttypes.h                                 : not found 
    Checking for header sys/types.h                                    : yes 
    Checking for header sys/stat.h                                     : yes 
    Checking for header dirent.h                                       : yes 
    Checking for header stdlib.h                                       : yes 
    Checking for header signal.h                                       : yes 
    Checking for header pthread.h                                      : yes 
    Checking for header stdint.h                                       : yes 
    Checking for header inttypes.h                                     : yes 
    Checking for header sys/inttypes.h                                 : not found 
    Checking for library rt                                            : yes 
    Checking for header sys/ioctl.h                                    : yes 
    Checking for header net/if.h                                       : yes 
    Checking for header net/ethernet.h                                 : yes 
    Checking for header linux/if_tun.h                                 : yes 
    Checking for header netpacket/packet.h                             : yes 
    Checking for NSC location                                          : not found 
    Checking for OpenFlow location                                     : not found 
    Checking for library zmq                                           : yes 
    Checking for library protobuf                                      : yes 
    Checking for program 'protoc'                                      : /home/wxzhu/bin/protoc 
    Checking for protoc version                                        : 3.2.0 
    Build ns3gym Protobuf C++ messages                                 : Done 
    Build ns3gym Protobuf Python messages                              : Done 
    Checking for 'sqlite3'                                             : yes 
    Checking for header linux/if_tun.h                                 : yes 
    Checking for program 'sudo'                                        : /usr/bin/sudo 
    Checking for program 'valgrind'                                    : /usr/bin/valgrind 
    Checking for 'gsl'                                                 : not found 
    python-config                                                      : not found 
    Checking for compilation flag -Wno-error=deprecated-d... support   : ok 
    Checking for compilation flag -Wno-error=deprecated-d... support   : ok 
    Checking for compilation flag -fstrict-aliasing support            : ok 
    Checking for compilation flag -fstrict-aliasing support            : ok 
    Checking for compilation flag -Wstrict-aliasing support            : ok 
    Checking for compilation flag -Wstrict-aliasing support            : ok 
    Checking for program 'doxygen'                                     : /usr/bin/doxygen 
    ---- Summary of optional NS-3 features:
    Build profile                 : debug
    Build directory               : 
    BRITE Integration             : not enabled (BRITE not enabled (see option --with-brite))
    DES Metrics event collection  : not enabled (defaults to disabled)
    Emulation FdNetDevice         : enabled
    Examples                      : not enabled (defaults to disabled)
    File descriptor NetDevice     : enabled
    GNU Scientific Library (GSL)  : not enabled (GSL not found)
    Gcrypt library                : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
    GtkConfigStore                : enabled
    MPI Support                   : not enabled (option --enable-mpi not selected)
    NS-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))
    NS-3 OpenFlow Integration     : not enabled (OpenFlow not enabled (see option --with-openflow))
    Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))
    PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
    PyViz visualizer              : not enabled (Python Bindings are needed but not enabled)
    Python Bindings               : not enabled (Python library or headers missing)
    Real Time Simulator           : enabled
    SQlite stats data output      : enabled
    Tap Bridge                    : enabled
    Tap FdNetDevice               : enabled
    Tests                         : not enabled (defaults to disabled)
    Threading Primitives          : enabled
    Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
    XmlIo                         : enabled
    'configure' finished successfully (3.336s)

**

information after ./waf build .errors happend in this step

**

wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~/ns3-gym$ ./waf build
Waf: Entering directory `/home/wxzhu/ns3-gym/build'
[ 910/1889] Compiling scratch/opengym/sim.cc
[ 912/1889] Compiling scratch/linear-mesh-2/mygym.cc
[ 913/1889] Compiling scratch/linear-mesh-2/sim.cc
[ 914/1889] Compiling scratch/rl-tcp/sim.cc
[ 915/1889] Compiling scratch/rl-tcp/tcp-rl.cc
[ 916/1889] Compiling scratch/scratch-simulator.cc
In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/opengym/sim.cc:23:
./ns3/messages.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
./ns3/messages.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
./ns3/messages.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/opengym/sim.cc:23:
./ns3/messages.pb.h:23:35: fatal error: google/protobuf/arena.h: 没有那个文件或目录
compilation terminated.

In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/linear-mesh-2/mygym.h:26,
                 from ../scratch/linear-mesh-2/mygym.cc:21:
./ns3/messages.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
./ns3/messages.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
./ns3/messages.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/linear-mesh-2/mygym.h:26,
                 from ../scratch/linear-mesh-2/mygym.cc:21:
./ns3/messages.pb.h:23:35: fatal error: google/protobuf/arena.h: 没有那个文件或目录
compilation terminated.

In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/linear-mesh-2/sim.cc:24:
./ns3/messages.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
./ns3/messages.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
./ns3/messages.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/linear-mesh-2/sim.cc:24:
./ns3/messages.pb.h:23:35: fatal error: google/protobuf/arena.h: 没有那个文件或目录
compilation terminated.

In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/rl-tcp/tcp-rl.h:9,
                 from ../scratch/rl-tcp/tcp-rl.cc:1:
./ns3/messages.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
./ns3/messages.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
./ns3/messages.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/rl-tcp/tcp-rl.h:9,
                 from ../scratch/rl-tcp/tcp-rl.cc:1:
./ns3/messages.pb.h:23:35: fatal error: google/protobuf/arena.h: 没有那个文件或目录
compilation terminated.

In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/rl-tcp/sim.cc:54:
./ns3/messages.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
./ns3/messages.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
./ns3/messages.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from ./ns3/spaces.h:33:0,
                 from ./ns3/container.h:30,
                 from ./ns3/opengym-module.h:10,
                 from ../scratch/rl-tcp/sim.cc:54:
./ns3/messages.pb.h:23:35: fatal error: google/protobuf/arena.h: 没有那个文件或目录
compilation terminated.

Waf: Leaving directory `/home/wxzhu/ns3-gym/build'
Build failed
 -> task in 'opengym' failed (exit status 1): 
    {task 140473613568600: cxx sim.cc -> sim.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_ZMQ=1', '-DHAVE_PROTOBUF=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/opengym/sim.cc', '-c', '-o', '/home/wxzhu/ns3-gym/build/scratch/opengym/sim.cc.1.o']
 -> task in 'linear-mesh-2' failed (exit status 1): 
    {task 140473613569272: cxx mygym.cc -> mygym.cc.3.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_ZMQ=1', '-DHAVE_PROTOBUF=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/linear-mesh-2/mygym.cc', '-c', '-o', '/home/wxzhu/ns3-gym/build/scratch/linear-mesh-2/mygym.cc.3.o']
 -> task in 'linear-mesh-2' failed (exit status 1): 
    {task 140473613569496: cxx sim.cc -> sim.cc.3.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_ZMQ=1', '-DHAVE_PROTOBUF=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/linear-mesh-2/sim.cc', '-c', '-o', '/home/wxzhu/ns3-gym/build/scratch/linear-mesh-2/sim.cc.3.o']
 -> task in 'rl-tcp' failed (exit status 1): 
    {task 140473613569944: cxx tcp-rl.cc -> tcp-rl.cc.4.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_ZMQ=1', '-DHAVE_PROTOBUF=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/rl-tcp/tcp-rl.cc', '-c', '-o', '/home/wxzhu/ns3-gym/build/scratch/rl-tcp/tcp-rl.cc.4.o']
 -> task in 'rl-tcp' failed (exit status 1): 
    {task 140473613569720: cxx sim.cc -> sim.cc.4.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_ZMQ=1', '-DHAVE_PROTOBUF=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/rl-tcp/sim.cc', '-c', '-o', '/home/wxzhu/ns3-gym/build/scratch/rl-tcp/sim.cc.4.o']
zhuwenxing commented 5 years ago

@huckiyang @pgawlowicz

pgawlowicz commented 5 years ago

check now, but it is problem with your environment so I am closing

zhuwenxing commented 5 years ago

can you give me more specific dependencies and their version!I'm still stuck in the same problem.

zhuwenxing commented 5 years ago

This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer headers. Please update incompatible with your Protocol Buffer headers. Please update your headers.

mchwalisz commented 5 years ago

It is impossible to recognize personal environment issues. You have a mismatch of protobuf from system and conda install.

pgawlowicz commented 5 years ago

Hi, It seems that you have some issues with your conda environment. Probably you have two versions of protocol buffer compilers and two versions of protocol-buffers installed (probably one in conda and one in your host env). And simply messages' definitions are compiled with the version that is not compatible with protocol-buffers used during ns-3 compilation.

Are you sure that you execute both ./waf config and ./waf in conda environment?

Also, make sure to pull the changes from yesterday, as now protoc compiler's path is determined during ./waf config.

BR, Piotr