Go Down

Topic: gcc on linino? (Read 16181 times) previous topic - next topic

SPlatten

I would like to use gcc to build a jni library, can I install gcc?

How?

Thank you,
Kind Regards,
Sy

noblepepper

You can cross compile a program on a linux host system, transfer it to your Yun and run it on Linino. Since the newest Yun image is based on Attitude Adjustment this SDK should work with no problems now. It worked for most things on the old image as well.
http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2

SPlatten

Thank you, will investigate.
Kind Regards,
Sy

SPlatten

#3
May 01, 2014, 01:57 pm Last Edit: May 01, 2014, 01:59 pm by SPlatten Reason: 1
I've been trying to build the toolchain in:
Linux ubuntu 3.13.0-24-generic #46-Ubuntu SMP

I've been following the instructions at:
https://github.com/todbot/blink1/tree/master/openwrt

But I'm getting and error when I try to execute:
Code: [Select]

sudo make tools/install


The error is:
Code: [Select]

Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'perl'... ok.
Checking '/usr/bin/python2.7'... ok.
Checking 'wget'... ok.
Checking 'git'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
Checking 'non-root'... failed.

Build dependency: Please do not compile as root.

Prerequisite check failed. Use FORCE=1 to override.
make[2]: *** [tmp/.prereq-build] Error 1
make[1]: *** [prereq] Error 2
make: *** [tools/install] Error 2


Maybe because I'm prefixing the make with sudo, but if I don't then it won't build at all and the error displayed is:
Code: [Select]

make[2]: *** [tmp/.prereq-build] Error 1
make[1]: *** [prereq] Error 2
make: *** [tools/install] Error 2
simon@ubuntu:~/linino/trunk$ uname -a
Linux ubuntu 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
simon@ubuntu:~/linino/trunk$ make FORCE=1 tools/install
rm: cannot remove '/home/simon/linino/trunk/tmp/info/.files-packageinfo-3546': Permission denied
make[3]: *** No rule to make target `/home/simon/linino/trunk/tmp/info/.files-packageinfo-3910'.  Stop.
cat: /home/simon/linino/trunk/tmp/info/.files-packageinfo-3910: No such file or directory
rm: cannot remove '/home/simon/linino/trunk/tmp/info/.files-packageinfo.stamp.e2acf987b494d5dae9ced9f8732e751f': Permission denied
touch: cannot touch '/home/simon/linino/trunk/tmp/info/.files-packageinfo.stamp.d41d8cd98f00b204e9800998ecf8427e': Permission denied
touch: cannot touch '/home/simon/linino/trunk/tmp/info/.files-packageinfo.stamp': Permission denied
make[2]: *** [/home/simon/linino/trunk/tmp/info/.files-packageinfo.stamp] Error 1
make[1]: *** [prepare-tmpinfo] Error 2
make: *** [tools/install] Error 2


Any ideas?
Kind Regards,
Sy

sonnyyu

#4
May 01, 2014, 02:01 pm Last Edit: May 01, 2014, 02:04 pm by sonnyyu Reason: 1
Quote
Checking 'non-root'... failed.


remove sudo and try it again.

Quote
Permission denied


Code: [Select]
sudo chown  username:username -R /home/username

SPlatten

That did the trick...thank you.
Kind Regards,
Sy

SPlatten

Next problem whilst working through:
https://github.com/todbot/blink1/tree/master/openwrt

Code: [Select]

    % cd ~/projects/linino/trunk
    % cd package
    % ln ~/projects/blink1/openwrt blink1


I don't see a blink1 file or folder anywhere.
Kind Regards,
Sy

sonnyyu

#7
May 01, 2014, 05:40 pm Last Edit: May 01, 2014, 05:42 pm by sonnyyu Reason: 1
Why not use official  openwrt-yun source:

https://github.com/arduino/openwrt-yun

http://forum.arduino.cc/index.php?topic=235489.msg1699935#msg1699935

after build complete.

Code: [Select]
make menuconfig

compile toolchain and SDK:



SPlatten

Thank you, I'll give it a go.
Kind Regards,
Sy

SPlatten

Are they're any guides or tutorials on how to use the toolchain to build and target applications for the Yun?
Kind Regards,
Sy

noblepepper

#10
May 01, 2014, 11:04 pm Last Edit: May 02, 2014, 12:27 am by noblepepper Reason: 1
There is little about the Yun that is not normal OpenWrt stuff. Most of the unique things are in Python.

Here are the OpenWrt guides:
http://wiki.openwrt.org/doc/start#developing
http://wiki.openwrt.org/doc/devel/crosscompile
http://wiki.openwrt.org/doc/devel/packages
This tutorial is my favorite setup:
http://downloads.openwrt.org/docs/eclipse.pdf
You get full source level debugging!

For linux programs that use configure and make this post has an example:
http://forum.arduino.cc/index.php?topic=237050.msg1704929#msg1704929

SPlatten

Thank you very much, will go through those.
Kind Regards,
Sy

SPlatten

I left the system building overnight, this morning I found it had stopped with an error:
Code: [Select]

checking for gpgme-config... failed
configure: error: GPGME 1.0.0 or later needed
make[3]: *** [/home/simon/OpenWrt-yun/build_dir/linux-ar71xx_generic/opkg-618/.configured_yyyy] Error 1
make[3]: Leaving directory `/home/simon/OpenWrt-yun/package/opkg'
make[2]: *** [package/opkg/compile] Error 2
make[2]: Leaving directory `/home/simon/OpenWrt-yun'
make[1]: *** [/home/simon/OpenWrt-yun/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/simon/OpenWrt-yun'
make: *** [world] Error 2


I followed the instructions at:
https://github.com/arduino/openwrt-yun

Any clues?
Kind Regards,
Sy

sonnyyu

#13
May 02, 2014, 07:53 am Last Edit: May 02, 2014, 08:05 am by sonnyyu Reason: 1
The instructions has  two ways ssh/git or ssl/https. Which way you are following?

The output of

Code: [Select]
cat /proc/cpuinfo |grep processor

SPlatten

From this link:
https://github.com/arduino/openwrt-yun

Followed instructions from 'How to build' down.
Code: [Select]

simon@ubuntu:~/OpenWrt-yun$ cat /proc/cpuinfo |grep processor
processor : 0
processor : 1
processor : 2
processor : 3

Kind Regards,
Sy

Go Up