CAIDA / pybgpstream

Python bindings for BGPStream
https://bgpstream.caida.org
BSD 2-Clause "Simplified" License
28 stars 22 forks source link

pip install on FreeBSD doesn't work #17

Open tomsparks opened 4 years ago

tomsparks commented 4 years ago

I'm guessing this has to do with pybgpstream not using /usr/local/{lib,include}, similar to issue #96 for bgpstream (https://github.com/CAIDA/bgpstream/issues/96)

pip install pybgpstream

Collecting pybgpstream Using cached https://files.pythonhosted.org/packages/26/9e/d174e153e0b6afb28af13e7da06529ba98bee5d92f53b7dc67a61f0b5977/pybgpstream-1.2.3.tar.gz Installing collected packages: pybgpstream Running setup.py install for pybgpstream ... error Complete output from command /usr/local/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-install-dc3323ob/pybgpstream/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-record-r6yei02p/install-record.txt --single-version-externally-managed --compile: running install running build running build_ext building '_pybgpstream' extension creating build creating build/temp.freebsd-12.0-RELEASE-p3-amd64-3.6 creating build/temp.freebsd-12.0-RELEASE-p3-amd64-3.6/src cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -I/usr/local/include /usr/include -I/usr/local/include/python3.6m -c src/_pybgpstream_module.c -o build/temp.freebsd-12.0-RELEASE-p3-amd64-3.6/src/_pybgpstream_module.o In file included from src/_pybgpstream_module.c:24: src/_pybgpstream_bgpelem.h:27:10: fatal error: 'bgpstream_elem.h' file not found

include "bgpstream_elem.h"

         ^~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1

----------------------------------------

Command "/usr/local/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-install-dc3323ob/pybgpstream/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-record-r6yei02p/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-dc3323ob/pybgpstream/

alistairking commented 4 years ago

It's possible that the solution I suggested in #96 will solve this problem too, otherwise you should be able to use the method described at https://bgpstream.caida.org/docs/install/pybgpstream to explicitly specify the install location:

pip install \
    --global-option build_ext \
    --global-option '--include-dir=/usr/local/include' \
    --global-option '--library-dir=/usr/local/lib' \
    pybgpstream
tomsparks commented 4 years ago

Yep, your suggestion does seem to work. I'll see if I can turn that into a port as well.