FFGo: Difference between revisions

Jump to navigation Jump to search
563 bytes added ,  25 February 2016
→‎Sample installation sessions: Improve formatting by splitting the big <pre> blocks
(→‎Using pip (generic method): Explain how to remove software from a venv)
(→‎Sample installation sessions: Improve formatting by splitting the big <pre> blocks)
Line 374: Line 374:


These sample sessions are given for Debian—at least for now—but the method is generic and can be applied to other distributions (the <tt>apt-get</tt> commands will have to be adapted, obviously):
These sample sessions are given for Debian—at least for now—but the method is generic and can be applied to other distributions (the <tt>apt-get</tt> commands will have to be adapted, obviously):
<ol style="list-style-type: decimal"><li><strong>First session:</strong> installing FFGo (and some of its dependencies, such as [http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser]) using pip in a virtual environment:</p>
<ol style="list-style-type: decimal"><li>
<p><em><strong>First session:</strong> installing FFGo (and some of its
dependencies, such as
[http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser])
using <tt>pip</tt> in a virtual environment.</em></p>


<ul><li>
<p>First, as root:</p>
<p>First, as root:</p>
<pre># Mandatory
apt-get install python3 python3-tk python3-venv


# Optional; may help if you want to compile Pillow (which is
<p>Mandatory:</p>
# automatically done if you install it using pip):
<pre>apt-get install python3 python3-tk python3-venv</pre>
apt-get install libpython3-dev tcl-dev tk-dev
# If the Pillow installation (later) fails even with this,
# run the following command as root:
#
#  apt-get build-dep python3-pil.imagetk
#
# This will install more packages, but should definitely
# allow you to compile Pillow.


# Optional: to have magnetic declination, magnetic headings,
<p>Optional—may help if you want to compile Pillow (which is automatically
#          etc.
done if you install it using pip):</p>
apt-get install geographiclib-tools
<pre>apt-get install libpython3-dev tcl-dev tk-dev</pre>
 
<p>If the Pillow installation (later) fails even with this,
run the following command as root:</p>
<pre>apt-get build-dep python3-pil.imagetk</pre>
 
<p>This will install more packages, but should definitely allow you to compile
Pillow.</p>
 
<p>Optional: to have magnetic declination, magnetic headings, etc.:</p>
<pre>apt-get install geographiclib-tools
# Install a minimal dataset for the MagneticField program
# Install a minimal dataset for the MagneticField program
/usr/sbin/geographiclib-get-magnetic minimal
/usr/sbin/geographiclib-get-magnetic minimal</pre>


# Highly optional, for better precision (no idea if one can
<p>Highly optional, for better precision (no idea if one can see the
# see the difference for typical aviation needs):
difference for typical aviation needs):</p>
/usr/sbin/geographiclib-get-magnetic emm2015</pre>
<pre>/usr/sbin/geographiclib-get-magnetic emm2015</pre>
</li>
<li><p>Then, <strong>as an unprivileged user:</strong></p>


<p>Then, <strong>as an unprivileged user:</strong></p>
<p>Create a virtual environment in <tt>~/my-venvs/venv1</tt>, linked to the
base Python installation that provides <tt>/usr/bin/python3.4</tt>:</p>
<pre>~ % mkdir -p ~/my-venvs && cd ~/my-venvs
~/my-venvs % /usr/bin/python3.4 -m venv venv1</pre>


<pre>~ % mkdir -p ~/my-venvs && cd ~/my-venvs
<p>Check what we have in there:</p>
# Create a virtual environment in ~/my-venvs/venv1, linked
<pre>~/my-venvs % ls venv1
# to the base Python installation that provides
bin  include  lib  lib64  pyvenv.cfg</pre>
# /usr/bin/python3.4.
~/my-venvs % /usr/bin/python3.4 -m venv venv1
# Check what we have in there
~/my-venvs % ls venv1
bin  include  lib  lib64  pyvenv.cfg


# Install FFGo in this venv using the pip executable
<p>Install FFGo in this venv using the <tt>pip</tt> executable <strong>from
# *** from this venv ***. This is the crucial point. Don't
this venv</strong>. This is the crucial point. Don't run this with any
# run this with any pip executable you find, otherwise you
<tt>pip</tt> executable you find, otherwise you won't be able to know where
# won't be able to know where the installation is taking
the installation is taking place.</p>
# place.
<pre>~/my-venvs % venv1/bin/pip install ffgo
~/my-venvs % venv1/bin/pip install ffgo
Downloading/unpacking ffgo
Downloading/unpacking ffgo
   Downloading FFGo-1.9.0.tar.gz (767kB): 767kB downloaded
   Downloading FFGo-1.9.0.tar.gz (767kB): 767kB downloaded
