LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Listing threads: procps cross compile issue (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/listing-threads-procps-cross-compile-issue-919122/)

Ajay Kumar 12-16-2011 05:04 PM

Listing threads: procps cross compile issue
 
Hi, I want to list the user space threads in ps output. The busybox ps command doesn't have the option to list the threads. So I am trying to cross compile procps and port ps onto the target board (OMAP L138 based eXp board with ARM core and Davinci code base). But it fails during compilation. Here is the command I run and few lines from the compile time errors.

procps-3.2.8# make CC=arm-none-linux-gnueabi-gcc CPPFLAGS= lib64=lib m64=

arm-none-linux-gnueabi-gcc -D_GNU_SOURCE -I proc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s -c -o top.o top.c
top.c:28:20: error: curses.h: No such file or directory
top.c:38:18: error: term.h: No such file or directory
top.c:72: error: 'COLOR_RED' undeclared here (not in a function)
top.c:72: error: 'COLOR_YELLOW' undeclared here (not in a function)
top.c:72: error: 'COLOR_CYAN' undeclared here (not in a function)
top.c:72: error: 'COLOR_WHITE' undeclared here (not in a function)
top.c:72: error: 'COLOR_MAGENTA' undeclared here (not in a function)
top.c:72: error: 'COLOR_BLUE' undeclared here (not in a function)
top.c:72: error: 'COLOR_GREEN' undeclared here (not in a function)
top.c:72: warning: missing initializer
top.c:72: warning: (near initialization for 'Rc.win')
top.c: In function 'tg2':
top.c:316: warning: implicit declaration of function 'tgoto'
top.c:316: error: 'cursor_address' undeclared (first use in this function)
top.c:316: error: (Each undeclared identifier is reported only once
top.c:316: error: for each function it appears in.)
top.c:316: warning: pointer/integer type mismatch in conditional expression

Here it fails while building top. so was I even trying to modify the Makefile to remove other binaries and keep only ps. But I am surprised I didn't see any reference to ps in the list of targets.
As expected I see the threads under /proc. Is an alternative to list threads in an embedded Linux environment?

cnxsoft 12-17-2011 12:33 AM

You should specify ncurses library include path in your CFLAGS and the libs in LDFLAGS.

Ajay Kumar 12-19-2011 10:29 AM

Thanks cnxsoft. It worked after the changes you have suggested.
I searched for the include path for 'curses.h' in the IDE for the target and also found the library path there. Thanks again. :)


All times are GMT -5. The time now is 12:06 PM.