Howto talk:Build FlightGear with Any IDE: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
Line 2: Line 2:
== Overview ==
== Overview ==


Setting up an IDE to work with the code for an application has several things it must doThe setup must take into account any standard software libraries used by the application.  The IDE should be capable of building and then using any libraries that need changes or a specific version or modification.the application needs and then creating an executable using the standard and non-standard libraries. The IDE will need to be configured to use source management and build utilities.  Build and Install directories will be needed.  There should be the capability of building both the debug and non-debug versions of executables. If there is more than one executable in the project, it should build them all.  Finally the IDE should be capable of starting the application's executables with debugging and possibly with testing, code analysis, path tracing and performance tools.
There are several capabilities that any IDE should have to support various parts of the development workflow.  An IDE should work smoothly with the underlying software tools you use to edit, manage, store, build, test and analyse your code.  Your code can be set up in the usual way for building, with separate source, build and install directory trees.  These should be configured in the IDE to allow IDE specific files in the project directory while keeping the application's code separated from the IDE specific filesIDE setup may have to take into account any standard software libraries used by the application.  The IDE should be capable of building and then using any libraries that are either specific to the application or those that need a specific version or modification.   There should be the capability of building both the debug and non-debug versions of executables. If there is more than one executable in the project, you build be able to build them all within the IDE.  Finally the IDE should be capable of starting the application's executables with debugging and possibly with testing, code analysis, path tracing and performance tools.


In this development phase my goal is to get Eclipse and QTCreator set up for debugging the flightgear executable under Ubuntu.  Once this is complete, the main page will be populated with the content developed here.   
In this development phase my goal is to get Eclipse and QTCreator set up for debugging the flightgear executable under Ubuntu with code man.  Once this is complete, the main page will be populated with the content developed here.   


Content development can proceed on this talk page, with additional phases to cover additional distributions, other operating Systems; testing; additional executables; code analysis; path tracing and performance tools. We can release to the main page, the content for the additional phases as soon as they are usable.
Content development can proceed on this talk page, with additional phases to cover additional distributions, other operating Systems; testing; additional executables; code analysis; path tracing and performance tools. We can release to the main page, the content for the additional phases as soon as they are usable.

Revision as of 14:09, 5 September 2018

WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

Overview

There are several capabilities that any IDE should have to support various parts of the development workflow. An IDE should work smoothly with the underlying software tools you use to edit, manage, store, build, test and analyse your code. Your code can be set up in the usual way for building, with separate source, build and install directory trees. These should be configured in the IDE to allow IDE specific files in the project directory while keeping the application's code separated from the IDE specific files. IDE setup may have to take into account any standard software libraries used by the application. The IDE should be capable of building and then using any libraries that are either specific to the application or those that need a specific version or modification. There should be the capability of building both the debug and non-debug versions of executables. If there is more than one executable in the project, you build be able to build them all within the IDE. Finally the IDE should be capable of starting the application's executables with debugging and possibly with testing, code analysis, path tracing and performance tools.

In this development phase my goal is to get Eclipse and QTCreator set up for debugging the flightgear executable under Ubuntu with code man. Once this is complete, the main page will be populated with the content developed here.

Content development can proceed on this talk page, with additional phases to cover additional distributions, other operating Systems; testing; additional executables; code analysis; path tracing and performance tools. We can release to the main page, the content for the additional phases as soon as they are usable.

Installing Eclipse

Eclipse can be installed on Ubuntu from the Ubuntu software repositories, or from the Eclipse download page. Eclipse tarballs are usually installed in /opt/eclipse, but may be installed elsewhere with a link

sudo ln ~/Downloads/eclipse/eclipse opt/eclipse

see: How to install Eclipse for additional details.

Prerequisite supporting packages

Flightgear and its various supporting executables use a number of standard libraries and development tools that can be obtained by simply installing the distribution's current version. It also uses additional libraries listed in the next section which need to built for use with flightgear.

Flightgear components: plib, OSG, OpenRTI, simgear, flightgear