Line 436: Line 440:


Successfully installed ffgo CondConfigParser
Successfully installed ffgo CondConfigParser
Cleaning up...
Cleaning up...</pre>


# Run FFGo
<p>Run FFGo:</p>
~/my-venvs % venv1/bin/ffgo
<pre>~/my-venvs % venv1/bin/ffgo
FFGo 1.9.0 started
FFGo 1.9.0 started
Using:
Using:
Line 452: Line 456:
particular geodetic calculations can only be done with GeographicLib. You will
particular geodetic calculations can only be done with GeographicLib. You will
be notified when such a case is encountered.
be notified when such a case is encountered.
Detected FlightGear version: 2016.1.0
Detected FlightGear version: 2016.1.0</pre>


# FFGo works. It just told us about the two optional
<p>FFGo works. It just told us about the two optional dependencies we haven't
# dependencies we haven't installed. Let's install them now.
installed. Let's install them now. There is another way that uses Debian
# There is another way that uses Debian packages (creating
packages (creating the venv with <tt>--system-site-packages</tt>); it is
# the venv with --system-site-packages); it is explained in
explained in
# docs/INSTALL/INSTALL_en, but I can't replicate all of its
[https://github.com/frougon/FFGo/blob/master/docs/INSTALL/INSTALL_en docs/INSTALL/INSTALL_en], but I can't replicate all of its contents
# contents here...
here...</p>


# OK, so let's install these optional dependencies now.
<p>OK, so let's install these optional dependencies now:</p>
~/my-venvs % venv1/bin/pip install Pillow geographiclib
<pre>~/my-venvs % venv1/bin/pip install Pillow geographiclib
Downloading/unpacking Pillow
Downloading/unpacking Pillow
   Downloading Pillow-3.1.0.tar.gz (9.9MB): 9.9MB downloaded
   Downloading Pillow-3.1.0.tar.gz (9.9MB): 9.9MB downloaded
Line 476: Line 480:
[...]
[...]


Cleaning up...
Cleaning up...</pre>


# Let's start FFGo again...
<p>Let's start FFGo again:</p>
~/my-venvs % venv1/bin/ffgo
<pre>~/my-venvs % venv1/bin/ffgo
FFGo 1.9.0 started
FFGo 1.9.0 started
Using:
Using:
Line 487: Line 491:
   - MagneticField: GeographicLib version 1.45
   - MagneticField: GeographicLib version 1.45


Detected FlightGear version: 2016.1.0
Detected FlightGear version: 2016.1.0</pre>
~/my-venvs %
 
# No warning anymore: all optional dependencies have been
<p>No warning anymore: all optional dependencies have been installed.</p>
# installed.</pre>
</li></ul>
</li>
</li>
<li><strong>Second session:</strong> installing some of FFGo's dependencies (such as [http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser]) using pip in a virtual environment, while using FFGo directly from a clone of its [https://github.com/frougon/FFGo Git repository]:</p>
<li><p><em><strong>Second session:</strong> installing some of FFGo's
dependencies (such as
[http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser])
using <tt>pip</tt> in a virtual environment, while using FFGo directly from a
clone of its [https://github.com/frougon/FFGo Git repository].</em></p>


<p>Create a virtual environment (the second command is equivalent to
<code>/usr/bin/pyvenv-3.4 venv2</code> on Debian):</p>
<pre>~ % cd ~/my-venvs
<pre>~ % cd ~/my-venvs
# Create a virtual environment
~/my-venvs % /usr/bin/python3.4 -m venv venv2</pre>
# (equivalent to '/usr/bin/pyvenv-3.4 venv2' on Debian)
 
~/my-venvs % /usr/bin/python3.4 -m venv venv2
<p>Install CondConfigParser in this venv using the <tt>pip</tt> executable
# Install CondConfigParser in this venv using the pip
<strong>from this venv</strong>:</p>
# executable *** from this venv ***
<pre>~/my-venvs % venv2/bin/pip install CondConfigParser
~/my-venvs % venv2/bin/pip install CondConfigParser
Downloading/unpacking CondConfigParser
Downloading/unpacking CondConfigParser
   Downloading CondConfigParser-1.0.2.tar.bz2 (46kB): 46kB downloaded
   Downloading CondConfigParser-1.0.2.tar.bz2 (46kB): 46kB downloaded
Line 508: Line 517:


Successfully installed CondConfigParser
Successfully installed CondConfigParser
Cleaning up...
Cleaning up...</pre>
~ % mkdir -p ~/src && cd ~/src


# Clone FFGo's Git repository
<p>Clone FFGo's Git repository:</p>
<pre>~ % mkdir -p ~/src && cd ~/src
~/src % git clone https://github.com/frougon/FFGo.git ffgo.git
~/src % git clone https://github.com/frougon/FFGo.git ffgo.git
Cloning into 'ffgo.git'...
Cloning into 'ffgo.git'...
Line 518: Line 527:
Receiving objects: 100% (3001/3001), 1.39 MiB | 940.00 KiB/s, done.
Receiving objects: 100% (3001/3001), 1.39 MiB | 940.00 KiB/s, done.
Resolving deltas: 100% (1927/1927), done.
Resolving deltas: 100% (1927/1927), done.
Checking connectivity... done.
Checking connectivity... done.</pre>


~/src % cd ffgo.git
<p>This must be done whenever you work with FFGo's Git repo (unless you know
 
what you are doing), after <code>git clone</code> and every
# This must be done whenever you work with FFGo's Git repo
<code>git pull</code> to have exisiting and up-to-date icons and translation
# (unless you know what you are doing), after 'git clone'
(<tt>.mo</tt>) files. This requires to have installed stuff as indicated in
# and every 'git pull' to have exisiting and up-to-date
the <i>Installation from the Git repository</i> section of FFGo's
# icons and translation (.mo) files. This requires to have
[https://github.com/frougon/FFGo/blob/master/docs/INSTALL/INSTALL_en docs/INSTALL/INSTALL_en]
# installed stuff as indicated in the “Installation from the
file.</p>
# Git repository” section of FFGo's docs/INSTALL/INSTALL_en
<pre>~/src % cd ffgo.git
# file.
~/src/ffgo.git % make
~/src/ffgo.git % make
make -C share/icons
make -C share/icons
Line 535: Line 543:
[...]
[...]


make[1]: Leaving directory '/home/flo/src/ffgo.git/ffgo/data/locale'
make[1]: Leaving directory '/home/flo/src/ffgo.git/ffgo/data/locale'</pre>


# Since FFGo was not installed with pip in this case, no
<p>Since FFGo was not installed with pip in this case, no <tt>ffgo</tt>
# 'ffgo' executable has been created. The recommended way to
executable has been created. The recommended way to run FFGo in such a case is
# run FFGo in such a case is via the ffgo-launcher.py
via the <tt>ffgo-launcher.py</tt> script. The full path to
# script. The full path to ffgo-launcher.py is not needed
<tt>ffgo-launcher.py</tt> is not needed here since it is in the current
# here since it is in the current directory, however if you
directory, however if you create an alias for this command, or if you
# create an alias for this command, or if you configure an
configure an icon in your menu bar/whatever to run it, you will need the path
# icon in your menu bar/whatever to run it, you will need
(and maybe <tt>/home/username</tt> instead of <tt>~</tt> too). The path to the
# the path (and maybe '/home/username' instead of '~' too).
Python interpreter (<tt>~/my-venvs/venv2/bin/python</tt>), however, is crucial
# The path to the Python interpreter
since it is for <em>this</em> Python interpreter that we have installed
# (~/my-venvs/venv2/bin/python), however, is crucial since
CondConfigParser.</p>
# it is for *this* Python interpreter that we have installed
<pre>~/src/ffgo.git % ~/my-venvs/venv2/bin/python ~/src/ffgo.git/ffgo-launcher.py
# CondConfigParser.
~/src/ffgo.git % ~/my-venvs/venv2/bin/python ~/src/ffgo.git/ffgo-launcher.py
FFGo 1.9.0 started
FFGo 1.9.0 started
Using:
Using:
Line 562: Line 568:
particular geodetic calculations can only be done with GeographicLib. You will
particular geodetic calculations can only be done with GeographicLib. You will
be notified when such a case is encountered.
be notified when such a case is encountered.
Detected FlightGear version: 2016.1.0
Detected FlightGear version: 2016.1.0</pre>
~/src/ffgo.git %
 
<p>Again, FFGo works fine and just warned us about the two optional
dependencies it couldn't find. They can be installed in exactly the same way
as above:</p>
<pre>~/src/ffgo.git % ~/my-venvs/venv2/bin/pip install Pillow geographiclib


# Again, FFGo works fine and just warned us about the two
[...]</pre>
# optional dependencies it couldn't find. They can be
</li></ol>
# installed in exactly the same way as above:
#
#  ~/my-venvs/venv2/bin/pip install Pillow geographiclib
</pre></li></ol>


====== How to update ======
====== How to update ======
417

edits

Navigation menu