Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 10-26-2012, 07:07 AM   #1
LQ Newbie
Registered: Oct 2012
Posts: 3

Rep: Reputation: Disabled
"top" - cross compile for arm or binaries available?

top in busybox isn't as functional as I need it. So I tried to compile "top" from source (
It compiles on my ubuntu, but I couldn't crosscompile it.

make lib64=lib CC=arm-none-linux-gnueabi-gcc gives:
top.c:28: fatal error: curses.h: No such file or directory

while adding the dir with

make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I/usr/include

cc1: warning: include location "/usr/include" is unsafe for cross-compilation
top.c:3385: error: impossible constraint in 'asm'

I have no clue how to solve this issue. Can you help? What am I doing wrong?

Is there maybe a source for Cortex-A8 binaries that I can use - whithout installing a hole new system on my embedded device?

Last edited by ArnoStef; 10-26-2012 at 07:08 AM.
Old 10-26-2012, 07:15 AM   #2
LQ Newbie
Registered: Oct 2012
Posts: 13

Rep: Reputation: Disabled
I am not sure about this
I think you can try below ?
make ARCH=arm CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I/usr/include
it might work.
Old 10-26-2012, 09:22 AM   #3
LQ Newbie
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks AnkurTank

make ARCH=arm CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I/usr/include

will probably use the internal curses lib, which doesn't fit to the architecture. I guess this is the problem.#
And what is about this message:
cc1: warning: include location "/usr/include" is unsafe for cross-compilation

I downloaded ncurses and did
./configure --host=arm-none-linux-gnueabi

then I tried:
make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I../ncurses-5.9/include LDFLAGS=-L../ncurses-5.9/lib


arm-none-linux-gnueabi-gcc -D_GNU_SOURCE -I proc -I../ncurses-5.9/include -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 -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o watch.o watch.c
watch.c:18: fatal error: ncurses.h: No such file or directory

And indeed - there is no ncurse.h in the ncurses-5.9/include path?!?

Last edited by ArnoStef; 10-26-2012 at 09:23 AM.
Old 10-26-2012, 06:36 PM   #4
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904
You will probably need to download either a curses-devel package, or download and build the ncurses package for your target architecture.

gcc is complaining when you point it to local include directories, since those are intended for the native compiler on your build host. I have 4 cross toolchains from various origins and three of them have ncurses.h installed in the sys-root of the toolchain. My ncurses-5.8 installation doesn't seem to have the header file either. I've lost track of whether I installed that package or not, but I wonder if the header file only gets created at install time.
You can re-configure your ncurses source package with the --prefix option, pointing --prefix to a non-system directory, such as the curses source tree itself. Then, make and make install the cross-compiled package. See if it creates an include directory with ncurses.h in it. If so, either copy the contents to the sys-root of your cross toolchain, or point to it with your gcc compiler args.

Another possibility is that since there is probably a curses shared object library on your target host filesystem, you might find the respective ncurses.h there.

And, now that I've looked at the arguments you are using, I wonder if they are correct. CPPFLAGS is typically used for the C preprocessor, but I always add include paths with CFLAGS:
gcc CFLAGS+=-I /some/include/path
--- rod.

Last edited by theNbomr; 10-26-2012 at 06:37 PM.
1 members found this post helpful.
Old 11-05-2012, 08:34 AM   #5
LQ Newbie
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Sorry for the delay in answering - have been ill.
I just compiled ncurses with

./configure --host=arm-none-linux-gnueabi

The missing lncurses.h is indeed created as a link with installing it. So I did this manually.

Additionally I compiled proc-tools with

make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I../ncurses-5.9/include LDFLAGS=-L../ncurses-5.9/lib

Additionally I have to copy the created to the device under test.
The problem now is, that calling top I get:

'vt102': unknown terminal type

Other programms that has been compiled (as free) seem to work fine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compile "poppler-0.10.7" error jeazh Linux - Newbie 2 06-14-2009 10:52 AM
How do you create shortcuts to "folders" and "binaries" in GNOME? ebenh Linux - Desktop 5 01-21-2008 05:28 AM
Where to download precompiled bash binaries, such as "time" and "top"? elinuxqs Linux - Newbie 12 11-14-2005 08:36 PM
Programs don't like "staying on top" or "always on top" -- any help? SBing Linux - Software 8 07-05-2004 04:41 AM

All times are GMT -5. The time now is 05:34 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration