Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install from requirements #6

Open
beraldoleal opened this issue Sep 15, 2017 · 2 comments
Open

Failed to install from requirements #6

beraldoleal opened this issue Sep 15, 2017 · 2 comments

Comments

@beraldoleal
Copy link

Hi Guys, Looks like cc1plus is a dependency to run ofp_sniffer.

I'm getting the following error when installing with pip3.6 install docs/requirements.txt:

  creating build
  creating build/temp.linux-x86_64-3.6
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-RxRqwq/python3.6-3.6.1~rc1=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c pcapdumper.cc -o build/temp.linux-x86_64-3.6/pcapdumper.o
  x86_64-linux-gnu-gcc: error trying to exec 'cc1plus': execvp: No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for pcapy
  Running setup.py clean for pcapy
Successfully built termcolor
Failed to build pcapy
Installing collected packages: termcolor, netaddr, pcapy
  Running setup.py install for pcapy ... error
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s93lfkh3/pcapy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-7mfewe1k-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pcapy' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-RxRqwq/python3.6-3.6.1~rc1=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c pcapdumper.cc -o build/temp.linux-x86_64-3.6/pcapdumper.o
    x86_64-linux-gnu-gcc: error trying to exec 'cc1plus': execvp: No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s93lfkh3/pcapy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-7mfewe1k-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-s93lfkh3/pcapy/
@beraldoleal
Copy link
Author

The same for Python.h:

pcapdumper.cc:10:10: fatal error: Python.h: No such file or directory

@viniarck
Copy link
Member

viniarck commented Sep 16, 2017

@beraldoleal It turns out that pcapy relies on a lower-level library libpcap-dev to be built. Since ofp_sniffer has this OS-level dependency, probably the most convenient way to ship the code is with Docker. I'll talk to AmLight dev guys to start shipping with Docker.

I wrote a prototype with a minimal set of dependencies and ofp_sniffer is working fine inside a container, note on docker-compose that I'm using network_mode: host, in order to have full visibility of the networking stack. You can grab the docker-compose file and Dockerfile from this branch on my repo;

https://github.com/viniciusarcanjo/ofp_sniffer/commit/3e6205b99164f70371176481b6c83bad366df7f2

Inside the container:

root@volos:/opt/ofp_sniffer# python3.6 ofp_sniffer.py -i lo
Sniffing device lo
Packet #1 - 2017-09-16 22:37:47.638290 127.0.0.1:6633 -> 127.0.0.1:50032 Size: 122 Bytes
OpenFlow Version: 1.0(1) Type: OFPT_STATS_REQUEST(16) Length: 56  XID: 3514162067
StatReq Type: Flow(OFPST_FLOW)
Match - wildcards: 0x3fffff
StatReq Table_id: 255 Pad: 0 Out_Port: None(0xFFFF)

Packet #2 - 2017-09-16 22:37:47.641140 127.0.0.1:50032 -> 127.0.0.1:6633 Size: 174 Bytes
OpenFlow Version: 1.0(1) Type: OFPT_STATS_REPLY(17) Length: 108  XID: 3514162067
StatRes Type: Flow(1)
StatRes Length: 96 Table_id: 0 Pad: 0
StatRes Match - wildcards: 0x3820fb dl_src: ee:ee:ee:ee:ee:02
StatRes duration_sec: 3, duration_nsec: 756000000, priority: 50001, idle_timeout: 0, hard_timeout: 0, pad: 0, cookie: 0, packet_count: 0, byte_count: 0
StatRes Action - Type: OUTPUT Length: 8 Port: Controller(0xFFFD) Max Length: 65535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants