Scripted Compilation on Linux Debian/Ubuntu: Difference between revisions

spelling, capitalization, verbiage - consistency
(Rebecca applied debug/buildtype patches and added build new cmake feature along with additional distro packages needed to build cmake)
(spelling, capitalization, verbiage - consistency)
Line 1: Line 1:
The following script takes care of downloading and compiling FlightGear from the git repositories with just one command execution for both 32-bit and 64-bit Debian based systems (Debian, Ubuntu). Pre-existing installed version (if any) of FlightGear are not touched at all since the script builds and installs everything under the directory in which it is launched. You can choose between building all or only specific tools and applications. For redhat-based systems (Fedora, CentOS) you may want to check out [[CentOS]].
The following script takes care of downloading and compiling FlightGear from the git repositories with just one command execution for both 32-bit and 64-bit Debian based systems (Debian, Ubuntu). Pre-existing installed version (if any) of FlightGear are not touched at all since the script builds and installs everything under the directory in which it is launched. You can choose between building all or only specific tools and applications. For RedHat-based systems (Fedora, CentOS) you may want to check out [[CentOS]].


Necessary packages are installed via the apt-get system while libraries not included in the repositories are downloaded and compiled on the fly (i.e. [[Plib]], [[Simgear]] and [[OSG]]).
Necessary packages are installed via the apt-get system while libraries not included in the repositories are downloaded and compiled on the fly (i.e. [[Plib]], [[Simgear]] and [[OSG]]).
Line 17: Line 17:
=== Cut to the Chase: for the impatient ===
=== Cut to the Chase: for the impatient ===


  cd  <your working directory for building flightgear>
  cd  <your working directory for building FlightGear>
  wget -O download_and_compile.sh  http://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh?format=raw
  wget -O download_and_compile.sh  http://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh?format=raw
  chmod +x download_and_compile.sh
  chmod +x download_and_compile.sh
Line 29: Line 29:
=== Conversion of directory structure from earlier versions of download_and_compile.sh ===
=== Conversion of directory structure from earlier versions of download_and_compile.sh ===


Earlier versions of the script used a different directory structure. If you used the earlier version, the new script includes a section that will convert the earlier structure to the current set of directories.
Earlier versions of the script used a different directory structure. If you used the earlier version, the new script includes a section that will convert the earlier structure to the current set of directories.


=== Disk Space Requirements ===
=== Disk Space Requirements ===
As of Version 3.4.0 in June 2015, this script require 2-3 gb of disk space, note that this includes downloaded source trees, build files, and fgdata.   
As of Version 3.4.0 in June 2015, this script require 2-3 gb of disk space, note that this includes downloaded source trees, build files, and FGData.   


=== List of compiled programs ===
=== List of compiled programs ===
Line 46: Line 46:
* [[FlightGear HLA support (High Level Architecture) | OpenRTI]]
* [[FlightGear HLA support (High Level Architecture) | OpenRTI]]


Note that openRTI is just another optional dependency for HLA support: http://wiki.flightgear.org/FlightGear_HLA_support_(High_Level_Architecture)
Note that OpenRTI is just another optional dependency for HLA support: http://wiki.flightgear.org/FlightGear_HLA_support_(High_Level_Architecture)


For the time being, you should be just fine building without HLA support. Eventually, the idea is for HLA to replace the existing MP system and even increasingly distribute the FlightGear architecture such that more and more components can be more easily run in separate threads or even separate processes, possibly even on different machines. So this is going to be an important feature for professional users, using several computers and screens to create a comprehensive and immersive simulation environment.
For the time being, you should be just fine building without HLA support. Eventually, the idea is for HLA to replace the existing MP system and even increasingly distribute the FlightGear architecture such that more and more components can be more easily run in separate threads or even separate processes, possibly even on different machines. So this is going to be an important feature for professional users, using several computers and screens to create a comprehensive and immersive simulation environment.
Line 57: Line 57:


