Howto:Build and run FlightGear on Raspberry Pi 4: Difference between revisions

Jump to navigation Jump to search
(8 intermediate revisions by the same user not shown)
Line 591: Line 591:
===When to recompile/build===
===When to recompile/build===


Edward wrote:
Watch for release announcements [1] or subscribe to the flightgear-commitlogs mailing list [2] (lots of emails).
<blockquote>
   
There are a number of ways to follow this:
 
    - Watch for release announcements [1].  These announcements
correspond to the git tags for the releases, not the git release
branches.
 
    - Subscribe to the flightgear-commitlogs mailing list [2].  You
will receive one email per commit on all the FG repositories, so it is
a little noisy, but you'll see when releases are branched and when
they are tagged.
 
    - Follow this list (note: Flightgear-devel@lists.sourceforge.net) for messages from James as to when he creates a
new release branch.  This will be the initial branch that commits are
cherry-picked to, and tags made for different release revision
numbers.
 
    - Go completely nerdy and write a very complex cron job script to
email you when specific remote repository events occur (not
recommended, as email filtering of the flightgear-commitlogs messages
is easier).  This is risky because if you accidentally poll SF too
quickly, they will permanently IP blacklist you.
 
If you are interested in development, you absolutely should be making
changes based on the 'next' branch.  You should also develop by
committing changes to branches on your local repository - not by using
stashing or git-worktree.  You can use 'git rebase -i next' (after
merging 'origin/next' to your local 'next') to pick up your branch
point and shift it to the latest code.  Or just delete the branch with
'git branch -D [branch_name]'.  Don't be afraid to have lots of
local-only branches.  It is a good way, and the correct VCS (version
control systems) way, to organise your coding. I have 30 untracked
branches for my flightgear clone, 19 for simgear, and 2 for fgdata.  I
highly recommend not touching git-worktree, as that is not how
developers normally use git! This tool has a specific purpose - for
example fast switching to maintain, build, and release new revisions
for ancient long-term releases - but this purpose is not what
developers use for normal development.  And with the CMake build
system git-worktree is partly redundant as you just create different
'build' directories for the different releases.
 
Anyway, for normal VCS development just use lots of local repository
branches. You can then push interesting ones you would like backed up
to your remote fork.
 
Regards,
Edward


[1]  https://www.flightgear.org/category/news/
[1]  https://www.flightgear.org/category/news/


[2]  https://sourceforge.net/projects/flightgear/lists/flightgear-commitlogs
[2]  https://sourceforge.net/projects/flightgear/lists/flightgear-commitlogs
</blockquote>


===Download_and_compile.sh===
===Download_and_compile.sh===
Line 855: Line 807:
[[File:Copy Path(s).jpeg|thumb|150px|Easy way to copy the path of a file or folder.]]
[[File:Copy Path(s).jpeg|thumb|150px|Easy way to copy the path of a file or folder.]]


During the compiling process there will be times when the path of a file or folder is needed for a Terminal command. One easy GUI short cut is to right click on the file or folder to pull up an option list. Find the option 'Copy Path(s)' and click on it. The path of the file or folder will be copied. Next, in the Terminal, click on 'Edit' at the top of the Terminal window and then click on 'Paste' in order to past the link into the Terminal. See the screen shot to the left.
During the manual compiling process there will be times when the path of a file or folder is needed for a Terminal command. One easy GUI short cut is to right click on the file or folder to pull up an option list. Find the option 'Copy Path(s)' and click on it. The path of the file or folder will be copied. Next, in the Terminal, click on 'Edit' at the top of the Terminal window and then click on 'Paste' in order to past the link into the Terminal. See the screen shot to the left.


===Location of Files===
===Location of Files===
Line 863: Line 815:


===Build Order===
===Build Order===
wkitty42 wrote:
"The [[Scripted Compilation on Linux Debian/Ubuntu|download_and_compile.sh]] builds in this order:


PLIB, OSG, SimGear, FlightGear
PLIB, OSG, SimGear, FlightGear


It updates fgdata between the building of SimGear and FlightGear so that the translations
tool can be handled properly..."
===Patching; OSG patch example===
===Patching; OSG patch example===
There could come a time when the source needs to be patched before compiling. In this case the <code>patch</code> command can be used along with it's argument <code>-p</code>. For example; the OpenSceneGraph-3.4.0 requires the '0007-Explicit-signed-char-type-for-portability-base64.patch' patch, in order for it to compile for the ARM architecture.
There could come a time when the source needs to be patched before compiling. In this case the <code>patch</code> command can be used along with it's argument <code>-p</code>. For example; the OpenSceneGraph-3.4.0 requires the '0007-Explicit-signed-char-type-for-portability-base64.patch' patch, in order for it to compile for the ARM architecture.
Line 899: Line 846:


