@@ -34,6 +34,9 @@ if (Qt5Widgets_FOUND)
endif (Qt5Widgets_FOUND)
+find_package(PythonLibs)
+include(${KS_DIR}/build/FindNumPy.cmake)
+
set(LIBRARY_OUTPUT_PATH "${KS_DIR}/lib")
set(EXECUTABLE_OUTPUT_PATH "${KS_DIR}/bin")
@@ -12,7 +12,11 @@ KernelShark has the following external dependencies:
sudo apt-get install freeglut3-dev libxmu-dev libxi-dev -y
sudo apt-get install qtbase5-dev -y
-1.1 I you want to be able to generate Doxygen documentation:
+1.1 I you want to be able to use the NumPu Interface of KernelShark:
+ sudo apt-get install libpython-dev cython -y
+ sudo apt-get install python-numpy python-matplotlib -y
+
+1.2 I you want to be able to generate Doxygen documentation:
sudo apt-get install graphviz doxygen-gui -y
@@ -21,7 +25,11 @@ KernelShark has the following external dependencies:
dnf install freeglut-devel redhat-rpm-config -y
dnf install qt5-qtbase-devel -y
-2.1 I you want to be able to generate Doxygen documentation:
+2.1 I you want to be able to use the NumPu Interface of KernelShark:
+ dnf install python2-devel python-Cython -y
+ dnf install python-numpy python3-matplotlib -y
+
+2.2 I you want to be able to generate Doxygen documentation:
dnf install graphviz doxygen -y
@@ -28,6 +28,25 @@ if (OPENGL_FOUND AND GLUT_FOUND)
endif (OPENGL_FOUND AND GLUT_FOUND)
+if (PYTHONLIBS_FOUND AND CYTHON_FOUND AND NUMPY_FOUND)
+
+ message(STATUS "kshark_wrapper")
+
+ add_library(pykshark STATIC libkshark.c
+ libkshark-model.c
+ libkshark-plugin.c
+ libkshark-configio.c
+ libkshark-collection.c)
+
+ target_compile_options(pykshark PUBLIC "-fPIC")
+
+ target_link_libraries(pykshark ${TRACEEVENT_LIBRARY}
+ ${TRACECMD_LIBRARY}
+ ${CMAKE_DL_LIBS}
+ ${JSONC_LIBRARIES})
+
+endif (PYTHONLIBS_FOUND AND CYTHON_FOUND AND NUMPY_FOUND)
+
if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
message(STATUS "libkshark-gui")
This patch prepares the Cmake build infrastructure for the introduction of a the NumPy interface. We add building of a static version of the C API library to be used by the interface. The NumPy interface itself will be added in the following patches. Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark/CMakeLists.txt | 3 +++ kernel-shark/README | 12 ++++++++++-- kernel-shark/src/CMakeLists.txt | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-)