Board index FlightGear Development

Build FlightGear on Termux

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Build FlightGear on Termux

Postby fervi » Fri Mar 10, 2023 12:49 pm

Hello

I sometimes play with the desire to transfer applications to Termux. Termux is a Linux environment running on top of Android (can be likened a bit to Cygwin).

I managed to compile plib and openscenegraph. Unfortunately I am unable to compile simgear. It would be nice if someone would be willing to help prepare patches, as I am not an expert in C++ - I can compile the code and possibly implement very minor fixes.

It would be nice if someone could be found to help with the project. Overall from a fairly general design brief:
- We are building FlightGear 2020.3.17.
- Compiler: Clang 14.0.7
- Parameters: -DENABLE_SIMD=OFF
https://wiki.termux.com/wiki/Differences_from_Linux

https://0bin.net/paste/mBau51Wc#DcXqArr ... 7kz8gnQ1dz
fervi
 
Posts: 12
Joined: Sun Oct 06, 2019 11:17 pm

Re: Build FlightGear on Termux

Postby Hooray » Fri Mar 10, 2023 1:14 pm

Hi,

a few folks have previously tried to buid (parts of) FG on lower-end hardware - so you should be able to find quite a bit of relevant info by browsing the forum/devel list archives or by browsing the wiki.

I believe, one of the more recent efforts was building a subset of FG on RPi, others have previously tinkered with Android specifically however.

So, my suggestion would be to create a corresponding wiki page and document your journey to get more people involved.

Speaking in general, it might make sense to provide patches to the project to allow FG to be build on more platforms like these, even if that should mean disabling certain portions of the build altogether (aka feature toggles) - the point being, a number of core devs are currently in the process of porting FG as a whole in order NOT to use fixed function OpenGL, and early experiments also involved simply disabling offending code in a "brute force" manner by excluding it from compilation using #ifdef macros.

For some background reading, I'd suggest these articles (in the given order):

https://wiki.flightgear.org/OpenGL#Status
https://wiki.flightgear.org/FlightGear_ ... re_Profile
https://wiki.flightgear.org/FlightGear_and_old_hardware
https://wiki.flightgear.org/Howto:Optim ... le_devices

While some of these articles may seem a little outdated or unrelated in scope, they are more relevant than you may think - because at the end of the day, all these efforts/people were working towards the same goal of making FG more portable, better configurable to expose more build/startup and runtime options.

In particular, Edward (bugman on the forum) has been working on this as part of his unit testing effort, specifically:
https://wiki.flightgear.org/FlightGear_Headless
https://wiki.flightgear.org/Cppunit_effort

There also is a long-term effort to make more and more subsystems better configurable, and ultimately, OPTIONAL:
https://wiki.flightgear.org/Howto:Reset ... leshooting
To support different types of GPUs, see: https://wiki.flightgear.org/Graphics_card_profiles

PS: Most of the log file you shared is merely reporting warnings (that are due to compiler flags), but there are few actual errors, and these would seem to be a configuration issue - if in doubt, I'd check whether your compiler can be configured to build the C++ version used by the SG/FG sources - in general, there are very few actual errors in your log - according to $SG_SRC/CMakeLists.txt, SG now uses C++17, so you will want to be sure that this is also supported by your build environment. A good starting point might be to only build the sources inside the Compositor directory in SimGear, since those templates seem to be causing most of your issues. Also, according to the line numbers in your log, you are not using the latest SG/FG checkouts ?
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Build FlightGear on Termux

Postby fervi » Fri Mar 10, 2023 2:26 pm

> PS: Most of the log file you shared is merely reporting warnings (that are due to compiler flags), but there are few actual errors, and these would seem to be a configuration issue - if in doubt, I'd check whether your compiler can be configured to build the C++ version used by the SG/FG sources - in general, there are very few actual errors in your log - according to $SG_SRC/CMakeLists.txt, SG now uses C++17, so you will want to be sure that this is also supported by your build environment. A good starting point might be to only build the sources inside the Compositor directory in SimGear, since those templates seem to be causing most of your issues. Also, according to the line numbers in your log, you are not using the latest SG/FG checkouts ?

No, I use stable one from SF, from release:
https://sourceforge.net/projects/flight ... se-2020.3/

Maybe I will try with the development version actually.
fervi
 
Posts: 12
Joined: Sun Oct 06, 2019 11:17 pm

Re: Build FlightGear on Termux

Postby fervi » Fri Mar 10, 2023 9:48 pm

@Hooray

Now I try to compile Flightgear. I don't know if I'm blind, but I don't see any information as to why fgrcc doesn't compile, but the binaries aren't there.
https://0bin.net/paste/2H7AnlAD#WoiOEnD ... jkIKAPQsuY
fervi
 
Posts: 12
Joined: Sun Oct 06, 2019 11:17 pm

Re: Build FlightGear on Termux

Postby Hooray » Sat Mar 11, 2023 8:35 am

you should be able to just run "make fgrcc" directly from the top level build directory - there should also be a cmake log file telling if if and why it's not being built.
In general, I would suggest to tackle these errors like this, i.e. one by one, because there's otherwise too much stuff going on. Basically, solve one problem after the other.

The other thing I noticed is that you are using ninja via cmake, I am not sure if that's a recent addition or not, but I am also not sure whether that's supposed to be fully working already. If in doubt, I'd just use conventional makefiles - or get in touch with the folks on the devel list, to check back there whether ninja is supposed to be working or not.

