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

get_rss.h is not found when building wheel via pip #1

Closed
kamakazikamikaze opened this issue Mar 16, 2022 · 6 comments
Closed

get_rss.h is not found when building wheel via pip #1

kamakazikamikaze opened this issue Mar 16, 2022 · 6 comments

Comments

@kamakazikamikaze
Copy link

  • pymemtrace version: 0.1.1
  • Python version: 3.10.2 (custom build with debug symbols via pyenv)
  • pip version: 22.0.3
  • Operating System: Ubuntu 20.04 LTS/macOS 11.6.4

Description

Attempting to install via pip fails with an error messages that get_rss.h is not found.

What I Did

pip install pymemtrace

Collecting pymemtrace
  Downloading pymemtrace-0.1.1.tar.gz (368 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 368.9/368.9 KB 8.7 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting psutil
  Downloading psutil-5.9.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (281 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 281.4/281.4 KB 13.3 MB/s eta 0:00:00
Building wheels for collected packages: pymemtrace
  Building wheel for pymemtrace (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [71 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10-pydebug
      creating build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      copying pymemtrace/redirect_stdout.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      copying pymemtrace/parse_dtrace_output.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      copying pymemtrace/trace_malloc.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      copying pymemtrace/process.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      copying pymemtrace/__init__.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      copying pymemtrace/debug_malloc_stats.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace
      creating build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/_test_redirect_stdout.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/test_cMemLeak.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/test_trace_malloc.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/test_debug_malloc_stats.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/test_settrace.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/__init__.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      copying tests/test_process.py -> build/lib.linux-x86_64-3.10-pydebug/tests
      creating build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/ex_memory_exercise.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/ex_dtrace.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/ex_debug_malloc_stats.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/ex_cPyMemTrace.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/ex_trace_malloc.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/__init__.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/example.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      copying pymemtrace/examples/ex_process.py -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/examples
      running egg_info
      writing pymemtrace.egg-info/PKG-INFO
      writing dependency_links to pymemtrace.egg-info/dependency_links.txt
      writing requirements to pymemtrace.egg-info/requires.txt
      writing top-level names to pymemtrace.egg-info/top_level.txt
      reading manifest file 'pymemtrace.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '__pycache__' found under directory '*'
      warning: no previously-included files matching '*.py[co]' found under directory '*'
      warning: no files found matching '*.jpg' under directory 'docs'
      warning: no files found matching '*.gif' under directory 'docs'
      adding license file 'LICENSE'
      adding license file 'AUTHORS.rst'
      writing manifest file 'pymemtrace.egg-info/SOURCES.txt'
      creating build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src
      creating build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/c
      copying pymemtrace/src/c/get_rss.c -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/c
      copying pymemtrace/src/c/pymemtrace_util.c -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/c
      creating build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy
      copying pymemtrace/src/cpy/cCustom.c -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy
      copying pymemtrace/src/cpy/cMemLeak.c -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy
      copying pymemtrace/src/cpy/cPyMemTrace.c -> build/lib.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy
      warning: build_py: byte-compiling is disabled, skipping.
      
      running build_ext
      building 'pymemtrace.custom' extension
      creating build/temp.linux-x86_64-3.10-pydebug
      creating build/temp.linux-x86_64-3.10-pydebug/pymemtrace
      creating build/temp.linux-x86_64-3.10-pydebug/pymemtrace/src
      creating build/temp.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy
      gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -O0 -fPIC -I/usr/local/include -I/home/kent/.local/share/virtualenvs/easysnmp-pjIEyjUo/include -I/home/kent/.pyenv/versions/3.10.2-debug/include/python3.10d -c pymemtrace/src/cpy/cCustom.c -o build/temp.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy/cCustom.o -Wall -Wextra -Werror -Wfatal-errors -Wpedantic -std=c99 -O3 -UDEBUG -DNDEBUG
      gcc -pthread -shared -L/home/kent/.pyenv/versions/3.10.2-debug/lib -L/home/kent/.pyenv/versions/3.10.2-debug/lib build/temp.linux-x86_64-3.10-pydebug/pymemtrace/src/cpy/cCustom.o -L/tmp/pip-install-bxvk3sjm/pymemtrace_0e42696c61954c1985585d5d93a56d7a -o build/lib.linux-x86_64-3.10-pydebug/pymemtrace/custom.cpython-310d-x86_64-linux-gnu.so
      building 'pymemtrace.cPyMemTrace' extension
      creating build/temp.linux-x86_64-3.10-pydebug/pymemtrace/src/c
      gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -O0 -fPIC -I/usr/local/include -Ipymemtrace/src/include -I/home/kent/.local/share/virtualenvs/easysnmp-pjIEyjUo/include -I/home/kent/.pyenv/versions/3.10.2-debug/include/python3.10d -c pymemtrace/src/c/get_rss.c -o build/temp.linux-x86_64-3.10-pydebug/pymemtrace/src/c/get_rss.o -Wall -Wextra -Werror -Wfatal-errors -Wpedantic -std=c99 -O3 -UDEBUG -DNDEBUG
      pymemtrace/src/c/get_rss.c:14:10: fatal error: get_rss.h: No such file or directory
         14 | #include "get_rss.h"
            |          ^~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
@paulross
Copy link
Owner

Thanks for the report. I have uploaded version 0.1.3 to PyPi with a fix to the source distribution to include the header files.

@kamakazikamikaze
Copy link
Author

Thanks for doing that! While I have you here, is this mostly intended to be run on macOS? I tried compiling from source and GCC complained about missing header files that seem to not be available on Linux anymore (libproc-dev has been replaced by libprocps-dev). Didn't want to open issues in the future for problems specific to an operating system that isn't meant to be supported here.

@kamakazikamikaze
Copy link
Author

Thanks for the report. I have uploaded version 0.1.3 to PyPi with a fix to the source distribution to include the header files.

Also, just wanted to confirm that v0.1.3 installed just fine on macOS (Big Sur) via pip

@paulross
Copy link
Owner

Hi, no it is not really meant to be Mac OS specific, that was just my platform of interest. It would be nice if it were cross platform so please open any Linux issues, or create a PR. Thanks!

@kamakazikamikaze
Copy link
Author

Understood, thanks!

@paulross
Copy link
Owner

I have uploaded version 0.1.4 with some header file changes that were preventing it from building on Linux.
Let me know if you have any further problems and thanks for the report.

paulross added a commit that referenced this issue Oct 18, 2024
…read. This makes sure that the line number is whitespace seperated not sometimes "foo#1" or "foo #1".
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