TerraGear compilation - Ubuntu 14.04: Difference between revisions

Jump to navigation Jump to search
Copy editing; +cat: TerraGear, Building from source
(Copy editing; +cat: TerraGear, Building from source)
Line 1: Line 1:
== Motivation ==
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
some of us may still be running ubuntu's 14.04 LTS for various reasons... building flightgear from the repo is pretty easy with the download_and_compile.sh script... one thing, though, is that terragear won't 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 on 2016 Jul 16, 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...
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 repo managed by the download_and_compile.sh script before doing all this!'''
{{note|You ''must'' have an existing TerraGear repository managed by the <code>download_and_compile.sh</code> script before doing all this!}}
 
'''what i did:'''


1. get into our terragear repository
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. make sure we're on the terragear scenery/ws2.0 branch
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. make sure we've done the reset
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. create and checkout a new branch for us to use
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. now it is time to go cherry-picking
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 download_and_compile.sh script to force the above mentioned reset we'll 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 don't do that!''' ;)
{{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. we need to edit download_and_compile.sh to add another round of cmake when we reconfigure terragear... this has something to do with CGAL and resetting the CXX_FLAGS... to build terragear with the new simgear, we ''must'' add a flag to use "c++11"... this needs to be done when we configure which is where the CXX_FLAGS come into play so we'll kill two birds in this step... adding the flag and doing the double cmake round...
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. load download_and_compile.sh into your editor...
7. Load <code>download_and_compile.sh</code> into your editor.


7a. near the top, around line 53, you'll find these two lines
7a. Near the top, around line 53, you will find these two lines
<syntaxhighlight lang="bash">
   SG_CMAKEARGS=""
   SG_CMAKEARGS=""
   FG_CMAKEARGS=""
   FG_CMAKEARGS=""
add a new line to them so they look like this
</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. go down to your terragear build section and edit it to look like this... '''''there are 13 lines added...'''''
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. save the changes and exit your editor.
7c. Save the changes and exit your editor.


8. now we can FINALLY build terragear using the download_and_compile.sh script...
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... "-d n" prevents the terragear repo from being downloaded and/or updated... we'll have to manage updates manually for now...
 
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 download_and_compile.sh 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...
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 ==
{{Appendix}}
<references />
 
{{TerraGear}}
{{building}}

Navigation menu