intel/libipt

how to compile tools ? Error dump while making

ysun opened this issue · 1 comments

ysun commented

Hi
I'm investigating CPU feature processor tracing, and happened to find this project and interested in it.
I can build the library successfully, but failed to build tool.
Could you guide me a little bit how to compile the tools such ptdump, pttc, etc, because I got following error:

root@fastrestart-server:~/libipt/ptdump# cmake .
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.13)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /root/libipt/ptdump
root@fastrestart-server:~/libipt/ptdump# make
[ 16%] Building C object CMakeFiles/ptdump.dir/src/ptdump.o
In file included from /root/libipt/ptdump/src/ptdump.c:33:
/usr/local/include/pt_version.h: In function ‘pt_print_tool_version’:
/usr/local/include/pt_version.h:71:18: error: ‘PT_VERSION_MAJOR’ undeclared (first use in this function); did you mean ‘LIBIPT_VERSION_MAJOR’?
   71 |   /* .major = */ PT_VERSION_MAJOR,
      |                  ^~~~~~~~~~~~~~~~
      |                  LIBIPT_VERSION_MAJOR
/usr/local/include/pt_version.h:71:18: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/include/pt_version.h:72:18: error: ‘PT_VERSION_MINOR’ undeclared (first use in this function); did you mean ‘LIBIPT_VERSION_MINOR’?
   72 |   /* .minor = */ PT_VERSION_MINOR,
      |                  ^~~~~~~~~~~~~~~~
      |                  LIBIPT_VERSION_MINOR
/usr/local/include/pt_version.h:73:18: error: ‘PT_VERSION_PATCH’ undeclared (first use in this function); did you mean ‘LIBIPT_VERSION_PATCH’?
   73 |   /* .patch = */ PT_VERSION_PATCH,
      |                  ^~~~~~~~~~~~~~~~
      |                  LIBIPT_VERSION_PATCH
/usr/local/include/pt_version.h:74:18: error: ‘PT_VERSION_BUILD’ undeclared (first use in this function); did you mean ‘PT_VERSION_H’?
   74 |   /* .build = */ PT_VERSION_BUILD,
      |                  ^~~~~~~~~~~~~~~~
      |                  PT_VERSION_H
/usr/local/include/pt_version.h:75:16: error: ‘PT_VERSION_EXT’ undeclared (first use in this function); did you mean ‘PT_VERSION_H’?
   75 |   /* .ext = */ PT_VERSION_EXT
      |                ^~~~~~~~~~~~~~
      |                PT_VERSION_H
make[2]: *** [CMakeFiles/ptdump.dir/build.make:63: CMakeFiles/ptdump.dir/src/ptdump.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/ptdump.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

You'd enable ptdump in the top-level cmakefile.