How to install gcc
-
@Johan-Simons If you can tell me the version of Linux you are using I can create the SDK for you.
-
@Justin-Sowers The Omega (or most OpenWRT devices for that matter) has very limited computational resources, so people don't generally compile anything directly on them, which is probably why you are unable to find packages that allow you to install build tools. However, things like
make
andautoconf
are just binaries that can you compiled from source. So if you want to compile it for the Omega, it's simply a matter of creating aMakefile
in your cross-compile environment and build anopkg
package out of them.
-
@Boken-Lin I read the post from @Justin-Sowers as meaning he wanted to be able to do the build actually on the Omega itself having made more space available via the overlay method. Though I'm sure you could give a more definitive response to this, it would seem to me that this would not be possible, not because of (disk) storage space but because of RAM limitations.
Any comments?
-
@Kit-Bishop RAM is definitely a limitation. However, I think if he sets up a swap partition on the USB drive it might just work.
-
@Boken-Lin Setting up a swap partition should help there. Any suggestions as to how to go about this on the Omega? If not, I will have a look myself to see if I can figure something out.
That would just leave the need to have access to Omega packages etc. for gcc, make etc. and any other needed utils.
-
@Kit-Bishop Yeah, it should be pretty straight forward. Remember
/etc/config/fstab
from setting up rootfs? You just need to add a few more lines to enable swap:For swap partition
config 'swap' option device 'sda1' option uuid 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
Swap file
config 'swap' option device '/mnt/shared/swap'
Swap device by label (mkswap -L swap /dev/sdb2)
config 'swap' option label 'swap'
Save the file and reboot.
-
@Boken-Lin Thanks - I'll give it a try.
Since I already use my USB device for /overlay, presumably I will need to re-partition my USB drive with two partitions:- An ext4 partition for /overlay
- A swap partition for swap
Any suggestions as to what would be a suitable size for the swap partition?
Also, once all details are ironed out, perhaps the details should be made the subject of a Wiki tutorial (with reference too to the usage of the USB drive for overlay and swap)
-
@Kit-Bishop You can try a swap of 512MB, it should be enough for compilation purposes.
And yup, I will write up a separate tutorial for that.
-
@Boken-Lin I have had a try at setting up swap on a USB drive partition and believe it is actually working. My Omega still works fine after the steps I describe below and as shown below I believe I have the expected swap space. Note in the steps I describe below I wanted to maintain a partition on the USB drive for overlay.
Steps I have performed and some associated information are:
- Partitioned my USB drive with 2 partitions as follows:
- Partition 1: 100MByte partitioned as linuxswap
- Partition 2: Rest of drive as ext4 partition for overlay
- Performed the steps necessary to use partition 2 for /overlay directory
- Resultant /etc/config/fstab is:
config 'global'
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
config 'swap'
option device 'sda1'
option uuid 'b1b4771d-fc9c-4cc9-811d-04f4f8a8925d'
option enabled '1'config 'mount'
option target '/overlay'
option uuid 'b2580ec6-6d9f-4514-930a-df481be20b99'
option enabled '1'
4. Output from the free command before setting up the swap was:
total used free shared buffers
Mem: 61180 27184 33996 92 3484
-/+ buffers: 23700 37480
Swap: 0 0 0
5. Output from the free command after setting up the swap is:
total used free shared buffers
Mem: 61180 28092 33088 92 3644
-/+ buffers: 24448 36732
Swap: 1028124 0 1028124
This seems to indicate that swap is operative
- Partitioned my USB drive with 2 partitions as follows:
-
@Boken-Lin
I am using CentOS 6.5
Getting a specific toolchain would be great
thx
-
@Boken-Lin
Hi there, is there any progress on the issue of a toolchain for 32bit CentOS 6.5 ???
thx
-
Hi @Johan-Simons, please download the SDK Here: https://s3-us-west-2.amazonaws.com/onion-downloads/openwrt/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2.
The Toolchain is here: https://s3-us-west-2.amazonaws.com/onion-downloads/openwrt/OpenWrt-Toolchain-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2Cheers!
-
@Boken-Lin said:
Hi @Johan-Simons, please download the SDK Here: https://s3-us-west-2.amazonaws.com/onion-downloads/openwrt/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2.
The Toolchain is here: https://s3-us-west-2.amazonaws.com/onion-downloads/openwrt/OpenWrt-Toolchain-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2Cheers!
It is working, thx for the solution
-
@Johan-Simons Awesome!
-
@Kit-Bishop @Boken-Lin Could you write-up a quick guide to setting-up a swap partition? I think the bones are in this thread, but not the full guide. I have compiled make, m4, and autoconf from source on the Omega, and have successfully installed them, as well as a few other pieces of software. However, building and running bigger tools like SWIG, likely needs swap. I intend to use SWIG to generate a Ruby extension for the C++ new-gpio lib. BtW, other than running a little slow, the Omega is a fine build machine.
-
@Justin-Sowers I will write a quick guide for this and post it here in a .pdf file - keep watching.
@Boken-Lin When I have done the guide, would it be a suitable candidate for a Wiki Tutorial?
-
@Justin-Sowers @Boken-Lin I have created a new post (https://community.onion.io/topic/533/using-linux-swap-space-on-the-omega) that contains the guide.
Hope it is useful.
-
@Kit-Bishop then how can you compile a C program ? can you explain it to me please ?
-
@Ahmed-Mkadem I compile C/C++ using cross compilation on a Linux system (I use Kubuntu).
Some details can be found at https://community.onion.io/topic/9/how-to-install-gcc/22You may also be interested in the set of C++ libraries and programs I have produced for perfroming GPIO, I2C and Arduino access on the Omega. The full set of these can be found at https://github.com/KitBishop/Omega-GPIO-I2C-Arduino The various documentation .pdf files therein give more details.
You might in particular look at the template program that is included in the above referenced package - see https://github.com/KitBishop/Omega-GPIO-I2C-Arduino/tree/master/iotemplate and its documentation at https://github.com/KitBishop/Omega-GPIO-I2C-Arduino/blob/master/iotemplate/iotemplate.pdf
Hope that helps
-
@Kit-Bishop Thank you !! this is helpful