Avoiding multiple downloads of FGData on Linux: Difference between revisions

Jump to navigation Jump to search
Big correction. You have to have run download_and_compile.sh before you can use this technique. Directions are still untested.
(→‎8. Build Stable: Fix ending tag)
(Big correction. You have to have run download_and_compile.sh before you can use this technique. Directions are still untested.)
Line 12: Line 12:
* you may only need one copy of each version of fgdata you are working with  
* 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/
* fgdata normally lives as a sub-directory in install/fgfs/
* install/fgdata can be a symbolic link to fgdata's real directory location
* once it exists, install/fgdata can moved and replaced by a symbolic link to fgdata's real directory location
 


====Technical Points and command examples====
====Technical Points and command examples====
Line 19: Line 20:
* mv  can move a directory   
* mv  can move a directory   
* cp -R will copy a directory recursively.
* cp -R will copy a directory recursively.
* ln -s targetname linkname  creates linkname as a symbolic link to the target.  The target may or may not yet exist and that's ok.
* ln -s targetname linkname  creates linkname as a symbolic link to the target.  The target may or may not yet exist and that's normally ok. Not in this case, because of the way we create the directory with git.
 
* the symbolic link must be created <b>after</b> downloading
* 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.
* 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.


Line 39: Line 40:
  mkdir -p ~/work/fg/fgdata_2.11.0
  mkdir -p ~/work/fg/fgdata_2.11.0
</code>
</code>
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.
Eventually a particular version of fgdata will be in each


=====2. Create a directory for each version or variation of flightgear you want to build.=====
=====2. Create a directory for each version or variation of flightgear you want to build.=====
Line 55: Line 56:
Note that I never build at the ~/work/fg level.  download_and_compile.sh is always run from a sub-directory
Note that I never build at the ~/work/fg level.  download_and_compile.sh is always run from a sub-directory


=====3. Ensure that there is an install/fgfs for each build directory.=====
=====3. Do you first build of flightgear =====
<code>
 
mkdir -p ~/work/fg/master/install/fgfs
You can skip this step if you've already done one.
mkdir -p ~/work/fg/stable/install/fgfs
mkdir -p ~/work/fg/master_debug/install/fgfs
mkdir -p ~/work/fg/master_debug_rti/install/fgfs
</code>
=====4. Create symbolic links for each of your builds to the appropriate fgdata container.=====
  The containers do not have to have anything in them, but when you run the script the containers need to exist.


For example:
If you've never used download_and_compile.sh before you're ready to go.
<code>
<code>
  ln -s /home/userid/work/fg/fgdata_2.10.0/fgdata  ~/work/fg/stable/install/fgfs/fgdata
  cp download_and_compile.sh ~/work/fg/master
  ln -s /home/userid/work/fg/fgdata_2.11.0/fgdata  ~/work/fg/master/install/fgfs/fgdata
  cd ~/work/fg/master
./download_and_compile.sh ALL
</code>
</code>
and so forth.  If you need to delete your install directory, do so and then recreate using mkdir -p install/fgfs and recreate the link.
That will build just about everything and will download fgdata into
 
~/work/fg/master/install/fgfs/fgdata
=====5. retrofit prevous use of download_and_compile.sh =====


Skip this step if you are building for the first time or are starting fresh.
=====4. retrofit prevous use of download_and_compile.sh =====
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 itNot copy it, move it.  
Download_and_compile.sh placed the fgdata directory in the install/fgfs directory.  


We're going to move it.  N
From the directory where you ran download_and_compile:
From the directory where you ran download_and_compile:
<code>
<code>
Line 90: Line 85:
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 DATA
</code>
</code>
(this may not work... you may need to do ALL first. Remove this if it does work)


=====6. Do you first build of flightgear =====


Skip this step if you did step 5
=====5.  Prepare to build another version.=====
 
If you've never used download_and_compile.sh before you're ready to go.
<code>
cp download_and_compile.sh ~/work/fg/master
cd ~/work/fg/master
./download_and_compile.sh ALL
</code>
That will build just about everything.
 
=====7.  Prepare to build another version.=====


  In step 1, we created a spot for two fgdata versions.  So far only one is actually there, fgdata_2.11.0/fgdata.  Lets fix that so we don't have to download another copy for 2.10.0
  In step 1, we created a spot for two fgdata versions.  So far only one is actually there, fgdata_2.11.0/fgdata.  Lets fix that so we don't have to download another copy for 2.10.0
<code>
<code>
  cd ~/work/fg/fgdata_2.10.0
  cd ~/work/fg/fgdata_2.8.0
  cp -r ~/work/fg/fgdata_2.11.0 fgdata
  cp -r ~/work/fg/fgdata_2.11.0 fgdata
</code>
</code>
That's right, we just made a copy of 2.11.0's fgdata and are calling it 2.10.0.
That's right, we just made a copy of 2.11.0's fgdata and are calling it 2.8.0.
 
The next step makes it acutally 2.10.0
<code>
cd ~/work/fg/stable
./download_and_compile.sh -s FGDATA
</code>
That was easy.  There are not all that many differences between 2.10.0 and 2.11.0 so git took care of it quickly and efficiently
 


=====8. Build Stable=====
While we're at it, lets copy the 2.11.0 source code 
<code>
<code>
  cd ~/work/fg/stable
  cd ~/work/fg/stable
Line 134: Line 109:
  cp -R ~/work/fg/master/fgcom ./
  cp -R ~/work/fg/master/fgcom ./
  cp -R ~/work/fg/master/fgcomgui ./
  cp -R ~/work/fg/master/fgcomgui ./
</code>
And replace the link to the right version
mkdir -p  /installfgfs
ln -s ~/work/fg/fgdata/2.8.0 install/fgfs
  ls -lah install/fgfs/fgdata # show the symlink to fgdata
  ls -lah install/fgfs/fgdata # show the symlink to fgdata
  ls  install/fgfs/fgdata # make sure there's something there.
  ls  install/fgfs/fgdata # make sure there's something there.
Line 142: Line 122:
</code>
</code>


=====9. Building with options=====
=====6. 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