Skip to content
Open source Distributed Network Protocol
C++ XSLT C# C Scala Shell
Find file
Pull request Compare This branch is 667 commits ahead, 2 commits behind greenenergycorp:master.
Latest commit 6cfd21b @devans devans Updated version to 1.1.0-RC1
Failed to load latest commit information.
config Updated doxygen build to use template config file to set paths
demos Removed rake build system and associated directories
docs Removed rake build system and associated directories
java Updated version to 1.1.0-RC1
profile minor tweaks to some vendor specific attributes
schema Moved xsds to schema directory
src Updated astyle and ran it
swig Changed java package name to org.totalgrid.dnp3
teamcity Renamed goofy teamcity directory
tools/install_scripts Removed rake build system and associated directories
vstudio10 Segregated windows-based sub-projects into their own directory
windows Segregated windows-based sub-projects into their own directory
.gitignore Updated/cleaned up git ignore
AUTHORS Initial autotools support builds 2 libraries (libopendnp3_[apl|dnp3])…
CHANGELOG.markdown Updated changelog for 1.1.0
COPYING Lots of changes with this one:
ChangeLog Added blank ChangeLog file, needed for automake compliance.
FILE_LICENSE Fixed file permissions.
INSTALL Enhanced support for parallel 'make' builds Updated version to 1.1.0-RC1
NEWS Initial autotools support builds 2 libraries (libopendnp3_[apl|dnp3])…
NOTICE Fixed file permissions.
README Updated changelog for 1.1.0 Updated version to 1.1.0-RC1
version.hpp Prepare for next development cycle


      Copyright (c) 2010, 2011 Green Energy Corp.
      This project is licensed under the terms of the Apache Public License
      v2.0.  For additional details on licensing terms and conditions, see
      For more information about the OpenDNP3 library, visit the project
      website at


The OpenDNP3 library and testset is a portable, scalable, and
rigorously tested implementation of the DNP3 ( protocol
stack written in C++ and provided by Green Energy Corp to the community
under the Apache 2.0 license.  The library is optimized for massively
parallel front end  processor implementations and slave device
simulations, although it has been verified to perform very well on
embedded linux ARM architectures. It includes a command line
master/slave test set.

Building and Installing

The OpenDNP3 library can be built in Linux using GNU autotools or in Windows
using the provided Visual Studio projects.

## GNU autotools ##

The GNU autotools are comprised of two packages, GNU autoconf and GNU
automake.  Libtool support is required.  Lcov and swig support may be
required if you choose to build those options.


  - astyle v2.01 or later           (required if 'make astyle')
  - boost v1.42 or later            (required)
    * boost::date_time              (required)
    * boost::program_options        (required)
    * boost::system                 (required)
    * boost::thread                 (required)
    * Boost Unit Test Framework     (required)
  - docbook v0.6.14 or later        (required if 'make docs')
  - lcov                            (required if 'make lcov')
  - libtool                         (required)
  - swig v1.3.17 or later           (required if 'configure --with-java')
  - Java JDK with JNI support       (required if 'configure --with-java')
  - Python 2.6 or later             (required if 'configure --with-python')

To start, first reinitialize autotools to be compatible with the version
running on your system:

      autoreconf -f -i

Next, create a build directory and run the 'configure' script:

     mkdir build
     cd build

A full list of options can be found using 'configure --help'.

You can now build the OpenDNP3 libraries and programs:


When ready, you can install the libraries, headers, and programs onto
your system:

      make install

If you want to generate the book "OpenDNP3 Library: The Definitive
Guide," use one or more of the following make target after configuring
the system:

      make docs
      make docs-html
      make docs-pdf

The resulting book will be placed in a subfolder inside of the 'docs'

If you want to build the doxygen code documentation, use the following
make target after configuring the system:

      make doxygen-doc

The resulting HTML documentation will be placed in a folder named

If you want to build the libraries with lcov support (analysis tool for
code coverage of the unit/integration test infrastructure), the process
changes slightly:

      autoreconf -f -i
      ./configure --enable-lcov
      make lcov

The lcov HTML report is written to './lcov/html/index.html' and can be
opened with any standard web browser.

If you will be making changes to the unit/integration test
infrastructure while analyzing the lcov results, use an alternate
sequence to reduce the amount of rebuilding required:

      autoreconf -f -i
      ./configure --enable-lcov
      make lcov

Iterate on the following sequence after changing the tests:

      make lcov-reset        ; # Reset lcov data between each run
      make                   ; # Rebuild with the new changes
      ./test-dnp3            ; # Profile the new changes
      make lcov-report       ; # Regenerate the lcov report

If you are a developer and are making changes to the OpenDNP3 library
code, you can run the 'astyle' utility to ensure that your code
conforms to the style guidelines used for the project:

      make astyle

Please run this utility before submitting any patches to the project.

If you want to build the Java bindings for the OpenDNP3 library, make
sure that your system has both swig and a valid JDK installed.  Enable
the build tree to create the Java library:

      autoreconf -f -i
      ./configure --with-java=/path/to/jdk/include

The Java source files are created in the 'maven' build directory, which allows 
for compiling, testing, and publishing the Java sub-project with Maven.

If you want to build the Python bindings for the OpenDNP3 library, make
sure that your system has both swig and a valid Python interpreter
installed.  Enable the build tree to create the Python library:

      autoreconf -f -i
      ./configure --with-python

The Python library is called pyopendnp3.  The Python class and shared
library are installed to the 'opendnp3' package directory.

## Windows / Visual Studio ##

A solution and project files for Visual Studio 2010 can be found in the `vstudio10` directory.

The Visual Studio solution is organized as a set of projects of libraries and

The main libraries are:

  - *APL*            - Portable functionality for things like parsing, physical layers, logging
  - *APLTestTools*   - Library of tools/mocks uses for testing
  - *DNP3*           - Protocol library for dnp3
  - *Terminal*       - Extensible library for creating command line driven UI
  - *DNP3Java*       - Library generated by swig that wraps the stack with JNI

The main executable targets are:

  - *TestAPL*        - A test suite for the protocol framework library
  - *DNP3Test*       - A test suite for the DNP3 library
  - *TerminalTest*   - A test suite for the Terminal library
  - *TestSet*        - A dnp3 command line master/slave test set.

External Dependencies/Miscellaneous

### Install Boost ###

If possible, install the boost libraries packaged for your OS distribution. 
Otheriwse, you can build and install the boost libraries and headers by 
running the following helper script:

   cd tools/install_scripts/boost/{VERSION}

This step will take some time as it retrieves the boost package and
builds from source.

### TOOLS_HOME ###

The Visual Studio build expects the Boost libraries to be installed to 
a path specified by the TOOLS_HOME environment variable. Set it to an 
appropriate directory for installing tools and libraries. The Boost 
install scripts also copy the Boost distributables to this location.

- On Windows this variable is set via:
   Start Menu > ControlPanel > System > Advanced > EnvironmentVariables

### Installing ARM Cross-Compiler ###

If you want to build for the Technologic Systems ARM platform, install
the cross-compiler:

      cd tools/install_scripts/crosstool

It is important that this step be completely successfully prior to the
boost installation, as the Boost libraries will be built for ARM as well
as your platform.
Something went wrong with that request. Please try again.