Board index FlightGear Release candidates 3.2

Single-command FlightGear compilation for Linux

This is the archive of topics about the 3.2 release candidates.

Single-command FlightGear compilation for Linux

Postby Tomaskom » Tue Sep 16, 2014 8:12 pm

Yesterday I got tired of always compiling FlightGear manually, while installing everything in a custom folder isolated from any previous versions etc... Making sure you have the cmake configuration commands right with all the environment variables required by the custom installation directory is nothing you want to do very often.

So I created a bash script for doing it all with a single command :). This makes it much easier to test any new RC/release or even GIT. The installation of everything (including the dependency libraries from OpenSceneGraph and Simgear) is within one folder anywhere you wish and have write access, you don't need root rights to perform this. Uninstalling is as simple as deleting that single folder. Of course you might want to symlink your aircraft and scenery folders (or change this in your launcher).
You need to feed it the uncompressed folders with source files and fgdata.
One of the outputs is a script which is usable in place of the fgfs executable, it contains all the evironment variables needed for this self-contained installation to run and passes all command line arguments to the fgfs binary.


Get the script here: http://pastebin.com/h85DxvwT

Instructions (as containd in a comment in the script itself):
Code: Select all
# User-friendly single-command FlightGear compilation for Linux
# by Tomaskom
#
# This bash script handles everything needed to compile FlightGear
# as a standalone isolated installation, not colliding with any other
# FlightGear version possibly already present on the system. Everything
# is handled automatically without any user interaction and knowledge
# of the build system. The whole installation (FlightGear + its
# dependency libraries from the OpenSceneGraph and Simgear packages) is
# contained within a single folder and can be "uninstalled" simply by
# deleting it.
#
# The user must however already have some dependencies installed on
# the system, including:
# make automake cmake gcc gcc-c++ boost-devel freeglut-devel plib-devel
# openal-soft-devel (package names may slightly vary on your distro)
#
# All the user needs to supply as the input are the uncompressed folders
# with Flightgear, OpenSceneGraph and Simgear sources, together with the
# fgdata folder containing the FlightGear-data package. The folders must
# be placed in the same folder as this script and their names must be
# assigned to the variables below. To my knowledge, the Simgear version
# must exactly match the Flightgear version, OpenSceneGraph needs to be
# present in the same version or higher.
# Flightgear is installed to a newly created folder (its name is
# assigned to the INST_D variable). Don't create this folder manually,
# or the process will fail. This is to prevent overwriting any existing
# data. To restart after a failed attempt, simply delete that folder.
#
# At the end, a script usable as the fgfs executable for the just
# installed FlightGear version is created.
# The process will stop upon any error, and can be completely stopped by
# using the Ctrl+C (interrupt) signal at any time as well.
Last edited by Tomaskom on Wed Sep 17, 2014 8:16 pm, edited 2 times in total.
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: Single-command FlightGear compilation for Linux

Postby Hooray » Tue Sep 16, 2014 8:17 pm

Anybody interested in scripting compilation should better contribute to this: http://wiki.flightgear.org/Scripted_Com ... ian/Ubuntu
And eventually, all such efforts should end up being ported to the superbuild: http://wiki.flightgear.org/Superbuild
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: Single-command FlightGear compilation for Linux

Postby Tomaskom » Tue Sep 16, 2014 8:39 pm

Hooray wrote in Tue Sep 16, 2014 8:17 pm:Anybody interested in scripting compilation should better contribute to this: http://wiki.flightgear.org/Scripted_Com ... ian/Ubuntu
And eventually, all such efforts should end up being ported to the superbuild: http://wiki.flightgear.org/Superbuild

Just for clarification, this was developed and tested on openSUSE 13.1 but is written in such a way that it should work basically anywhere (as long as you provide the dependencies).

The superbuild looks like an interesting thing, I didn't know about its existence. However, it probably already contains some code that does the same job.
Why is it not promoted more? Is it user-friendly enough to be usable by someone who has no idea about compiling anything? The only way of downloading it is git, so I guess not... :?
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: Single-command FlightGear compilation for Linux