<syntaxhighlight>patch -p1 <0007-Explicit-signed-char-type-for-portability-base64.patch</syntaxhighlight>
<syntaxhighlight>patch -p1 <0007-Explicit-signed-char-type-for-portability-base64.patch</syntaxhighlight>
===PLIB===
{| class="wikitable"
! scope="col" width="700" | Compilation algorithm for [[PLIB]].
! scope="col" width="400" | Directory tree structure
|-
|
# Navigate the Terminal into the '''source''' folder.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">git clone git://git.code.sf.net/p/libplib/code libplib.git</syntaxhighlight>
#** This will copy the needed source files into this folder '''source'''.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">cd libplib.git</syntaxhighlight>
#** This will navigate the Terminal into the folder '''libplib.git''' that was created and populated by the <code>git</code> command.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">echo "1.8.6" > version</syntaxhighlight>
#**This will edit the file 'version' that is in this folder. This file can also be modified with a text editor, even via a GUI.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">sed s/PLIB_TINY_VERSION\ \ 5/PLIB_TINY_VERSION\ \ 6/ -i src/util/ul.h</syntaxhighlight>
#** This is some complicated version editing.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">git commit --all --message "Increase tiny version to 6."</syntaxhighlight>
#** More version patching stuff.
# Create a folder named '''build-plib''' and have it placed in the '''source''' folder.
#* The <code>mkdir</code> command or a GUI method can be used to create this folder.
#* In other words; '''FlightGear/source/build-plib'''
# Navigate the Terminal into the '''build-plib''' folder that was just created.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">cmake -D CMAKE_INSTALL_PREFIX:PATH=fg-install libplib.git</syntaxhighlight>
#** The two folders '''fg-install''' and '''libplib.git''' need to be replaced with the relative or absolute address of these folders. Use your favorite method.
#** The absolute address can easily be copied and pasted with the above [[Howto:Build_and_run_FlightGear_on_Raspberry_Pi_4#Copy_Path(s)|Copy Path(s)]] method. This could be a large string, however the Terminal doesn't mind.
#* This will setup the build.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">make -j3</syntaxhighlight>
#** This will perform the compiling.
#** The <code>-j3</code> argument will allow three of the Pi's cores to participate in the compilation.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">make install</syntaxhighlight>
#** PLIB will be installed into the '''fg-install''' folder.
|
<pre>
Storage Device
|
|
|----FlightGear
|    |
|    |
|    |----fg-install
|    |
|    |
|    |
|    |----source
|    |    |  [1] [2]
|    |    |
|    |    |
|    |    |----build-plib
|    |    |    [8] [9] [10] [11]
|    |    |
|    |    |
|    |    |----libplib.git
|    |    |      [3] [4] [5] [6]
|    |    |      [7]
|    |    |
|    |
|
</pre>
|}
===OSG===
{| class="wikitable"
! scope="col" width="700" | Compilation algorithm for [[OSG]].
! scope="col" width="400" | Directory tree structure
|-
|
{{not done}}
# Navigate the Terminal into the '''source''' folder.
# Enter the below command into the Terminal:
#* <syntaxhighlight lang="bash">git clone --branch OpenSceneGraph-3.4.0 https://github.com/openscenegraph/OpenSceneGraph.git</syntaxhighlight>
#** The above is one line.
# Patch OSG 3.4 with [[Howto:Build_and_run_FlightGear_on_Raspberry_Pi_4#Patching|with the above steps]].
{{not done}}
|
<pre>
Storage Device
|
|
|----FlightGear
|    |
|    |
|    |----fg-install
|    |
|    |
|    |
|    |----source
|    |    |  [1] [2]
|    |    |
|    |    |
|    |    |----OpenSceneGraph
|    |    |      [3] 
|    |    |
|    |    |
|    |    |----
|    |    |     
|    |    |     
|    |    |
|    |
|
</pre>
{{not done}}
|}


===OpenRTI===
===OpenRTI===
James wrote:
OpenRTI is optional. If you're using it, you need to compile it before SimGear (and therefore, before FlightGear). It's orthogonal to OSG.
"[[FlightGear high-level architecture support | OpenRTI]] is optional. If you're using it, you need to compile it before SimGear (and therefore, before FlightGear). It's orthogonal to OSG.
 
===SimGear===
{| class="wikitable"
! scope="col" width="700" | Compilation algorithm for [[SimGear]].
! scope="col" width="400" | Directory tree structure
|-
|
# {{not done}}
#* {{not done}}
 
 
|
<pre>
Storage Device
|
|
|----FlightGear
|    |
|    |
|    |----fg-install
|    |
|    |
|    |
|    |----source
|    |    | 
|    |    |
|    |    |
|    |    |----build-plib
|    |    |   
|    |    |
|    |    |
|    |    |----libplib.git
|    |    |     
|    |    |     
|    |    |
|    |
|
</pre>
{{not done}}
 
|}
 
===FlightGear===
{| class="wikitable"
! scope="col" width="700" | Compilation algorithm for FlightGear.
! scope="col" width="400" | Directory tree structure
|-
|
# {{not done}}
#* {{not done}}
 
 
|
<pre>
Storage Device
|
|
|----FlightGear
|    |
|    |
|    |----fg-install
|    |
|    |
|    |
|    |----source
|    |    | 
|    |    |
|    |    |
|    |    |----build-plib
|    |    |   
|    |    |
|    |    |
|    |    |----libplib.git
|    |    |     
|    |    |     
|    |    |
|    |
|
</pre>
{{not done}}
 
|}
 
===FlightGear Data===
{| class="wikitable"
! scope="col" width="700" | Install algorithm for FlightGear Data.
! scope="col" width="400" | Directory tree structure
|-
|
# {{not done}}
#* {{not done}}
 
 
|
<pre>
Storage Device
|
|
|----FlightGear
|    |
|    |
|    |----fg-install
|    |
|    |
|    |
|    |----source
|    |    | 
|    |    |
|    |    |
|    |    |----build-plib
|    |    |   
|    |    |
|    |    |
|    |    |----libplib.git
|    |    |     
|    |    |     
|    |    |
|    |
|
</pre>
{{not done}}
 
|}


==Backtrace using gdb: and Download_and_compile.sh==
==Backtrace using gdb: and Download_and_compile.sh==
320

edits

Navigation menu