Linux is the recommended platform for the Lely CANopen stack. While it is possible to build the stack on Windows with Visual Studio (not documented here) or Cygwin, it is generally easier to cross-compile the stack on Linux with MinGW. Instructions on how to cross-compile the stack for other (embedded) platforms can be found here.
Binary packages are available for the latest release. If you want to use an
older release, or the current
master branch, you need to
build the stack from source.
When developing and debugging CAN(open) applications on Linux, the
cansend tools from can-utils will
come in handy. They are available in the standard repositories of most Linux
For Debian/Ubuntu-based distributions, binary packages can be obtained from the Lely PPA. Add the PPA to your system with
sudo add-apt-repository ppa:lely/ppa sudo apt-get update
Besides the CANopen stack, this PPA also contains the faketime tools. These tools allow a user to run a command in an environment in which all or some of the system-wide real time clocks run at a user-specified rate and with a user-specified offset. This can be particularly useful to speed up tests without having to change the timing parameters.
To install the CANopen development packages and tools, run
sudo apt-get install liblely-coapp-dev liblely-co-tools python3-dcf-tools
Additionally, you may want to install
sudo apt-get install pkg-config
pkg-config allows you to obtain the compiler and linker flags needed to use
one of the core libraries. For example:
pkg-config --cflags liblely-coapp pkg-config --libs liblely-coapp
Most build systems have built-in support for
Finally, the can-utils package
contains several tools, such as
cansend, that may prove useful
for testing and debugging. It can be installed with
sudo apt-get install can-utils
Building from source
- Git (check by running
- GCC (check by running
g++ -v) or Clang (check by running
- Make (check by running
- GNU Autotools: autoconf, automake and libtool (check by running
Git is not necessary if you download the source code of one of the releases.
The optional Python bindings for the (deprecated) CAN and I/O libraries require Cython.
Under Linux, Bluetooth support in the I/O library requires the BlueZ headers (the library is not used). It is not necessary for the CANopen stack, so it can be omitted.
configure script will look for the
<valgrind/valgrind.h> header and, if
it is present, insert calls to
VALGRIND_STACK_DEREGISTER() in the fiber code to notify Valgrind about stack
On Debian/Ubuntu-based distributions, all dependencies (except Cython) can be installed with
sudo apt-get install \ git build-essential automake libtool \ python3-setuptools python3-wheel \ python3-empy python3-yaml \ libbluetooth-dev \ valgrind \ doxygen graphviz
If you want to use Clang instead of GCC, install it with
sudo apt-get install clang
Clone the repository with
git clone https://gitlab.com/lely_industries/lely-core.git cd lely-core
Initialize the build system (to create the
and build environment:
mkdir -p build cd build ../configure --disable-cython
--disable-cython disables the deprecated Python bindings.
A description of all the configuration options can be found here.
If you want to use Clang, prefix the
configure command with
to build the stack. If you want, you can run the test suite with
This takes about a minute.
make check-valgrind-memcheck to run the entire test suite under valgrind.
This takes considerably longer.
to install the headers, libraries, tools and, if you installed doxygen, the HTML documentation.
make install will install everything under
/usr/local. You can
change this directory by specifying the
--prefix option to
Only the Cygwin installation process is described here. While it is possible to build and use the stack with Visual Studio, we have not yet documented the process.
Click here for instructions on how to cross-compile the stack with MinGW on Linux.
Download the Cygwin setup program. Both the 32-bit and 64-bit version van be used.
setup-x86.exe or (
setup-x86_64.exe) and select the
Open a Cygwin terminal and follow the build instructions.