Jump to content


Photo

Help to compile to enigma boxes


  • Please log in to reply
13 replies to this topic

#1 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 4 May 2020 - 15:17

I'd like to know how can I compile C++ code to work on a enigma box.

 

If I compile it on ubuntu bash ( g++ test12.cpp -o test12 ) , this "test12" file doesn't work on enigma command line.

 

I don't want to create a full image, I only want to know how to get an executable cmdline file (mips, arm..) from .cpp files.

 


Enigma is getting old....

 

Spoiler

Re: Help to compile to enigma boxes #2 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 4 May 2020 - 16:15

The normal compiler on your PC creates x86 code which don't run on other architectures like arm, mips,....

 

There are 2 possibilities.

- Try to download a cross compiler for your Linux distribution which creates arm, mips,... code.

- Set up the OpenPLi build environment. You don't need to build complete image, but at least the compilers.


Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Help to compile to enigma boxes #3 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 4 May 2020 - 16:45

Thanks,

 

But on possibilities...

 

1 - Do you know, which one should I dowload for Ubuntu 18.04.4 LTS ?

2 - I don't know how to do it.... (no complete image, just compilers)

 

this commands build complete image...

 

git clone git:...

MACHINE=xxXXXX make

MACHINE=xxXXXX make image

 

how to build just compilers ??


Edited by jpuigs, 4 May 2020 - 16:47.

Enigma is getting old....

 

Spoiler

Re: Help to compile to enigma boxes #4 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 4 May 2020 - 19:23

I would build only 1 package like ofgwrite. It don't need much other packages.

MACHINE=xxXXXX make image
<wait a few minutes>
Ctrl+c
cd build
source env.source
MACHINE=xxXXXX bitbake ofgwrite

But still you need to find the g++ binaries which is not very easy. When I want to call strip manually I use "find build/tmp/ -type f -name "*strip"

 

Maybe this is easier:

https://unix.stackex...on-ubuntu-18-04


Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Help to compile to enigma boxes #5 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 4 May 2020 - 22:51

Thanks.

I'll try.....


Enigma is getting old....

 

Spoiler

Re: Help to compile to enigma boxes #6 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 6 May 2020 - 23:11

As an alternative you can create your build env on Ubuntu for example then build the `packagegroup-core-buildessential` and install the packagegourp on your machine, then you will be able  to use the machine as any other linux with gcc, cpp make, autools, etc.

Because the packagegroup-core-buildessential install a lot of stuff you will want to install apache on that Ubuntu and create your own feed/repo to do an easy install.


Edited by serdeliuk, 6 May 2020 - 23:14.

init 2 && init 3


Re: Help to compile to enigma boxes #7 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 7 May 2020 - 12:38

OK. Thanks.

But at this moment I don't still need any build env. on ubuntu.

Let me start with easy things., then I'll change to more complex ones...

 

Now the only thing I want to start with, is to be able to compile a simple program to be executed on console on  enigma boxes (arm, mips) like this....

#include<iostream> 
 
using namespace std;
 
int main()
{
    cout<<"Hello Enigma";
     
    return 0;
}

Enigma is getting old....

 

Spoiler

Re: Help to compile to enigma boxes #8 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 12:52

In few words you have only two options, on the one hand is to cross-compile your code or to compile the code directly on the machine.

 

In both situations you need to cross-compile something your code or development tools, depends on what situation fit your needs.

 

I prefer to build directly on my machine so i have builded my development tools under OpenPli and installed them on my machine, this way the development and testing is easier as i do not need to install the new version every few minutes :)

 

However, if you decide to create a bitbake recipe and cross compile your app you will not build an entire image but only your recipe, and probably some additional packages required during the build process, but this is only once.

 

Also, at the end you will need to build a recipe to provide a package to the enduser anyway...


init 2 && init 3


Re: Help to compile to enigma boxes #9 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 7 May 2020 - 16:55

ok, thanks.


Enigma is getting old....

 

Spoiler

Re: Help to compile to enigma boxes #10 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 17:00

You're welcome, i was looking into how to directly cross compile a .c file with existing tools without requirement of a .bb recipe but is prety complicated as the bitbake tools create a whole environment for this.

So you will need a recipe, if you do not know to build a starting one i can create one for you just to have you started as an example.


init 2 && init 3


Re: Help to compile to enigma boxes #11 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 7 May 2020 - 19:35

Yes, please, it'd help a lot.


Enigma is getting old....

 

Spoiler

Re: Help to compile to enigma boxes #12 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 8 May 2020 - 13:53

Yes, please, it'd help a lot.

 

Hello, i have created a github repo for you to download  https://github.com/serdeliuk/sdltest

 

This repo contain a bitbake recipe and some .c files used by me to create a ipk package during my SDL2 testes

To build the recipe as is you need to clone the repo in an existing meta from your openembedded tree and run 

bitbake sdltest 

You should be able to modify the recipe and add your own files link your own libraries and so on, should be a good point to start

If you have any issues just let me know.


init 2 && init 3


Re: Help to compile to enigma boxes #13 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 8 May 2020 - 14:23

or another solution, linaro C compilers, i am using mingw version on Windows to compile simple .c code, like "Hello World" for my armhf box

https://releases.lin...inux-gnueabihf/



Re: Help to compile to enigma boxes #14 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 8 May 2020 - 16:09

Hello, i have created a github repo for you to download  https://github.com/serdeliuk/sdltest

 

This repo contain a bitbake recipe and some .c files used by me to create a ipk package during my SDL2 testes

To build the recipe as is you need to clone the repo in an existing meta from your openembedded tree and run 

bitbake sdltest 

You should be able to modify the recipe and add your own files link your own libraries and so on, should be a good point to start

If you have any issues just let me know.

 

 

Thank you very much.

I've already cloned this repo on my pc.

I'll start to do some tests soon.

Now I know how to start,,,,,

 

 

or another solution, linaro C compilers, i am using mingw version on Windows to compile simple .c code, like "Hello World" for my armhf box

https://releases.lin...inux-gnueabihf/

Thank You, it's good to know, as I use windows more than ubuntu.


Enigma is getting old....

 

Spoiler


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users