Skip to content
gitbaum edited this page Mar 9, 2012 · 4 revisions

Compiler Setup for Wiselib Development

Compiler Setup for Wiselib Development

Since the Wiselib is C++ library using templates, an appropriate C++ compiler is required for integration in the appropriate platform. A C++ compiler may be already provided when using Shawn or iSense, or must be self compiled when using the MSP. So far, the Wiselib has only been compiled GCC based compilers - hence, it is not known if the compilation works with other compilers such as IAR. But since only standard language constructs are supposed to be used within the Wiselib, it may be enough to provide corresponding external interfaces for the new compiler/platform.

However, there are only a few requirements for the C++ compiler. Since there is a broad span of compilers to be supported, the intersection of these is small. For example, the whole libstdc++.a is not needed. This includes RTTI, dynamic memory management operators new and delete, and exceptions. Also, the STL is not needed. On the other hand, template support must be provided. This includes member templates and template template parameters.

The concrete GCC compiler version should not be very important. Currently, we support a wide range of compiler versions. Beginning with the old msp430-g++, which is at 3.2.3 (with mspgcc4, there is also 4.4.x avlaible), over the 4.1.2 with avr-g++ and the 4.2.1 with iSense ba-elf-g++, to the latest 4.4.x versions on desktop systems when using Shawn.

Shawn and iSense

The sensor network simulator Shawn and the iSense firmware are both written in C++ - hence, they fulfill all needs for the Wiselib. Basically, it is only needed to add the Wiselib include paths. See iSense Wiselib Application or Shawn Wiselib Application for details.

MSP

We have used the mspgcc4 (in version 4.4.4 with binutils 2.21) for Wiselib compilation. It must be compiled by the user, but easy-to-use scripts are provided (buildgcc.sh, buildgcc.pl). However, versions up to release 20110213 had problems with templates with too many template arguments (see mspgcc bugtracker for details). If wanted, a pre-compiled 4.4.4 version can be downloaded here (compiled on Debian system).

With newer versions, these steps are no longer required. Just follow:

Atmel

A description of how to compile your avr-gcc is given here:

There is only one parameter that must be changed. When compiling avr-gcc, add "c++" to enable-languages:

  • --enable-languages=c,c++

ARM

We used the gnuarm-buildscript by FU Berlin that can be found here:

To also download corresponding GCC-C++ version, add the following to download():

In method build_gcc(), the file must be extracted, and C++ support must enabled. Add the following:

  • tar -xjf ${FILES}/gcc-g++-${GCC_VER}.tar.bz2 &&
  • --enable-languages=c,c++
Clone this wiki locally