Basically, tackle these things one by one and try to use a standard build first, you should only be using some of the more esoteric options once a default build works properly

Apart from that, on android you can disable some of the heavier options like the Qt5 based UI/launcher, since that's unlikely to work anyway - and it should save you quite some time/hassle getting things to work

Overall, the build config looks pretty good to me though - you seem to have most of the required stuff working just fine, so it's probably going to be pretty seamless
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Build FlightGear on Termux

Postby wkitty42 » Sat Mar 11, 2023 10:58 am

IIRC, fgrcc requires access to FGData so it can gather the resource strings it will be compiling for FG to use... so be sure you have updated to the latest FGData on the same branch before you try to compile FG and its tools... of course also be sure you are pointing the compiler to said FGData when it reaches the point of compiling fgrcc...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Build FlightGear on Termux

Postby wkitty42 » Sat Mar 11, 2023 10:59 am

Hooray wrote in Sat Mar 11, 2023 8:35 am:or get in touch with the folks on the devel list, to check back there whether ninja is supposed to be working or not.

IIRC ninja was recently added and should be working... at least on the next branch... probably not on stable, yet...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Build FlightGear on Termux

Postby Hooray » Sat Mar 11, 2023 11:46 am

wkitty42 wrote in Sat Mar 11, 2023 10:58 am:IIRC, fgrcc requires access to FGData so it can gather the resource strings it will be compiling for FG to use... so be sure you have updated to the latest FGData on the same branch before you try to compile FG and its tools... of course also be sure you are pointing the compiler to said FGData when it reaches the point of compiling fgrcc...


is that really the case ?
I didn't know that, and I don't even think I have $FG_ROOT set up for cmake to pick up where my fgdata is.
So I would be very surprised if fgrcc can find my fgdata checkout.

I was under the impression that those resource strings live inside $FG_SRC - it would be a little weird in my opinion to have an implicit dependency on fgdata without the build system/us knowing about that ??

I suppose rominet/Florent would be able to tell us for sure though :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Build FlightGear on Termux

Postby wkitty42 » Sat Mar 11, 2023 1:09 pm

the dns script had to be changed up to pull FGData before compiling FG for exactly this fgrcc reason... previous to the addition of fgrcc, dnc pulled FGData after FG was compiled...

IIRC those strings did live in FG_SRC but were moved to make it easier for the language translators to do their work, submit it upstream, and have those changes included in the build... it used to be that they were copied over to FG_SRC for inclusion during compiling... this change eliminated the copying step and made things easier to work with...

i would have to dig back through my archives to see exactly when this change took place but it was a year or three back, at least...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Build FlightGear on Termux

Postby Hooray » Sat Mar 11, 2023 1:54 pm

based on grepping through $FG_SRC/EmbeddedResources and based on glacing over fgrcc.cxx I really don't see anything suggesting this sort of workflow - but again, I might be wrong.
Either way, even if I am wrong, that would not block the creation/compilation of the fgrcc executable itself, would it !? :wink:
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Build FlightGear on Termux

Postby wkitty42 » Sat Mar 11, 2023 3:43 pm

Hooray wrote in Sat Mar 11, 2023 1:54 pm:Either way, even if I am wrong, that would not block the creation/compilation of the fgrcc executable itself, would it !? :wink:

if they are includes and can't be found? i don't know how it works... i just remember the change... i'll try to find the discussion later and then hunt it down on SF to give a link to you...

edit: oh wait... if the translation files can't be found, the interface defaults to english so yeah, that shouldn't stop fgrcc from being compiled...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Build FlightGear on Termux

Postby Hooray » Sat Mar 11, 2023 4:00 pm

I believe the next logical step is trying to build just fgrrc directly, and then take it from there step by step - ideally, without using ninja - we shouldn't be encouraging people to use some of the more esoterical build options when troubleshooting problems, especially when trying to cross-compile/port fgfs.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Build FlightGear on Termux

Postby wkitty42 » Sun Mar 12, 2023 1:02 pm

Hooray wrote in Sat Mar 11, 2023 4:00 pm:[...] ideally, without using ninja [...]

agreed... especially since it has only just recently been added (to NEXT AIUI) by request and AFAIK only one person, the original requester, is even looking at using it...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Build FlightGear on Termux

Postby Hooray » Sun Mar 12, 2023 1:08 pm

the thing is, fgrcc not being built despite missing sounds like a sure build system issue, so it doesn't make sense to use new/untested build methods on a new system/build environment
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Build FlightGear on Termux

Postby rominet » Sun Mar 12, 2023 2:50 pm

Hi,

In the very first incarnation of fgrcc, passing the location of FGData when building FG was indeed required, however this only lasted a few days, and that was only in next. So, as Hooray guessed, passing -DFG_DATA_DIR to CMake when building FG, or even simply having FGData, is not required. The reason why download_and_compile.sh fetches and updates FGData before building FG is because this allows the correct translations to be embedded in the fgfs executable when built with Qt support (for the built-in launcher).

Using Ninja to build FG with download_and_compile.sh works fine for me (cf. the -G, aka --build-system-generator option), however I've only tried this very recently, a handful of times. It's the only sane way in my case to build FG with the Clang compiler (with Make, when building with 'CC=clang CXX=clang++', only one CPU core is used—go figure).

The usual problem when people fail to build fgrcc lies in the library path settings: fgrcc must be linked with the same zlib library that SimGear is linked to.
rominet
 
Posts: 605
Joined: Sat Nov 01, 2014 2:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 12 guests