amzn / hawktracer

HawkTracer is a highly portable, low-overhead, configurable profiling tool built in Amazon Video for getting performance metrics from low-end devices.
MIT License
133 stars 31 forks source link

Python bindings not working #94

Open bcm0 opened 1 year ago

bcm0 commented 1 year ago

I like to give hawktracer a try but how do I install python bindings? cmake builds the bindings but it can't find the python interpreter. Setting PYTHONPATH fails and I get ModuleNotFoundError: No module named 'hawktracer'

loganek commented 1 year ago

Hi @bcm0, thanks a lot for your interest. Could you please provide a bit more details about how do you compile/attempt to run the application and what are the errors? That'd help us debug the problem and provide a solution. Many thanks.

bcm0 commented 1 year ago

Thanks a lot for your reply. How do you run the python bindings? What are the next steps?

$ mkdir build 
$ cd build
$ cmake -DENABLE_PYTHON_BINDINGS=ON ..
CMake Warning (dev) at cmake/documentation.cmake:32 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:78 (include)
This warning is for project developers.  Use -Wno-dev to suppress it. 

$ cmake --build . 
hawktracer/parser/include/hawktracer/parser/stream.hpp:28:21: error: 'uint8_t' has not been declared
   28 |     bool read_value(uint8_t& value)
hawktracer/parser/include/hawktracer/parser/stream.hpp:5:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
    4 | #include <string>
  +++ |+#include <cstdint>

$ cmake --build . 
hawktracer/client/tracepoint_map.cpp:56:54: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?

$ cmake --build . 
[100%] Built target python_bindings_hawktracer.core