To create a flightgear executable, you will need to build four required components and on optional component: Plib, OSG, simgear and flightgear must be built and OpenRTI is optional.

All the known flightgear components are described below with Links to web pages describing them. Instead of exploring these components individually and setting up source, build and install directories for them, you may want to use the results of a build using download_and_compile.sh as a basis for your IDE's configuration. (will that work?) otherwise you can download each source code repository to folders of your choice. Each component will be treated as a separate project by the IDE.

Specifics are provided for each IDE.

cmake

At some point in it's history the flightgear project needed to work with a specific version of cmake was not available in one or more Linux distributions. This appears to no longer be the case and cmake installed from most linux distributions will be sufficient.

When cmake had to be built, the following were relevant:

cmake.org website: [1] cmake.org git repository: [2]

plib

Plib is a library almost exclusively used by Flightgear. It is considered obsolete and there are a few things the Flightgear project needs to do to eliminate it from our codebase. Search the mailing list for plib to find out what needs to be done.

plib at Sourceforge: [3]

Open Scene Graph

The OpenSceneGraph library version 3.4 is used, with some current features backported in our custom source directory from later versions. Later versions have a different API, and at some point there will be an effort to convert Flightgear's code to use the API of the then current version. Flightgear developers get to decide when this work gets done.

Open Scene Graph Website: [4] Open Scene Graph at Github [5]

OpenRTI

An open source HLA/RTI implementation.

OpenRTI https: [6] OpenRTI Wiki: [7] Flightgear HLA Wiki Page: [8] Wikipedia page on RTI: [9]

Simgear

Simgear is a library of supporting functions that can be used by any kind of simulator. It is part of the Flightgear Project.

Simgear at SourceForge: [10]

Flightgear

Flightgear is the main executable for the Simulator. FGData is its supporting data.

Flightgear at Sourceforge: [11] fgdata on SourceForge: [12] FGData on Flightgear Wiki: [13] further explained in [14]

Additional Flightgear and ATC Projects

Flightgear Terragear: [15] Flightgear Terragear GUI: https://sourceforge.net/p/flightgear/fgscenery/terrageargui/ci/master/tree/] Flightgear Scenery: [16] FGX: [17] ATC-pie: [18] FGRun: [19]


Source, Build and Install Directories

The download_and_compile.sh script works with the following directory tree, by default in the directory where the script runs:

download_and_compile.sh

Directory Name Description
./ any directory containing the download_and_compile.sh script
./plib Downloaded sources for plib
./openscenegraph Downloaded sources for Open Scene Graph
./simgear Downloaded sources for simgear
./flightgear Downloaded sources for FlightGear
./build directory used for building all of the above components
./install directory for FlightGear executables and data

I hope that this directory structure will suffice for eclipse. There may have to be a level of indirection in the eclipse project directory so that the eclipse configuration files are not added to the upstream repository when submitting changes.

If at some point we want to add eclipse to the flightgear source repository, the place to do it is fgmeta. Some scripting may be needed to manage the eclipse configuration file or files as part of fgmeta. But we're getting ahead of ourselves by mentioning this. Forget I said anything about it. Lets just make it work first.

Configuring an IDE

Although the details may vary from IDE to IDE, the process of configuring them has similar requirements. Git, Cmake and other tools may need to be configured within the IDE or externally. Any step in the development workflow that can't be handled directly in an IDE will likely need to be done using a script. Then, Source, Build and Install directories will need to be configured for each project.


Eclipse configuration

git

cmake

Qt

Project Directories

[20]

source directories

build directories

install directories

Building

Test Suites

Debugging

Additional Software Development Tools

Path Tracing

Performance Monitoring

Code Analaysis

Running Flightgear

Additional Environments

Linux Distributions

Windows

Mac

Eclipse configuration

git

cmake

Qt

Project Directories

source directories

build directories

install directories

Building

Test Suites

Debugging

Additional Software Development Tools

Path Tracing

Performance Monitoring

Code Analaysis

Running Flightgear

Additional Environments

Linux Distributions

Windows

Mac

Callahanp (talk) 11:19, 4 September 2018 (EDT)