Installing Lattice Diamond on Ubuntu 14.04

Lattice devices look appealing compared to other vendor offerings for some of the applications I am looking at right now, so I recently tried to install the Lattice Diamond development tools on my Ubuntu 14.04 machine. The vendor offers only an rpm targeting redhat like distro’s, so a little work was required to get it working.

I started off trying to install this natively, and in the end gave up. As noted in “Chapter 1” below. The solution that worked was to setup a fedora chroot, which in the end was not that hard. If you want almost working solution, skip down to “Chapter 2”.

EDIT^2: After trying and failing with chroot fedora core 6, chroot fedora core 14, fedora VM and Windows XP, I finally have a working solution. It runs correctly under an OpenSUSE 11 chroot. I am revising Chapter 2 to reflect this. After failing with the Fedora VM I gave up and installed it under Windows XP… and it still didn’t work!

Chapter 1: What didn’t work

There doesn’t seem to be much info online. I found this tutorial but it is quite old (ubuntu 11) so there were some differences.

First I downloaded the .rpm from Lattice, installed alien, converted the rpm to a deb and installed it:

sudo apt-get install alien
sudo alien diamond_3_2-base_x64-134-x86_64-linux.rpm
sudo dpkg --install diamond-3-2-base-x64_3.2-135_amd64.deb

Alien takes a LONG time to convert the rpm. Note that I was working with diamond 3.2 64 bit. After the deb is installed diamond is now in /usr/local/diamond/. You will note it won’t run, now the fun begins.

First I had to manually untar the copy of tcl/tk that it includes, and link libpng to my local version:

cd /usr/local/diamond/3.2_x64/tcltk
sudo tar -xf tcltk.tar.gz
cd /usr/local/diamond/3.2_x64/bin/lin64
sudo mv
sudo ln /usr/lib/x86_64-linux-gnu/ -s

At this point, I could run diamond from the bin directory but the license file was not working properly. Despite a match between my hostid and the license file, it was reporting that it was incorrect. After poking around I realized that diamond looks only at “eth0” for the hostid, even though the other flex tools like their licensedebug app will iterate through and look at other interfaces. After fixing this so that my ethernet was on eth0 (getting rid of persistent net rules) it fired up.

Now the issue is that it seems diamond does not support any devices. When starting a new project there are no devices listed in the dialog. If a project is loaded it says that the project is for an unsupported device every time. This is where it sits now. I can’t get it to work beyond here sadly. There is no debug output from diamond at all, and stracing didn’t give me any clues. I’m sure it is a trivial detail, but at this point I have no leads.

Chapter 2: The working solution, schroot

With no luck at a native install, I decided to go with a chroot based installation. I didn’t want to do a virtual machine since fpga software tends to utilize lots of RAM and processing, which is not ideal to run in a virtual environment. This solution ended up to work quite well, with minimal disk overhead as well.

I loosely followed this guide, although I modified several steps.

First, I installed the necessary packages schroot and rinse:

sudo apt-get install schroot rinse

Then created the chroot environment using rinse:

sudo rinse --arch amd64 --directory /srv/chroots/opensuse11 --distribution opensuse-11.1

Your arch could vary (i386) if you are installing to 32 bit. After this I edited the schroot config file:

sudo joe /etc/schroot/schroot.conf

This file, schroot.conf, needs to have a single entry added to it:

description=Open SUSE 11
users=[your username here]

Now we need to disable the X security to allow the schroot to open a remote X session, and then we will launch schroot:

xhost +
sudo schroot -c opensuse11

At this point you should be inside your chroot environment and be looking at a prompt.
You now have to install a few extra packages as well as the diamond rpm file itself (you’ll need to download the diamond rpm and place it somewhere in your home directory):

zypper install tar xorg-x11-fonts*
zypper install diamond_3_3-base_x64-109-x86_64-linux.rpm

Substitute the correct name and path for the diamond rpm. Almost there! Now you need to setup a few things in the environment which will need to be done each time you run diamond, or you can put it into your bashrc inside the chroot:

export DISPLAY=:0
export LM_LICENSE_FILE=[path to your diamond license file]

That should be it! You can now navigate to ‘/usr/local/diamond/3.3_x64/bin/lin64’ and run the diamond executable. Like magic, it should launch and run.

I can report that this process did not work with any Fedora chroot I tried. The “ipexpress” application failed. I had a similar failure mode with Windows XP, but the OpenSUSE solution prevailed!

4 thoughts on “Installing Lattice Diamond on Ubuntu 14.04

  1. shuckc

    The reason why “Chapter 1” method fails is that when you converted the RPM to a DEB package, you did not pass --scripts argument, so the RPM pre/post scripts were not executed. The postinstall script contains commands to unarchive several more .tar.gz files:

    ~/Downloads $ rpm -qp –scripts diamond_3_3-base_x64-109-x86_64-linux.rpm

    preinstall scriptlet (using /bin/sh):

    export temp=`hostname`
    echo "Checking configuration of machine $temp..."
    export temp=`uname -m`
    if [ $temp != "x86_64" ]
    echo "The current hardware platform is 32-bit. Please install it on 64-bit platform or run 32-bit installer."
    exit 1
    echo "Installing Diamond 3.3 Base..."

    postinstall scriptlet (using /bin/sh):

    echo "Extracting compressed data files..."
    cd $RPM_INSTALL_PREFIX/diamond/3.3_x64/cae_library; tar xzf cae_library.tar.gz; rm -f cae_library.tar.gz
    cd $RPM_INSTALL_PREFIX/diamond/3.3_x64/docs; tar xzf docs.tar.gz; rm -f docs.tar.gz
    cd $RPM_INSTALL_PREFIX/diamond/3.3_x64/examples; tar xzf examples.tar.gz; rm -f examples.tar.gz
    cd $RPM_INSTALL_PREFIX/diamond/3.3_x64/ispfpga; tar xzf ispfpga.tar.gz; rm -f ispfpga.tar.gz
    cd $RPM_INSTALL_PREFIX/diamond/3.3_x64/synpbase; tar xzf synpbase.tar.gz; rm -f synpbase.tar.gz
    cd $RPM_INSTALL_PREFIX/diamond/3.3_x64/tcltk; tar xzf tcltk.tar.gz; rm -f tcltk.tar.gz

    preuninstall scriptlet (using /bin/sh):

    echo "Uninstalling Diamond 3.3 Base..."

    After doing this, all features worked for me.

    1. James Peverill Post author

      Interesting. I’ll have to try this. I did figure out to manually untar all those files and although it ran I still had issues with the interface not showing up properly. I assumed it was some gui or font related dependency.

      Thanks! I’ll have to remember that the next time I try to install an rpm.

  2. gerardoalan

    Hello! great work! I was installed Diamond without problems but I don´t know how execute diamond. In “gerardoalan-HP-Beats-15-Notebook-PC:/usr/local/diamond/3.4_x64/bin/lin64 # : ls” I see a lot of things some names “diamond”, “diamond_env”, “diamondc”, I think is one of this but I don´t know how execute, Can you help me, please?

Leave a Reply