Postby Hooray » Tue Sep 16, 2014 9:10 pm

the superbuild is intended to be used by developers obviously, so it makes sense to use developer tools like git/cmake - the good thing is that the whole thing can be platform-independent like this, so you don't need to understand everything to copy & paste this into a shell and start the build.
But we need more people to help with testing this, and to report back any issues with the superbuild at the tracker
In the long term, this could mean that we can get rid of all custom scripts and provide a single solution for building FG - which would also greatly help with CI/regression testing, because setting up a build server (jenkins) would become fairly straightforward - equally, packaging a release can be greatly simplified, too
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: Single-command FlightGear compilation for Linux

Postby Tomaskom » Tue Sep 16, 2014 9:21 pm

OK, now I get the idea :). And I'm really happy to hear about aiming towards Jenkins and CI :D
My intensions here were different - to help those Linux users, who are not very familiar with building stuff, easily build latest RC and help with testing ;)
And what is most important, without interfereing with their curent "production" version.
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: Single-command FlightGear compilation for Linux

Postby Hooray » Tue Sep 16, 2014 10:09 pm

we've seen several of these efforts, the most popular one being brisa's d&c script - and I've also written several build scripts for different distros - but in the long term, it really is better if people could contribute to a single script, which could eventually be used for improving the cmake supebuild - the d&c script is for example specific to debian-based distros, but another contributor used it create a rpm (redhat fedora/centos) script - while it would have been better to unify things and come up with a single script. While shell scripting works well enought, it is generally better really use a top-level makefile - and the good thing about cmake is that these things can actually be multi-platform.
Thus, it's a good idea to test the superbuild, provide feedback - or maybe even patches/fixes to make it work on your platform. Anybody familiar with VMs (virtualization) can easily test the whole thing under different distros and keep it running over night and then report errors via the issue tracker.
In the long term, the superbuild could then also be extended to support other tools (like TerraGear !) or separate branches, like poweroftwo's osgEarth branch.
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: Single-command FlightGear compilation for Linux

Postby Tomaskom » Tue Sep 16, 2014 11:40 pm

I'm not that familiar with cmake - I'm just a user, meaning I can build things with it, but I never created any cmake setup. But that might change as I will be deploying some multiplatform C++/Qt software soon :wink:
I just used the tools I'm familiar with, the main goal was to ease the procedure I found myself doing often. But you're absolutely right in that sense of not recreating multiple versions of something with similar functionality and instead focusing on the superbuild.

About the script, I edited it a bit to resolve wrong library referencing in the generated executable script for running the standalone fg installation.
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: Single-command FlightGear compilation for Linux

Postby Hooray » Wed Sep 17, 2014 7:50 am

The superbuild is basically the reason why FG now requires cmake 2.8 - which supports the notion of an ExternalProject_Add() directive. This can automatically run commands to download sources and compile them in the proper order - including even running subversion/git clone etc - all this in a cross-platform fashion that is not just specific to a single shell/linux distro :D

As you can probably tell by now, it makes absolutely sense to unify all existing scripts and port those over time, so that the superbuild is getting better.

http://www.cmake.org/cmake/help/v2.8.10 ... nalProject

As you can see in the fgmeta repo (top-level CMakeListst.txt), adding a new dependency will typically require 10-15 lines: https://gitorious.org/fg/fgmeta/source/ ... s.txt#L174

So MUCH better than any shell scripts :mrgreen:
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: Single-command FlightGear compilation for Linux

Postby Tomaskom » Wed Sep 17, 2014 8:07 pm

Uploaded improved version (same link) - will now work on both 64 and 32bit systems, also the location where compilation occurs has been moved out of the folders with source code to the installation folder. When successful, this location is cleaned up. The source folders are left intact, with one exception: fgdata contents are moved (not copied) to the installation because it is much faster and doesn't occupy additional space. But this is done only if all the build and install steps are successful.
I also listed one additional dependency I discovered after testing it on a system with no prior FG installation.
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)


Return to 3.2

Who is online

Users browsing this forum: No registered users and 0 guests