Board index FlightGear Support Compiling

Compiling on an outdated Linux with mixed runtimes  Topic is solved

Building FlightGear from source, and in the need for help?

Compiling on an outdated Linux with mixed runtimes

Postby AthasianGladiator » Fri Sep 23, 2022 4:02 am

Hi all.

I have known about FlightGear for many years but am just getting around to trying it.

I am not able to use a linux package manager, or the AppImage, to run Flightgear because both my distribution and c++ runtime are severely out of date. I have not updated my machine for a number of reasons, the primary one being, once I get things working, I usually just want to leave it alone! I have updated my kernel and a few security related things, but most of my system is sitting around 2014 somewhere. I've kept it going for a long time. This, as well as being excited about the project and possibly wanting to contribute, has led me to try and compile on this machine.

The distribution is a very dated Arch Linux install, with most packages on it having been compiled by gcc4.8.0. I had updated my compiler years ago to build a project that needed C++11 support, but it was not necessary for me to update the C++ runtime at that time (this was pre-gcc5.0). In order to compile FlightGear, I have built and installed gcc7.1.0 and a libstdc++ from that same version in a non-standard directory.

I am trying to build the 2020.3.12 versions of simgear and flightgear (I used git-archive from my local repo and put the source in the eventual game directory, as explained on the wiki). It was necessary for me to update boost and OSG in order to get through the simgear compile. I did have those libraries already, but the versions lacked things needed to compile simgear. I thought I did my best to configure them to use the new runtime, but I am not sure if I did things correctly. In a nutshell, I have been able to compile simgear successfully (although all of the tests fail). When I move on to flightgear, I get to about 20% and it fails, I believe because I am not specifying the new runtime correctly, and many of my shared libs are using the old runtime. With the exceptions of OSG and boost, all of the other dependencies are present on my machine, although built years ago with an older gcc version (and using my standard system runtime!).

My first problem was that I was not specifying the gcc macro (_GLIBCXX_USE_CXX11_ABI=0) to use the old ABI, so I went back and recompiled the updated boost, OSG, simgear, and with all that done, flightgear failed again with a different, although similar error. Googling at the time made me realize it had not been trying to link to the appropriate runtime, but I deleted all of my builds (so unfortunately I don't have the exact error message). After several late, bleary-eyed nights at the computer, when my wife and kids were in bed, I had added so many things to my CMakeCache in hacky attempts to get running that I decided to give it a rest until I knew if this was even possible.

Before I try again, I am wondering if I need to forget about all of the current dependencies that already exist, and recompile everything with my new build chain (after I figure out how to properly configure the non-standard-location libstdc++), or if I am just misconfiguring my new builds of OSG and boost, or if this will not even be possible in this trashed environment. I am positive I could go back to an older version of the code and get it compiled without issues, but I was pretty intent on trying the latest stable version.

Do I even need to use the libstdc++ from my gcc7.1.0 or is simply using the gcc7.1.0 version of the compiler enough? (I am also specifying -std=c++17 btw)

What are the failed simgear tests (make test) telling me?

Is it possible to have shared libraries and the simgear/flightgear stuff using different c++ runtimes if they are using the same ABI?

Has anyone tried compiling in a situation like this?

I'm just a little lost at this point and looking for a nudge in the right direction. With my new family responsibilities, I am definitely considering a move to a more pain-free setup, but it would be nice to get everything working on the existing install. Thanks.
AthasianGladiator
 
Posts: 3
Joined: Fri Sep 23, 2022 3:16 am

Re: Compiling on an outdated Linux with mixed runtimes  

Postby TheEagle » Fri Sep 23, 2022 1:58 pm

Compiling with libraries in a non-standard location is definitely possible although a pain in the arse ! :wink: I've been doing that myself. As for mixing C++ runtimes, I don't know about that - never done it myself - but it's not a good idea, and I don't think it'll work. In any case, from what your described, your time is much better invested in installing an up-to-date distro, with one C++ runtime ! ;)

P.S.: the -std=c++17 is wrong IMO - rather try -std=c++11
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Compiling on an outdated Linux with mixed runtimes

Postby AthasianGladiator » Sun Sep 25, 2022 5:21 am

Hi Eagle.

Thank you for the response! And success!

When you mentioned C++11 may be all that is necessary, I decided to try again using an older version of the compiler (thankfully avoiding the ABI mismatch nonsense).

I still hit my original error (missing C++ runtime symbols when compiling fg) that had originally led me down the libstdc++ rabbit hole, but it turns out I was not setting LD_LIBRARY_PATH correctly to the version installed alongside my compiler (I had made a standalone build of the libstdc++, which was not necessary since I had one sitting alongside my compiler!). Once I updated LD_LIBRARY_PATH to use the version of libstdc++ with my non-standard-compiler, everything was smooth sailing.

For anyone interested, I was able to use gcc4.9.4 to compile 2020.3.12. I can now move on to learning how to fly!

Thanks again! :D
AthasianGladiator
 
Posts: 3
Joined: Fri Sep 23, 2022 3:16 am

Re: Compiling on an outdated Linux with mixed runtimes

Postby TheEagle » Sun Sep 25, 2022 1:56 pm

Cool, I didn't expect that ! :mrgreen: Please do not forget to mar this topic as solved ! ;)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests