namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
3.05k stars 473 forks source link

Build problem #350

Closed casionwoo closed 6 years ago

casionwoo commented 6 years ago

Hello

I want to try this tracing tool on my work. So I cloned and tried to build based on README.md file.

but when I typed make, I got an error like below:

image

My work environment is non-native linux, I'm working on parallels on mac. Please let me know if there's something that i missed..

namhyung commented 6 years ago

Thanks for using uftrace and reporting the bug. There was a typo when there's no libncursesw on the system. The following patch should fix it.

diff --git a/cmd-tui.c b/cmd-tui.c
index f3976f0d..35b6f340 100644
--- a/cmd-tui.c
+++ b/cmd-tui.c
@@ -1910,7 +1910,9 @@ int command_tui(int argc, char *argv[], struct opts *opts)

 #else /* !HAVE_LIBNCURSES */

-int comamnd_tui(int argc, char *argv[], struct opts *opts)
+#include "utils/utils.h"
+
+int command_tui(int argc, char *argv[], struct opts *opts)
 {
        pr_warn("TUI is not implemented (libncurses.so is missing)");
        return 0;
honggyukim commented 6 years ago

I also suggest you to install the necessary packages before compilation as described in QUICK installation guide. (I assume that you use ubuntu)

$ sudo apt-get install libelf-dev           # mandatory
$ sudo apt-get install pandoc               # for man pages (optional)
$ sudo apt-get install libpython2.7-dev     # for python scripting (optional)
$ sudo apt-get install libncursesw5-dev     # for TUI (optional)

I also think that you better build uftrace in a new repository. You may have some problems building the recent uftrace after updating it to newest one.

$ git clone https://github.com/namhyung/uftrace.git
$ cd uftrace
$ make
$ sudo make install