ISE DevelopmentEnvironment v1.3
ISE DevelopmentEnvironment v1.3
3
Setting-up the INGENIA SE Development
Environment
Ricardo Sanz ∗
∗
UPM Autonomous Systems Laboratory
This technical note succinctly describes the process to set-up a de- • The software incorporates artificial intelligence technolo-
velopment environment for C++ development to be used in the gies.
INGENIA SE course. It describes what is needed to install a basic • The software is distributed, i.e. is a collection of coupled
toolchain for C++ development and also what is needed for devel- programs running on a set of connected computers.
oping using an integrated development environment. • The software is embedded, i.e. runs on (usually small)
computers that are parts of larger systems.
Keywords: programming | C++ | toolchain | CygWin | IDE | Eclipse • The software is real-time, i.e. it has requirements con-
cerning the time taken to do some specific computations.
Installing a C++ toolchain 3 These two are the most used and most widely available
In Linux systems . . . . . . . . . . . . . . . . . . . . 3 tools, hence the effort dedicated to learn them will not be
In OSX systems . . . . . . . . . . . . . . . . . . . . . 3 wasted because it could be leveraged everywhere.
In Windows systems . . . . . . . . . . . . . . . . . . 3
Library File
Archiver .a
Debugger
Build File
Builder
.make
Figure 1 – A common workflow in the world of C++ programming. The collection of chained tools —the curved boxes— is usually called
toolchain.
From all these tools, we will only explicitly use the C++
compilation driver ( g++ ) the debugger ( gdb ) and the build
tool ( make ). Other tools will be implicitly used (for example
the m4 preprocessor or the linker). Figure 3 – The Eclipse CDT workbench.
Installing a C++ toolchain There are many IDEs out there. The best known ones are
In Linux systems. This is a natural environment for the GCC Microsoft Visual Studio in Windows systems, Apple XCode in
toolchain; just use the software installation commands of your OSX boxes and Eclipse in all classes of environments (Win-
Linux distribution. For example, in Ubuntu just write in a dows, OSX and Linux). This wider availability makes Eclipse
console the command ’sudo apt-get install g++”. the best IDE for systems engineers (that are never tied to
particular technologies and systems).
Eclipse is in fact not an IDE but an empty platform for
In OSX systems. Apple OSX is the natural environment of IDE construction. It can be extended to support many classes
Clang/LLVM; so in these systems it is natural to use Clang of software development projects. In the C and C++ domains,
more than GCC. Compilers are installed as part of the large Eclipse is enlarged into an IDE by means of the installation
XTools install but can also be installed alone as a separate of the C/C++ Development Toolkit (CDT). The CDT is a
package (look for ’Command Line Tools’, available as a sepa- collection of Eclipse-based features/plugins that provides the
rate download from the Apple developers website.) capability to create, edit, navigate, build, and debug projects
that use C and/or C++ as a programming language (See Fig-
ure 3).
In Windows systems. There are several ways of having a GCC However, the CDT just extends the Eclipse user frontend
compiler in a Windows box. The most used alternatives are environment and it does does not include the necessary back-
CygWin and MinGW. MinGW, a contraction of ”Minimal- end compilers. Compilers —and associated tools like linkers,
ist GNU for Windows”, is simpler and provides a minimalist profilers or debuggers— are used to convert C/C++ code into
development environment for native Microsoft Windows ap- binary executable programs and to inspect, assess or debug
plications. However, I recommend CygWin that provides a those programs. The CDT provides the frameworks that al-
complete UNIX-like environment that supports the complete low such backend toolchain elements to be integrated in a
GNU toolchain. consistent fashion hence providing an effective C/C++ IDE.
In all these cases, the program is written with any editor The Eclipse versatility is always there to allow you to mix and
and the compilation is done giving compilation commands in match such or other tools depending on your project require-
a console (see Figure 2). ments.
In many cases the host and the target of a specific de- Sometimes, specific distributions of the Eclipse/CDT —
velopment project coincide ( e.g. programming in a Linux e.g. some commercial distributions— do include the necessary
computer to execute in the same or another similar Linux toolchain and the frontend integrations. If yours does not —
computer). In other cases host and target do not coincide as is the case of plain vanilla Eclipse—, the base CDT does
and it is necessary to install a cross-compilation toolchain. provide support for integration with some common toolchains
—e.g. the GNU tools— for code build and debug. All this
means that if you want to use Eclipse/CDT you must previ-
The Eclipse C/C++ Development Toolkit ously install a C++ toolchain like GCC.
The use of command line tools is extremely effective but cum-
bersome for large scale code development that needs multiple
tools. This is especially important concerning code manage-
ment and visualization. The common strategy is to integrate
multiple tools in a graphical environment that provides easy
access to the many tools and visual rendering of many code
Figure 6 – Compiling and executing a program in the CygWin environment. The CygWin setup package selection tool is also seen.
• make
After this you will have a CygWin installation that you • gdb
can use runningn the cygwin program —a console where you
can work like in a UNIX system (see Figure 6) . Add %cygwin%\bin to your Windows PATH, so when
you open eclipse the Cygwin programs will be available to
Setup Cygwin toolchain in Eclipse CDT. If you want to use it. The Cygwin toolchain will be shown when you create a
the CygWin toolchain as a backend for the Eclipse CDT IDE, new C/C++ project using the wizard.
it is necessary to do some extra configuration steps to link To use the gdb debugger it may be necessary to estab-
Eclipse with the CygWin toolchain. lish some ”drive mappings” to give access to source code for
First, to easy Eclipse configuration, you must install debug. This is done in the Eclipse Preferences configuration
first CygWin and after this is installed and working, install panel.
Eclipse+CDT. In Eclipse, go to Windows → Preferences → C/C++→
For a quite complete Cygwin toolchain installation that Debug → Common Source Lookup. Add the following ’Path
can support most Eclipse CDT features these are the sug- mappings’:
gested CygWin packages to be installed:
\cygdrive\c → c:\
• binutils \cygdrive\d → d:\
• gcc
• gcc-core plus any other drives if any . . .
• gcc-g++
• gcc-mingw-core
• gcc-mingw-g++
application programming is the development of programs systems programming is the development of programs
that serve some purpose external to the computer system that are part or deeply linked to operating systems, in op-
— i.e. applications of interest to some final user. 1 position to application programming, where the programs
serve some purpose external to the computer system. 1
backend the part of the tooling that does not interface with
the user (i.e. the programmer) and performs the real work. target is the computer system where a particular software
1 will be executed. See host. 3
toolchain is the collection of elementary tools used to trans-
form source code into target executables. 1, 2, 4
C++ is a programming language evolved from C by inclu-
sion of the concept of class. It is defined in (Stroustrup,
2014). 1, 2 References
cross compiler a compiler executed in a platform to gener-
ISO/IEC (2014). ISO/IEC 14882:2014 – programming lan-
ate code for a different platform ( e.g. compile in Windows
guages - C++. International standard, International Stan-
generating an executable for Linux). 2
dards Organisation.
ISO/IEC (2017). ISO/IEC 14882:2017 – programming lan-
features are a form of packaging pluggable extensions of the guages - C++. International standard, International Stan-
Eclipse platform. 3 dards Organisation.
frontend the part of the tooling that interfaces with the user ISO/IEC (2018). ISO/IEC 9899:2018 - information technol-
(i.e. the programmer). 1 ogy - programming languages - C. International standard,
International Standards Organisation.
generic programming is a form of programming where Kernighan, B. and Ritchie, D. M. (1988). The C Programming
generic program snippets can be adapted to manipulate Language. Addison-Wesley, Reading, MA, second edition.
custom data types. 1, 2 Stroustrup, B. (2014). The C++ Programming Language -
4th Edition. Addison-Wesley, Reading, MA, fourth edition.
host is the computer system where a particular software is
developed. See target. 3, 6