Avoiding multiple downloads of FGData on Linux: Difference between revisions

Jump to navigation Jump to search
wikified. but not yet pretty.
No edit summary
(wikified. but not yet pretty.)
Line 3: Line 3:
When building different versions of flightgear, its important to note that each version has its own version of fgdata, and flightgear will check the version to ensure it is compatible.  
When building different versions of flightgear, its important to note that each version has its own version of fgdata, and flightgear will check the version to ensure it is compatible.  


Since fgdata is so large, it makes sense to download the whole thing only once. You can keep versions of it separately from the install tree that download_and_compile.sh creates and create symbolic links to them before using the script. That way when you decide to build from scratch, at least the fgdata will remain.
Since fgdata is so large, it makes sense to download the whole thing only once. You can keep versions of it separately from the install tree that download_and_compile.sh creates and create symbolic links to them before using the script. That way when you decide to rebuild from scratch, at least the fgdata will remain.


I do my builds of different versions and options in separate sub-directories under ~/work/fgSometimes I'll create an extra tree for debugging purposes.  I don't want to have to copy all of fgdata just to do the work on a debug version.  I also  copy the sources for the various components to avoid re downloading those as well.  In download_and_compile.sh, Git takes care of any changes needed to switch to between master and stable as needed.
The instructions below tell how to do this for existing or new uses of download_and_compile.shThe tecnical details are not dependent on where you put your buildsYou can use the directory scheme I use or your own existing scheme.  
 
====The main ideas====
* you may only need one copy of each version of fgdata you are working with
* fgdata normally lives as a sub-directory in install/fgfs/
* install/fgdata can be a symbolic link to fgdata's real directory location
 
====Technical Points====


Important:
* symbolic links can point to a directory that does not yet exist. and that's ok.
* mkdir -p install/fgfs will create the install directory and subdirectory if they do not yet exist.
* mv install/fgdata someotherdirectory/fgdata will recursively copy the contents of fgdata to the new location as a sub-directory. 
* cp -R will copy directorys recursively.


You can move the source directories and download_and_compile.sh  to different folders at will.  Git will not care.  All the git specific files move right along with the sources.  Its the same for svn. 


However, the same does not hold true for the files created during a build by cmake.  The build and install folders cannot be moved because the files in them have hard coded paths in some cases.  They'll need to be deleted and rebuilt.
* Important: You can move the flightgear source directories and download_and_compile.sh  to different folders at will.  Git will not care.  All the git specific files move right along with the sources.  Its the same for svn.  However, the same does not hold true for the files created during a build by cmake.  The build and install folders cannot be moved because the files in them have hard coded paths in some cases.  They'll need to be deleted and rebuilt.


====Background info====
I do my builds of different versions and options in separate sub-directories under ~/work/fg.  Sometimes I'll create an extra tree for debugging purposes.  I don't  want to have to copy all of fgdata just to do the work on a debug version.  I also  copy the sources for the various components to avoid re downloading those as well.  In download_and_compile.sh, Git takes care of any changes needed to switch to between master and stable as needed.


====Here's how I handle fgdata..====
====Here's how I handle fgdata..====


Normally fgdata lands in install/fgfs.   
Normally fgdata lands in install/fgfs.   
I've moved my 2.10.0 and 2.11.0 versions and replaced them with symbolic links to the new location
I've moved my 2.10.0 and 2.11.0 fgdata versions and replaced them with symbolic links to the new location as needed.
Its as simple as that.
Its as simple as that.


Line 27: Line 38:
  mkdir -p ~/work/fg/fgdata_2.11.0
  mkdir -p ~/work/fg/fgdata_2.11.0
</code>
</code>
=====2. In ~/work/fg, create a directory for each version or variation of flightgear you want to build.=====
Eventually a particular version of fgdata will be in ~/work/fg/fgdata_2.10.0/fgdata.  Do not create an empty ~/work/fg/fgdata_2.10.0/fgdata. Git will do that for you when necessary.
  download_and_compile.sh will be run from these directories  
 
=====2. Create a directory for each version or variation of flightgear you want to build.=====
 
download_and_compile.sh will be run from these directories  


For example:
Mine are sub-directories of ~/work/fg for example:
<code>
<code>
  mkdir -p ~/work/fg/master
  mkdir -p ~/work/fg/master
Line 60: Line 74:


Skip this step if you are building for the first time or are starting fresh.
Skip this step if you are building for the first time or are starting fresh.
    If you've used  download_and_compile.sh before, you may already have either version of fgdata, its in the install/fgfs directory.  
If you've used  download_and_compile.sh before, you may already have either version of fgdata, its in the install/fgfs directory.  


We're going to move it.  Not copy it, move it.  
We're going to move it.  Not copy it, move it.  


From the directory where you ran download_and_compile:
From the directory where you ran download_and_compile:
<code>
<code>
   mv install/fgfs/fgdata ~/work/fg/fgdata_2.11.0
   mv install/fgfs/fgdata ~/work/fg/fgdata_2.11.0
Line 71: Line 85:
</code>
</code>


    If you want to adopt my tree naming scheme, then move the source directories for the various components to the appropriate build directory such as ~/work/fg/master.  Note that you cannot move the build and install directories.  They'll be rebuilt in the new location.  The rebuild is needed because we use Cmake.
If you want to adopt my tree naming scheme, then move the source directories for the various components to the appropriate build directory such as ~/work/fg/master.  Note that you cannot move the build and install directories.  They'll be rebuilt in the new location.  The rebuild is needed because we use Cmake.


    Test to see that everything is hooked up.
Test to see that everything is hooked up.
<code>
<code>
  ./download_and_compile.sh FGDATA
  ./download_and_compile.sh FGDATA
Line 108: Line 122:




7. Build Stable
=====8. Build Stable=====
<code>
<code>
  cd ~/work/fg/stable
  cd ~/work/fg/stable
Line 127: Line 141:
<code>
<code>


=====8. Building with options=====
=====9. Building with options=====


You can use download_and_compile to build master or stable with various options such as -i for openrti  or -g to build a debug version.   
You can use download_and_compile to build master or stable with various options such as -i for openrti  or -g to build a debug version.   
936

edits

Navigation menu