commx / python-rrdtool

Python bindings for rrdtool
GNU Lesser General Public License v2.1
77 stars 25 forks source link

Installation with pip fails if libraries are anywhere other than /usr/ #38

Open darksidelemm opened 3 years ago

darksidelemm commented 3 years ago

Describe the bug The tests performed during pip install, which attempt to build a small amount of source code including rrd.h only use /usr/include/ and /usr/lib/ as include and lib directories. Under OSX / Macports, these directories should be /opt/local/include and /opt/local/lib . As a result, rrdtool cannot be installed via pip within a Macports system.

Collecting rrdtool
  Using cached rrdtool-0.1.15.tar.gz (21 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/darkside/Dev/kiwisnr/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-install-47rqsze7/rrdtool/setup.py'"'"'; __file__='"'"'/private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-install-47rqsze7/rrdtool/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-pip-egg-info-qwj88vz5
         cwd: /private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-install-47rqsze7/rrdtool/
    Complete output (5 lines):
    /var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/tmp_python_rrdtool0a8kjkfx/test_rrdtool.c:2:10: fatal error: 'rrd.h' file not found
    #include <rrd.h>
             ^~~~~~~
    1 error generated.
    Error: Unable to compile the binary module. Do you have the rrdtool header and libraries installed?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

To Reproduce Steps to reproduce the behaviour:

Desktop (please complete the following information):

darksidelemm commented 3 years ago

I should note that just adding on /opt/local/include and /opt/local/lib into the relevant variables in setup.py made this build just fine on my system, but i'm unsure if that will work on systems where those directories do not exist.