Avoiding multiple downloads of FGData on Linux: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Instructions on how to avoid multiple downloads of fgdata by separating it from install/fgfs and using a symbolic link to its location. Initial load from an Open Office document. badly needs wiki formatting)
 
No edit summary
Line 14: Line 14:




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


Normally fgdata lands in install/fgfs.   
Normally fgdata lands in install/fgfs.   
Line 20: Line 20:
Its as simple as that.
Its as simple as that.


Detailed directions:
====Detailed directions:====


1. Create a directory for each version of fgdata you are going to use
=====1. Create a directory for each version of fgdata you are going to use=====
 
<code>
mkdir -p ~/work/fg/fgdata_2.10.0
mkdir -p ~/work/fg/fgdata_2.10.0
mkdir -p ~/work/fg/fgdata_2.11.0
mkdir -p ~/work/fg/fgdata_2.11.0
 
</code>
2. In ~/work/fg, create a directory for each version or variation of flightgear you want to build. download_and_compile.sh will be run from these directories  
=====2. In ~/work/fg, 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:
For example:
mkdir -p ~/work/fg/master
<code>
mkdir -p ~/work/fg/stable
mkdir -p ~/work/fg/master
mkdir -p ~/work/fg/master_debug
mkdir -p ~/work/fg/stable
mkdir -p ~/work/fg/master_debug_rti
mkdir -p ~/work/fg/master_debug
mkdir -p ~/work/fg/master_debug_rti
</code>


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. Ensure that there is an install/fgfs for each build directory.=====
 
<code>
mkdir -p ~/work/fg/master/install/fgfs
mkdir -p ~/work/fg/master/install/fgfs
mkdir -p ~/work/fg/stable/install/fgfs
mkdir -p ~/work/fg/stable/install/fgfs
mkdir -p ~/work/fg/master_debug/install/fgfs
mkdir -p ~/work/fg/master_debug/install/fgfs
mkdir -p ~/work/fg/master_debug_rti/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.
=====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:
For example:
ln -s /home/userid/work/fg/fgdata_2.10.0/fgdata \ ~/work/fg/stable/install/fgfs/fgdata
<code>
ln -s /home/userid/work/fg/fgdata_2.11.0/fgdata \ ~/work/fg/master/install/fgfs/fgdata
ln -s /home/userid/work/fg/fgdata_2.10.0/fgdata ~/work/fg/stable/install/fgfs/fgdata
ln -s /home/userid/work/fg/fgdata_2.11.0/fgdata ~/work/fg/master/install/fgfs/fgdata
</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.


and so forth.  If you delete your install directory, just recreate it
=====5. retrofit prevous use of download_and_compile.sh =====
 
5. 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.  


Line 59: Line 65:


From the directory where you ran download_and_compile:
From the directory where you ran download_and_compile:
 
<code>
mv install/fgfs/fgdata ~/work/fg/fgdata_2.11.0
  mv install/fgfs/fgdata ~/work/fg/fgdata_2.11.0
ln -s /home/userid/work/fg/fgdata_2.11.0/fgdata \ install/fgfs/fgdata
  ln -s /home/userid/work/fg/fgdata_2.11.0/fgdata install/fgfs/fgdata
 
</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>
./download_and_compile.sh FGDATA
</code>
(this may not work... you may need to do ALL first. Remove this if it does work)


./download_and_compile.sh FGDATA
=====6. Do you first build of flightgear =====
(this may not work... you may need to do ALL first. Remove this if it does work)


5. Skip this step if you did step 4
Skip this step if you did step 5


If you've never used download_and_compile.sh before you're ready to go.
If you've never used download_and_compile.sh before you're ready to go.
 
<code>
cp download_and_compile.sh ~/work/fg/master
cp download_and_compile.sh ~/work/fg/master
cd ~/work/fg/master
cd ~/work/fg/master
./download_and_compile.sh ALL
./download_and_compile.sh ALL
 
</code>
That will build just about everything.  
That will build just about everything.  


6.  Prepare to build another version.
=====7.  Prepare to build another version.=====
 
In step 2, 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
 
cd ~/work/fg/fgdata_2.10.0
cp -r ~/work/fg/fgdata_2.11.0 fgdata


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>
cd ~/work/fg/fgdata_2.10.0
cp -r ~/work/fg/fgdata_2.11.0 fgdata
</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.10.0.


The next step makes it acutally 2.10.0
The next step makes it acutally 2.10.0
 
<code>
./download_and_compile.sh -s FGDATA
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
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




7. Build Stable
7. Build Stable
<code>
cd ~/work/fg/stable
cp -R ~/work/fg/master/download_and_compile.sh ./
cp -R ~/work/fg/master/fgfs ./
cp -R ~/work/fg/master/plib ./
cp -R ~/work/fg/master/simgear ./
cp -R ~/work/fg/master/OpenSceneGraph ./
cp -R ~/work/fg/master/fgrun ./
cp -R ~/work/fg/master/fgcom ./
cp -R ~/work/fg/master/fgcomgui ./
ls -lah install/fgfs/fgdata # show the symlink to fgdata
ls  install/fgfs/fgdata # make sure there's something there.
</code>
Now you can build stable
<code>
./download_and_compile.sh -s ALL
<code>


cd ~/work/fg/stable
=====8. Building with options=====
cp -R ~/work/fg/master/download_and_compile.sh ./
            cp -R ~/work/fg/master/fgfs ./
            cp -R ~/work/fg/master/plib ./
            cp -R ~/work/fg/master/simgear ./
            cp -R ~/work/fg/master/OpenSceneGraph ./
            cp -R ~/work/fg/master/fgrun ./
            cp -R ~/work/fg/master/fgcom ./
            cp -R ~/work/fg/master/fgcomgui ./
ls -lah install/fgfs/fgdata # show the symlink to fgdata
            ls  install/fgfs/fgdata # make sure there's something there.
 
Now you can build stable
./download_and_compile.sh -s ALL


8. 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.  You can do that in your master or stable that you just built without these options by deleting the install directories and using the options you want to rebuild with. (remember to redo the link as in step 3 if you delete install/fgfs.  The link will go, but ~/work/fgdata_*/fgdata will stay.)
You can do that in your master or stable that you just built without these options by deleting the install directories and using the options you want to rebuild with. (remember to redo the link as in step 3 if you delete install/fgfs.  The link will go, but ~/work/fgdata_*/fgdata will stay.)


An alternative is to use a separate directory.  All that's needed is that link to fgdata before you start.  
An alternative is to use a separate directory.  All that's needed is that link to fgdata before you start.  
936

edits

Navigation menu