==== When building Next you may see build errors ====
==== When building Next you may see build errors ====
Keeping in mind that this script compiles bleeding edge software versions, using latest debian derivered distros, it can happen that the program that was successfully compiling last week, today does not. Building the stable version should always work unless there is a problem with the script<BR/>
Keeping in mind that this script compiles bleeding edge software versions, using latest Debian derived distributions, it can happen that the program that was successfully compiling last week, today does not. Building the stable version should always work unless there is a problem with the script<BR/>


== Download ==
== Download ==
Line 80: Line 80:


You have two options now: build the latest ''stable'' FlightGear release or build the ''current development'' version (bleeding edge).
You have two options now: build the latest ''stable'' FlightGear release or build the ''current development'' version (bleeding edge).
After building stable or the latest, if you need to build a different version, try the instructions for [[Avoiding Multiple Downloads of fgdata]].   
After building stable or the latest, if you need to build a different version, try the instructions for [[Avoiding Multiple Downloads of FGData]].   
=== Build the latest stable FlightGear release ===
=== Build the latest stable FlightGear release ===
When executing the script, use the "-s" option to build the latest stable release:
When executing the script, use the "-s" option to build the latest stable release:
Line 91: Line 91:
the latest development version is built.
the latest development version is built.


'''Warning''': The development version of Flightgear changes on an almost daily basis. It provides the latest features, but is not always guaranteed to work reliably. If you're unfamiliar with software testing, you may prefer to use the latest stable release.
'''Warning''': The development version of FlightGear changes on an almost daily basis. It provides the latest features, but is not always guaranteed to work reliably. If you're unfamiliar with software testing, you may prefer to use the latest stable release.


<pre>
<pre>
Line 98: Line 98:




Once the script is finished, you will successfully get Flightgear and Fgrun installed in the ~/fgfs directory.
Once the script is finished, you will successfully get FlightGear and FGRun installed in the ~/fgfs directory.


=== Launching FlightGear ===
=== Launching FlightGear ===
When using brisa's script, the two FG dependencies/libs are usually not installed system-wide, but in a custom location (that makes it possible, to easily use different OSG/SG/FG versions on a single system, i.e. for testing purposes - but also to have separate build trees (optimized/debug) ) - which is why you either need to set LD_LIBRARY_PATH or simply use Brisa's script to run everything (something like run_fgfs.sh, which automatically sets up all environment variables according to your build settings).  
When using Brisa's script, the two FG dependencies/libs are usually not installed system-wide, but in a custom location (that makes it possible, to easily use different OSG/SG/FG versions on a single system, i.e. for testing purposes - but also to have separate build trees (optimized/debug) ) - which is why you either need to set LD_LIBRARY_PATH or simply use Brisa's script to run everything (something like run_fgfs.sh, which automatically sets up all environment variables according to your build settings).  


To run your new git installation of FlightGear you have to launch the ''run_fgfs.sh'' command under the same folder, for example:
To run your new git installation of FlightGear you have to launch the ''run_fgfs.sh'' command under the same folder, for example:
Line 111: Line 111:
=== Launching Fgrun ===
=== Launching Fgrun ===
[[File:fgrun-page2.jpg|thumb|right]]
[[File:fgrun-page2.jpg|thumb|right]]
For many users it's more comfortable having FlightGear launched by the graphical utility Fgrun which is installed as well in the same folder. You have to launch the ''run_fgrun.sh'' command, for example:
For many users it's more comfortable having FlightGear launched by the graphical utility FGRun which is installed as well in the same folder. You have to launch the ''run_fgrun.sh'' command, for example:
<pre>
<pre>
cd ~/fgfs
cd ~/fgfs
Line 117: Line 117:
</pre>
</pre>


fgrun will save its settings in ~/.fltk/flightgear.org/fgrun.prefs  you may want to save copies of the preferences customized for stable and next.
FGRun will save its settings in ~/.fltk/flightgear.org/fgrun.prefs  you may want to save copies of the preferences customized for stable and next.


