Building from Source

Before you can compile, you will need to define your CAN messages.

The build process uses GNU Make and works with Linux (tested in Arch Linux and Ubuntu), OS X and Cygwin in Windows. For documentation on how to build for each platform, see the supported platform details.

Makefile Options

These options are passed as shell environment variables to the Makefile, e.g.

$ DEBUG=1 make
DEBUG - Set to 1 to compile with debugging symbols and to enable debug
logging over UART.
PLATFORM - Select the target microcontroller platform
(see the platform specific pages for valid options).

UART - By default, UART output of OpenXC vehicle data is disabled. Set this to 1 to enable UART output.

ETHERNET - By default, TCP output of OpenXC vehicle data is disabled. Set this to 1 to enable TCP output on boards that have an Ethernet interface (only the chipKIT Max32 right now).

BOOTLOADER - By default, the firmware is built to run on a microcontroller with a bootloader, allowing you to update the firmware without specialized hardware. If you want to build to run on bare-metal hardware (i.e. start at the top of flash memory) set this to 0.

Note

When running make to compile, try adding the -j4 flag to build jobs in parallel - the speedup can be quite dramatic.

Troubleshooting

If the compilation didn’t work:

  • Make sure the submodules are up to date - run git submodule update --init and then git status and make sure there are no modified files in the working directory.
  • Did you download the .zip file of the cantranslator project from GitHub? Use git to clone the repository instead - the library dependencies are stored as git submodules and do not work when using the zip file.
  • If you get a lot of errors about undefined refernece to getSignals()' and other functions, you need to make sure you defined your CAN messages - read through CAN Message Definition before trying to compile.

Table Of Contents

Previous topic

Flashing a Pre-compiled Binary

Next topic

Testing

This Page