Compiling Qucs on Ubuntu Linux

Update (July 2021)

The script below may not work anymore, but we have found an easier solution: someone has made an AppImage for Qucs. Just download the latest AppImage file from the direct link, give it execution permissions and start it.

Old article (January 2021)

We ended up discussing various circuit simulators at the club. One of these is Qucs, which is relatively good for certain kinds of simulations (such as S-parameter RF simulations), but not that actively maintained. Binary packages for many operating systems are outdated and information on compiling the software is fragmented, making it appear difficult to compile.

I’ve written ”instructions” on installing Qucs in the form of a shell script. I was told I should write a blog post on it instead, so that the information would be easier to find. So, here’s the shell script along with some useful comments.

#!/bin/sh
# Qucs installation.
# Works on Ubuntu 18.04.
# Ubuntu 20.04 doesn't work, since it doesn't have the QT4 package anymore.

set -e -x

# Place for sources and compilation. Set to whatever you like, as long as
# your user has permissions to the directory.
#SRCDIR=${HOME}/software
SRCDIR=/usr/local/src

mkdir -p ${SRCDIR}

# ADMS dependencies according to ADMS README
# Qucs dependencies according to https://github.com/Qucs/qucs/wiki/Build-Linux
sudo apt-get -y install git build-essential automake libtool gperf flex bison libxml2 libxml2-dev libxml-libxml-perl libgd-perl libqt4-dev libqt4-qt3support

cd ${SRCDIR}
git clone https://github.com/Qucs/ADMS.git

# Sourceforge is supposed to be the main repository for Qucs and Github just a
# mirror, but the Sourceforge master branch seems to be 2 years behind Github
# master branch. Branch "develop" is not present at all in Sourceforge.
# I'm confused, but let's just clone from Github then.
cd ${SRCDIR}
#git clone https://git.code.sf.net/p/qucs/git qucs
git clone https://github.com/Qucs/qucs.git

# Build ADMS
cd ${SRCDIR}/ADMS
./bootstrap.sh
./configure
make -j4
sudo make install
sudo ldconfig

# Build Qucs
cd ${SRCDIR}/qucs/qucs
./bootstrap
./configure
make -j4
sudo make install

cd ${SRCDIR}/qucs/qucs-core
./bootstrap
./configure
make -j4
sudo make install

Since an old version of Ubuntu is needed, I recommend using a Docker or systemd-nspawn container based on Ubuntu 18.04 to compile and run the software.