Thursday, June 20, 2019

Making Xilinx ISE 14.7 run on Ubuntu 18.04

While cleaning my office I came across a timing diagram I'd drawn for an HDMI decoder I'd starting writing for the Digilent Atlys board, which has a Xilinx Spartan 6 FPGA. Curious to see how far I'd taken this project, I fired up the Xilinx ISE IDE. Or at least I tried to.

The last time I ran ISE I was running a derivative of Ubuntu 16.04. Now that I'm running a derivative of Ubuntu 18.04, ISE wouldn't run. And since ISE hasn't been updated since 2013 (and won't be), this is a problem. Here's the error message I got:
libpng warning: Application jmp_buf size changed
As a long-time Linux developer I recognized right off the bat that some library ISE uses must have changed in an incompatible manner. Using the "strace" utility I identified that the problem occurs when attempting to process a particular font. A web search showed that someone else "fixed" this problem by deleting that font, but that seemed like a bad idea to me.

Long ago, Xilinx realized that they would face a serious challenge trying to keep ISE and related software products running on the infinite variety of Linux flavors. So they started collecting the libraries they used and shipped them with the programs. This is similar to what Windows used to do, except Linux provides a means for making it work without trashing the libraries used by other applications. I figured it was worth trying to add a copy of the newly problematic library taken from an Ubuntu 16.04 installation to Xilinx's collection of libraries.

The library that causes the problem is called "libpng", which handles Portable Network Graphic (PNG) format files. Ubuntu 16.04 uses version 1.2 of this library, while 18.04 provides version 1.6. However, merely copying this library from an Ubuntu 16.04 system into the Xilinx library directory didn't fix the problem — ISE continued to use the newer library. Working back up a level I found that this library is required by the "libfreetype" library, which manages Freetype fonts. It seems libfreetype linked specifically to the libpng version 1.6 library rather than using whatever version library is installed. Also copying libfreetype from 16.04 lets ISE run.

Now, if you're a Linux user and not a Linux developer, trying to duplicate this might be a bit confusing. Okay, probably very confusing, as there are a bunch of symlinks of various names to the real sharable library files. To make this easier I'll list the minimal commands necessary to do this on an Ubuntu 18.04 x86_64 system:
SRC=path to the Ubuntu 16.04 root directory (/mnt/sda?)
DST=path to Xilinx installation directory (/opt)
cd $DST/Xilinx/14.7/ISE_DS/common/lib/lin64
cp -p $SRC/lib/x86_64-linux-gnu/libpng12.so.0 ./
cp -p $SRC/usr/lib/x86_64-linux-gnu/libfreetype.so.6 ./
After this ISE should run normally.

If you're doing a new ISE installation, you'll find the ISE installer has a similar problem. Fortunately the same trick works for the installer. The only difference is the destination path. After extracting the installation tarball you want to cd to Xilinx_ISE_DS_Lin_14.7_1015_1/lib/lin64 rather than the path given above.

2 comments:

  1. Hello, I got the same error on Ubunbtu 20.04
    Here is the error:
    libpng warning: Application jmp_buf size changed
    ./bin/lin64/xsetup: line 21: 5664 Segmentation fault (core dumped) ${XLNX_DIR_NAME}/_xsetup "$@"
    I tried to replicate your steps but I am getting same error

    ReplyDelete
  2. Thank you for this! Finally it works!!

    ReplyDelete