13,212
edits
(Copy editing; +cat: TerraGear, Building from source) |
|||
Line 1: | Line 1: | ||
Some of us may still be running Ubuntu 14.04 LTS for various reasons. Building FlightGear from the repository is pretty easy with the <code>download_and_compile.sh</code> script. However, [[TerraGear]] will not build because 14.04 has an old GDAL library, v1.17. something, but we can work around that.<ref>{{cite web | |||
|url = https://forum.flightgear.org/viewtopic.php?p=313522#p313522 | |url = https://forum.flightgear.org/viewtopic.php?p=313522#p313522 | ||
|title = <nowiki> Terragear compilation - Ubuntu 14.04 </nowiki> | |title = <nowiki> Terragear compilation - Ubuntu 14.04 </nowiki> | ||
Line 8: | Line 7: | ||
|script_version = 0.40 | |script_version = 0.40 | ||
}}</ref> | }}</ref> | ||
== Background == | == Background == | ||
A year ago, July 16, 2016, the minimum version of GDAL was increased to v2.0.0 and the code was adapted to the new API. What those of us on Ubuntu 14.04 have had to do was to reset our TerraGear to the previous commit before this one and TerraGear would compile just fine. The problems arose when other fixes were needed because of changes in FlightGear and SimGear, so here we are... | |||
== How to proceed == | == How to proceed == | ||
''' | {{note|You ''must'' have an existing TerraGear repository managed by the <code>download_and_compile.sh</code> script before doing all this!}} | ||
1. | 1. Get into our TerraGear repository | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cd ~/flightgear-dev/next/terragear | cd ~/flightgear-dev/next/terragear | ||
</syntaxhighlight> | </syntaxhighlight> | ||
2. | 2. Make sure we are on the TerraGear <code>scenery/ws2.0</code> branch | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
git checkout scenery/ws2.0 | git checkout scenery/ws2.0 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
3. | 3. Make sure we have done the reset | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
git reset --hard 082ee9b82f15c8067183925a2ce48da817fa3748 | git reset --hard 082ee9b82f15c8067183925a2ce48da817fa3748 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
4. | 4. Create and checkout a new branch for us to use | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
git checkout -b oldgdal scenery/ws2.0 | git checkout -b oldgdal scenery/ws2.0 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
5. | 5. Now it is time to go cherry-picking | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
git cherry-pick 0bb5df8d4d9e67a99b2afe27f53d90592ac97674 | git cherry-pick 0bb5df8d4d9e67a99b2afe27f53d90592ac97674 | ||
Line 52: | Line 46: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{note|If you've modified your <code>download_and_compile.sh</code> script to force the above mentioned reset we will be commenting that out in the next step. If you mess up or otherwise reset in this branch, you have to cherry-pick again so do not do that! ;)}} | |||
6. | 6. We need to edit <code>download_and_compile.sh</code> to add another round of cmake when we reconfigure TerraGear. This has something to do with CGAL and resetting the <code>CXX_FLAGS</code>. To build TerraGear with the new SimGear, we ''must'' add a flag to use <code>c++11</code>. This needs to be done when we configure which is where the <code>CXX_FLAGS</code> come into play so we will kill two birds in this step. Adding the flag and doing the double cmake round. | ||
7. | 7. Load <code>download_and_compile.sh</code> into your editor. | ||
7a. | 7a. Near the top, around line 53, you will find these two lines | ||
<syntaxhighlight lang="bash"> | |||
SG_CMAKEARGS="" | SG_CMAKEARGS="" | ||
FG_CMAKEARGS="" | FG_CMAKEARGS="" | ||
</syntaxhighlight> | |||
Add a new line to them so they look like this | |||
<syntaxhighlight lang="bash"> | |||
SG_CMAKEARGS="" | SG_CMAKEARGS="" | ||
FG_CMAKEARGS="" | FG_CMAKEARGS="" | ||
TG_CMAKEARGS="-DCMAKE_CXX_FLAGS=-std=c++11" | TG_CMAKEARGS="-DCMAKE_CXX_FLAGS=-std=c++11" | ||
</syntaxhighlight> | |||
7b. | 7b. Go down to your TerraGear build section and edit it to look like this. '''This will add 13 lines.''' | ||
<syntaxhighlight lang="bash"> | |||
TG_INSTALL_DIR=terragear | TG_INSTALL_DIR=terragear | ||
INSTALL_DIR_TG=$INSTALL_DIR/$TG_INSTALL_DIR | INSTALL_DIR_TG=$INSTALL_DIR/$TG_INSTALL_DIR | ||
Line 126: | Line 126: | ||
fi | fi | ||
_logSep | _logSep | ||
</syntaxhighlight> | |||
7c. | 7c. Save the changes and exit your editor. | ||
8. | 8. Now we can ''finally'' build TerraGear using the <code>download_and_compile.sh</code> script. | ||
The key, here, is to ''not'' download anything to update TerraGear. <code>-d n</code> prevents the TerraGear repository from being downloaded and/or updated. We will have to manage updates manually for now. | |||
<syntaxhighlight lang="bash"> | |||
~/path_to_your/download_and_compile.sh -p n -d n -j 1 TERRAGEAR | ~/path_to_your/download_and_compile.sh -p n -d n -j 1 TERRAGEAR | ||
</syntaxhighlight> | |||
That should do it. When <code>download_and_compile.sh</code> finishes, you should have a nice shiny set of TerraGear tools that you can play with building scenery. Remember, this uses your old GDAL v1.17 so none of the newer code specific to GDAL stuff will be able to be used. Future updates to this TerraGear will also have to be cherry-picked or hand-written. | |||
== References == | == References == | ||
{{ | <references /> | ||
{{TerraGear}} | |||
{{building}} |