Close

Compiling OpenOCD from Source on Ubuntu 16.04

tom-verbeureTom Verbeure wrote 04/17/2018 at 17:31 • 3 min read • Like

First make sure you have all the necessary packages installed:

sudo apt-get install libtool pkg-config texinfo libusb-dev libusb-1.0.0-dev libftdi-dev autoconf

Then follow the instructions:

Compiling OpenOCD
-----------------

To build OpenOCD, use the following sequence of commands:

  ./bootstrap (when building from the git repository)
  ./configure [options]
  make
  sudo make install

If that's too easy for you, just follow the instructions below: 

git clone https://github.com/ntfreak/openocd.git
cd openocd
git submodule init
git submodule update
sudo apt-get install libtool pkg-config texinfo libusb-dev libusb-1.0.0-dev libftdi-dev autoconf
autoreconf -i
./configure --prefix=/opt/openocd

This should result in the following:

libjaylink configuration summary:
 - Package version ................ 0.2.0-git-8645845
 - Library version ................ 0:0:0
 - Installation prefix ............ /opt/openocd
 - Building on .................... x86_64-pc-linux-gnu
 - Building for ................... x86_64-pc-linux-gnu

Enabled transports:
 - USB ............................ yes
 - TCP ............................ yes



OpenOCD configuration summary
--------------------------------------------------
MPSSE mode of FTDI based devices        yes (auto)
ST-Link JTAG Programmer                 yes (auto)
TI ICDI JTAG Programmer                 yes (auto)
Keil ULINK JTAG Programmer              yes (auto)
Altera USB-Blaster II Compatible        yes (auto)
Bitbang mode of FT232R based devices    yes (auto)
Versaloon-Link JTAG Programmer          yes (auto)
OSBDM (JTAG only) Programmer            yes (auto)
eStick/opendous JTAG Programmer         yes (auto)
Andes JTAG Programmer                   yes (auto)
USBProg JTAG Programmer                 yes (auto)
Raisonance RLink JTAG Programmer        yes (auto)
Olimex ARM-JTAG-EW Programmer           yes (auto)
CMSIS-DAP Compliant Debugger            no
Cypress KitProg Programmer              no
Altera USB-Blaster Compatible           yes (auto)
ASIX Presto Adapter                     yes (auto)
OpenJTAG Adapter                        yes (auto)
SEGGER J-Link Programmer                yes (auto)

 Compile:

make -j 8
sudo make install

I had the ./configure step fail on me with the following error:

.../altera/13.0sp1/quartus/linux/tclsh: error while loading shared libraries: libtcl8.5.so: cannot open shared object file: No such file or directory
configure: error: ./configure.gnu failed for jimtcl

This is because there is already a different 'tclsh' in the PATH. In my case, it's the one of the Altera Quartus tool.

The solution was simply: just remove Quartus from your path and run ./configure again. The good news is that as long as you don't run 'make distclean', you'll be able to run ./configure in the future without having to remove Quartus from the path.  

Like

Discussions