=== Launching Fgo! ===
=== Launching Fgo! ===
Line 126: Line 126:
sh run_fgo.sh
sh run_fgo.sh
</pre>
</pre>
Remember that the first time you run it, you have to go to preferences and set the binary and fgdata path (Do no set the working directory, you don't need it).
Remember that the first time you run it, you have to go to preferences and set the binary and FGData path (Do no set the working directory, you don't need it).


== Additional programs ==
== Additional programs ==
Line 152: Line 152:
Where: ''/folder/with/sceneries'' is the folder containing the sceneries data.
Where: ''/folder/with/sceneries'' is the folder containing the sceneries data.


Then launch fgfs with the '''--fg-scenery=/folder/with/sceneries --atlas=socket,out,5,localhost,5500,udp''' option
Then launch FGFS with the '''--fg-scenery=/folder/with/sceneries --atlas=socket,out,5,localhost,5500,udp''' option


== Troubleshooting ==
== Troubleshooting ==
Line 164: Line 164:
There is a simple solution to the above errors: wait and relaunch the script after some time (hours or days), if software developers repair or synchronize their code with the newly updated libraries (which generally happens eventually), your FlightGear will compile fine as if the previous error never took place.
There is a simple solution to the above errors: wait and relaunch the script after some time (hours or days), if software developers repair or synchronize their code with the newly updated libraries (which generally happens eventually), your FlightGear will compile fine as if the previous error never took place.


Sometimes it happens that the script fails to compile only fgrun, fgcom or atlas, if you then see the run_fgfs.sh file it means that FlightGear installation was successful and you can safely run it.
Sometimes it happens that the script fails to compile only FGRun, FGCOM or atlas, if you then see the run_fgfs.sh file it means that FlightGear installation was successful and you can safely run it.


=== OpenRTI undefined reference errors ===
=== OpenRTI undefined reference errors ===
Line 172: Line 172:
</pre>
</pre>


see this thread for more details(http://forum.flightgear.org/viewtopic.php?f=45&t=26244)
see this thread for more details (http://forum.flightgear.org/viewtopic.php?f=45&t=26244)


== Options ==
== Options ==
The script by default (without any option) will only compile FlightGear and Fgrun. To make it compile all, you need to launch the script with the ''ALL'' parameter. i.e.:
The script by default (without any option) will only compile FlightGear and FGRun. To make it compile all, you need to launch the script with the ''ALL'' parameter. i.e.:
<pre>
<pre>
./download_and_compile.sh ALL
./download_and_compile.sh ALL
Line 208: Line 208:


How does it work? Inside the script there is a small list with latest known versions of successfully compiling revisions, it will download from svn/git those specific revisions, which have been found able to compile together.<BR/>
How does it work? Inside the script there is a small list with latest known versions of successfully compiling revisions, it will download from svn/git those specific revisions, which have been found able to compile together.<BR/>
Warning: If you run this option inside a folder where you previously compiled fgfs, it will probably fail to compile, you better run the script with this option inside an empty folder or a folder whith the same fgfs version compiled previously.
Warning: If you run this option inside a folder where you previously compiled FGFS, it will probably fail to compile, you better run the script with this option inside an empty folder or a folder with the same FGFS version compiled previously.


=== Advanced options ===
=== Advanced options ===
Line 234: Line 234:


== Optimus technology ==
== Optimus technology ==
If your computer has a GPU with optimus technology, you need a dedicated script in order to make FG running with the powerful GPU.
If your computer has a GPU with Optimus technology, you need a dedicated script in order to make FG running with the powerful GPU.


After having installed required tools (Bumblebee) you just need to run this command line in your FG installation directory (where you executed ./download_and_compile.sh) :  
After having installed required tools (Bumblebee) you just need to run this command line in your FG installation directory (where you executed ./download_and_compile.sh) :  
Line 243: Line 243:




the same is applied with the FGRUN launcher :
the same is applied with the FGRun launcher :
<pre>
<pre>
sed  's|\./fgrun|optirun ./fgrun|' run_fgrun.sh > run_fgrun_optirun.sh && chmod +x run_fgrun_optirun.sh
sed  's|\./fgrun|optirun ./fgrun|' run_fgrun.sh > run_fgrun_optirun.sh && chmod +x run_fgrun_optirun.sh
185

edits