[DynInst_API:] Dyninst 8.2 build documentation


Date: Tue, 22 Jul 2014 10:53:19 -0500
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: [DynInst_API:] Dyninst 8.2 build documentation
As per Bud's request...this will become INSTALL fairly shortly. Comments and requests for clarification are appreciated.


Building Dyninst with CMake

Dyninst and its components are no longer built with autotools, but with CMake. For a complete guide to using CMake, see the CMake documentation at http://www.cmake.org.

Quick upgrade guide for existing Dyninst users

In your desired build directory, invoke the following:

cmake /path/to/dyninst/source -Dfoo=bar …
make
make install

in place of:

configure --with-foo=bar
make
make install

The PLATFORM environment variable will be automatically set to our best guess of your platform; you may manually override this if necessary. Valid values are in cmake/platforms-unix.cmake and cmake/platforms-win.cmake.

The most common configuration options are:

BOOST_ROOT: base directory of your boost installation
CMAKE_CXX_COMPILER: C++ compiler to use
CMAKE_C_COMPILER: C compiler to use
LIBELF_INCLUDE_DIR: location of elf.h and libelf.h
LIBELF_LIBRARIES: full path of libelf.so
LIBDWARF_INCLUDE_DIR: location of libdwarf.h
LIBDWARF_LIBRARIES: full path of libdwarf.so
IBERTY_LIBRARY: full path of libiberty.[a|so]; libiberty.a must be built with -fPIC
CMAKE_[C|CXX]_COMPILER_FLAGS: additional C/C++ compiler flags to use
CMAKE_BUILD_TYPE: may be set to Debug, Release, or RelWithDebInfo for unoptimized, optimized, and optimized with debug information builds respectively. This replaces the NO_OPT_FLAG environment variable previously used by Dyninst. Note that Debug is the default; previously, the equivalent of Release was the default. CMAKE_INSTALL_PREFIX: like PREFIX for autotools-based systems. Where to install things.

For a full list of options, the curses-based ccmake or the GUI-based cmake-gui are the best choices. Note that, unlike with autotools-based systems, the COMPILER variables and the FLAGS variables are wholly separate; setting CMAKE_C_COMPILER=”/usr/bin/gcc -m32” will not behave correctly.

New capabilities

CMake allows Dyninst to be built out-of-source; simply invoke CMake in your desired build location. In-source builds are still fully supported as well. Each component of Dyninst may be built independently: cd $component; make. Standard make options will work; there is limited support for make -jN. Setting VERBOSE=1 will replace the beautified CMake output with raw commands and their output, which can be useful for troubleshooting. Libelf, libdwarf, and libiberty will be automatically downloaded and used in the build provided that they are needed, they cannot be found, and your CMake version is at least 2.8.11. With older versions of CMake, you will be required to specify the location of these libraries if they are not present in system default paths. Dyninst now requires the boost thread libraries in order to build proccontrolAPI. These are available from boost.org, and should be available as prebuilt packages on most Linux distributions.

--
--bw

Bill Williams
Paradyn Project
bill@xxxxxxxxxxx
[← Prev in Thread] Current Thread [Next in Thread→]