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

From FlightGear wiki
Jump to navigation Jump to search
mNo edit summary
Line 2: Line 2:
== Overview ==
== 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.
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.   
* 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 and libraries.  
* If there is more than one executable in the project, you build be able to build them all within the IDE.   
* 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 most IDEs, 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 by using links within the project directory or a feature of the IDE that allows importing the code without making a separate copy.
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.   
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.


== Installing Eclipse ==
== IDEs ==
Eclipse can be installed on Ubuntu from the Ubuntu software repositories, or from the  [http://www.eclipse.org/downloads/packages/ Eclipse download page].  Eclipse tarballs are usually installed in /opt/eclipse, but may be installed elsewhere with a link
* [[Eclipse]]
* [[QTCreator]]
* [[CodeBlocks IDE]]


sudo ln ~/Downloads/eclipse/eclipse opt/eclipse
see: [https://askubuntu.com/questions/26632/how-to-install-eclipse How to install Eclipse] for additional details.


== Prerequisite supporting packages ==  
== Prerequisite supporting packages ==  
Line 48: Line 55:
An open source HLA/RTI implementation.
An open source HLA/RTI implementation.


OpenRTI https: [//sourceforge.net/projects/openrti/]
{| class="wikitable"
OpenRTI Wiki: [https://sourceforge.net/p/openrti/wiki/Home/]
|-
Flightgear HLA Wiki Page: [http://wiki.flightgear.org/Developing_with_HLA]
| OpenRTI || [https://sourceforge.net/projects/openrti/]
Wikipedia page on RTI: [https://en.wikipedia.org/wiki/Run-time_infrastructure_(simulation)]
|-
| OpenRTI Wiki || [https://sourceforge.net/p/openrti/wiki/Home/]
|-
| Flightgear HLA Wiki Page || [http://wiki.flightgear.org/Developing_with_HLA]
|-
| Wikipedia page on RTI || [https://en.wikipedia.org/wiki/Run-time_infrastructure_(simulation)]
|}
 
=== Simgear ===
=== 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 is a library of supporting functions that can be used by any kind of simulator.  It is part of the Flightgear Project.
Line 100: Line 114:
|}
|}


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.   
I hope that this directory structure will suffice for eclipse.  There may have to be a level of indirection in the Eclipse and QTCreator project directories so that the configuration files are not added to the upstream repository when submitting changes.   
 
If at some point we want to add IDE project files to the flightgear source repository, the place to do it is fgmeta.  Some scripting may be needed to manage the 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.
 
== Installing the IDE ==
 
This topic is pretty well covered on the Web.  We don't need to explain things here, except to note that you can go with a distribution's current version, obtain the latest built version directly or build the IDE yourself.  Pick your poison.


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 ==
== 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.  
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, possibly but not necessarily called from within the IDEFinally, IDE projects will have to be created, linking to Source, Build and Install directories.  


Again, you can find specific information about configuring most IDE's with a number of software tools on the web.  Here, we'll provide links to information on several aspects of configuring.  Remember that these links will eventually need maintenance to stay fresh.  In that case, Google the name of the ide with "Cmake", "GIT", "CPPUnit"  or other tools along with the name of your OS.


== Eclipse configuration ==
== IDE Usage ==  
=== git ===
 
=== cmake ===
Most of the workflow tasks you do in an IDE may already be familiar to you.  If not, here's a list of what developers typically do in an IDE
=== Qt ===
 
=== Project Directories ===
* Research to locate code related to some specific feature of the application by searching the entire project for one or more strings.
* Making changes to one or more files in the project
* Finding changes already made
* Running the application with a debugger
* Running application tests built with tools like cppUnit
* Running Code Analysis tools to profile the application in some way
* Producing API or other documentation
 
Newcomers to an IDE or IDE's in general may find instructions for these kind of workflows useful.  If called for, we can provide them, otherwise google it.


[https://stackoverflow.com/questions/38131663/qt-development-on-linux-using-eclipse/38140914#38140914]
[https://stackoverflow.com/questions/38131663/qt-development-on-linux-using-eclipse/38140914#38140914]


=== source directories ===
 
=== build directories ===
=== install directories ===
=== Building ===
=== Test Suites ===
=== Debugging ===
== Additional Software Development Tools ==
== Additional Software Development Tools ==
=== Path Tracing ===
=== Path Tracing ===
=== Performance Monitoring ===
=== Performance Monitoring ===
=== Code Analaysis ===
=== Code Analaysis ===
=== Running Flightgear ===
 
== Additional Environments ==
== Additional Environments ==
Many IDEs are suitable for cross platform work.  The details of installation and configuration might differ between platforms, but the IDE will work similarly.  Cross Platform work may be done by using an IDE on each platform, or by cross compiling on one platform for execution on another. 
Is there IDE support for Cross Compiling?
=== Linux Distributions ===
=== Linux Distributions ===
=== Windows ===
=== Windows ===
=== Mac ===
=== Mac ===


== Eclipse configuration ==
 
== Eclipse Configuration ==
=== git ===
=== git ===
=== cmake ===
=== cmake ===
=== Qt ===
=== Qt ===
=== Project Directories ===
=== Project Directories ===
=== Building, Running and Debuging ===
=== Test Suites ===
== QTCreator configuration ==
=== git ===
=== cmake ===
=== Qt ===
=== Project Directories ===
=== Building, Running and Debuging ===
=== Test Suites ===
== CodeBlocks Configuration ==
== NetBeans Configuration ==




=== source directories ===
=== build directories ===
=== install directories ===
=== Building ===
=== Test Suites ===
=== Debugging ===
== Additional Software Development Tools ==
== Additional Software Development Tools ==
=== Path Tracing ===
=== Path Tracing ===
Line 150: Line 185:
=== Code Analaysis ===
=== Code Analaysis ===
=== Running Flightgear ===
=== Running Flightgear ===
== Additional Environments ==
== Additional Environments ==
=== Linux Distributions ===
=== Linux Distributions ===

Revision as of 15:18, 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.
  • 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 and libraries.
  • If there is more than one executable in the project, you build be able to build them all within the IDE.
  • 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 most IDEs, 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 by using links within the project directory or a feature of the IDE that allows importing the code without making a separate copy.

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.

IDEs


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 [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 and QTCreator project directories so that the configuration files are not added to the upstream repository when submitting changes.

If at some point we want to add IDE project files to the flightgear source repository, the place to do it is fgmeta. Some scripting may be needed to manage the 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.

Installing the IDE

This topic is pretty well covered on the Web. We don't need to explain things here, except to note that you can go with a distribution's current version, obtain the latest built version directly or build the IDE yourself. Pick your poison.

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, possibly but not necessarily called from within the IDE. Finally, IDE projects will have to be created, linking to Source, Build and Install directories.

Again, you can find specific information about configuring most IDE's with a number of software tools on the web. Here, we'll provide links to information on several aspects of configuring. Remember that these links will eventually need maintenance to stay fresh. In that case, Google the name of the ide with "Cmake", "GIT", "CPPUnit" or other tools along with the name of your OS.

IDE Usage

Most of the workflow tasks you do in an IDE may already be familiar to you. If not, here's a list of what developers typically do in an IDE

  • Research to locate code related to some specific feature of the application by searching the entire project for one or more strings.
  • Making changes to one or more files in the project
  • Finding changes already made
  • Running the application with a debugger
  • Running application tests built with tools like cppUnit
  • Running Code Analysis tools to profile the application in some way
  • Producing API or other documentation

Newcomers to an IDE or IDE's in general may find instructions for these kind of workflows useful. If called for, we can provide them, otherwise google it.

[20]


Additional Software Development Tools

Path Tracing

Performance Monitoring

Code Analaysis

Additional Environments

Many IDEs are suitable for cross platform work. The details of installation and configuration might differ between platforms, but the IDE will work similarly. Cross Platform work may be done by using an IDE on each platform, or by cross compiling on one platform for execution on another.

Is there IDE support for Cross Compiling?

Linux Distributions

Windows

Mac

Eclipse Configuration

git

cmake

Qt

Project Directories

Building, Running and Debuging

Test Suites

QTCreator configuration

git

cmake

Qt

Project Directories

Building, Running and Debuging

Test Suites

CodeBlocks Configuration

NetBeans Configuration

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)