C Compiler, how to install?
I got the Omega2 today. It is really a very nice board! Exactly what I was searching for!
I have already developped a bunch of C software on some RasPis written and tested in C. So I only want to compile it, not test it, on the Omega2.
- The tutorial how to install a Cross Compiler fails.
- I found some links about the mt7688 CPU and I am using Ubuntu64 (and Win64), but I was not able to install c working Cross Compiler (e.g on http://wiki.seeedstudio.com/wiki/LinkIt_Smart_7688 et al..)
- The Onion Cloud Compiler seems to stall (and also only accepts ZIP files from Linux, NOT WIN64 files)...
Thanks for your help! Jo
WereCatf last edited by
@Jo-Wickenh You can grab a cross-compiler at https://dl.dropboxusercontent.com/u/11811685/lede-toolchain-ramips-mt7688_gcc-5.4.0_musl-1.1.15.Linux-x86_64.tar.bz2
I have downloaded and expanded on (my Ubuntu64 14.04 ) the cross-compiler from https://dl.dropboxusercontent.com/u/11811685/lede-toolchain-ramips-mt7688_gcc-5.4.0_musl-1.1.15.Linux-x86_64.tar.bz2 .
But I dont see, how to use it? I'm not an expert in OpenWRT or LEDE, but I have good knowlede in (Embedded) C.
Please, could you be so kind to give me help to compile at least a simple 'printf("Hello World\n") C program? Everything else (Omega2 with PHP7) is running.
Thank you very much... JO
"Hello World" now running!
Maybe it helps anybody, this is what I did:
After re-installing a new Ubuntu64 16.04 LTS from osboxes (running von a VMware Player on my PC), I extracted the cross-compiler to a directory "~/on" , renanamed the two top tirectories to "lt" and "tc". Then I startet "osboxes@osboxes:~$ gedit .profile" and added the these lines at the end:
Now I can compile "mipsel-openwrt-linux-gcc hello.c", transfer "a.out" with WinSCP to my Onion2, set attributes to executable (can be done in WinSCP) and start "./a.out" via Console.
PS.: A more complex software with USB, TCP, threads did compile and run without any problems same way.
no2gmo no last edited by
This link no longer works, can you provide a new link?
I do not want to compile my own toolchain as instructed here https://docs.onion.io/omega2-docs/cross-compiling.html since the build has too many dependencies on stuff I do not want to install.
Just follow LEDE instructions (Omega2 OS is a fork of LEDE):
- Download SDK from https://downloads.lede-project.org/releases/17.01.4/targets/ramips/mt7688/
- Unpack, enter, run: make menuconfig
- In menu "Global Build Settings" unselect ALL (including "Cryptographically sign package list"
- Exit menu (saving config)
- Run: make (or make -j4 or make -j9 depending on how meny CPUs/Cores you have)
Voila, you got working SDK buildroot for ramips MT7688 (Omega2) Rest is the same as all others cross-compile buildroots (export env STAGING_DIR as $BUILDROOT/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/, export PATH with STAGING_DIR as first in chain, etc).
If using e.g. make, remember to use variables for corss-compile:
If you need configuration for IDEs (like Netbeans) let me know. All you need to do is setup new configuration with custom paths to buildroot compilators.
P.S. In future, remember to NOT download and use buildroots/SDKs from unofficial sources like dropbox, etc, it's a big security risk.