Compiling the Circuit Simulator kTechLab

I was searching for a circuit simulator for Linux and found kTechLab.

There is not a built package for Ubuntu (I’m using Ubuntu 16.04) then I compiled it from source code:

$ git clone https://github.com/ktechlab/ktechlab
$ cd ktechlab/
$ sudo apt-get install libqt4-dev
$ sudo apt-get install kdelibs5-dev
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Then I just execute:

$ ktechlab

And kTechLab starts in all its glory!

Update: to install kTechLab on Ubuntu 20.04 I also installed:

sudo apt install extra-cmake-modules
sudo apt install libqt5serialport5-dev
sudo apt install libkf5completion-dev
sudo apt install libkf5config-dev
sudo apt install libkf5core
sudo apt install libkf5coreaddons-dev
sudo apt install libkf5configwidgets-dev
sudo apt install libkf5doctools-dev
sudo apt install libkf5iconthemes-dev
sudo apt install libkf5kio-dev
sudo apt install libkf5parts-dev
sudo apt install libkf5texteditor-dev
sudo apt install libkf5windowsystem-dev
sudo apt install gpsim-dev

12 thoughts on “Compiling the Circuit Simulator kTechLab

  1. If you want to keep the installation inside your home directory, I recommend the following (replace ‘marcelo’ by your login account:

    cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/marcelo/bin/ktechlab ..
    make install

  2. kTechLab is new to me. I’ve never been very successful with spice in the past, except for very simple circuits – critical components were always missing from the parts library. How complete is the kTechLab parts library?

  3. Hi Celem, kTechLab is pretty complete. Also basic components and logic blocks are present. The interface is very friendly, but there are some silly BUGs. Please take a look, maybe it will fit your needs.

  4. No, thanks

    sudo apt-get install libqt4-dev kdelibs5-dev
    Будут установлены следующие дополнительные пакеты:
    automoc docbook-xsl kdelibs-bin kdelibs5-data kdoctools libattica0.4 libdbusmenu-qt2 libdlrestrictions1 libdrm-dev
    libgl1-mesa-dev libglu1-mesa-dev libkcmutils4 libkde3support4 libkdeclarative5 libkdecore5 libkdesu5 libkdeui5
    libkdewebkit5 libkdnssd4 libkemoticons4 libkfile4 libkhtml5 libkidletime4 libkimproxy4 libkio5 libkjsapi4
    libkjsembed4 libkmediaplayer4 libknewstuff2-4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkparts4 libkprintutils4
    libkpty4 libkrosscore4 libkrossui4 libktexteditor4 libkunitconversion4 libkutils4 libphonon-dev libphonon4
    libplasma3 libpthread-stubs0-dev libqca2 libqca2-plugins libqt4-designer libqt4-dev-bin libqt4-help
    libqt4-opengl-dev libqt4-qt3support libqt4-scripttools libqt4-svg libqt4-test libqtwebkit4 libsolid4
    libstreamanalyzer0v5 libstreams0v5 libthreadweaver4 libx11-dev libx11-doc libx11-xcb-dev libxau-dev
    libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev
    libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev
    libxfixes-dev libxml2-utils libxshmfence-dev libxxf86vm-dev mesa-common-dev phonon-backend-null qt4-linguist-tools
    qt4-qmake x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev
    x11proto-input-dev x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
    Предлагаемые пакеты:
    dbtoepub docbook-xsl-doc-html | docbook-xsl-doc-pdf | docbook-xsl-doc-text | docbook-xsl-doc docbook-xsl-saxon fop
    libsaxon-java libxalan2-java libxslthl-java xalan hspell kdelibs5-plugins firebird-dev libmysqlclient-dev libpq-dev
    libsqlite0-dev libsqlite3-dev qt4-dev-tools qt4-doc unixodbc-dev media-player-info libxcb-doc libxext-doc
    НОВЫЕ пакеты, которые будут установлены:
    automoc docbook-xsl kdelibs-bin kdelibs5-data kdelibs5-dev kdoctools libattica0.4 libdbusmenu-qt2 libdlrestrictions1
    libdrm-dev libgl1-mesa-dev libglu1-mesa-dev libkcmutils4 libkde3support4 libkdeclarative5 libkdecore5 libkdesu5
    libkdeui5 libkdewebkit5 libkdnssd4 libkemoticons4 libkfile4 libkhtml5 libkidletime4 libkimproxy4 libkio5 libkjsapi4
    libkjsembed4 libkmediaplayer4 libknewstuff2-4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkparts4 libkprintutils4
    libkpty4 libkrosscore4 libkrossui4 libktexteditor4 libkunitconversion4 libkutils4 libphonon-dev libphonon4
    libplasma3 libpthread-stubs0-dev libqca2 libqca2-plugins libqt4-designer libqt4-dev libqt4-dev-bin libqt4-help
    libqt4-opengl-dev libqt4-qt3support libqt4-scripttools libqt4-svg libqt4-test libqtwebkit4 libsolid4
    libstreamanalyzer0v5 libstreams0v5 libthreadweaver4 libx11-dev libx11-doc libx11-xcb-dev libxau-dev
    libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev
    libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev
    libxfixes-dev libxml2-utils libxshmfence-dev libxxf86vm-dev mesa-common-dev phonon-backend-null qt4-linguist-tools
    qt4-qmake x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev
    x11proto-input-dev x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
    обновлено 0, установлено 97 новых пакетов, для удаления отмечено 0 пакетов, и 150 пакетов не обновлено.
    Необходимо скачать 41,1 MБ архивов.
    После данной операции, объём занятого дискового пространства возрастёт на 189 MB.

  5. It means you don’t have Qt support on your Linux system. Qt is not only a graphic library, it is a complete framework with audio, input and many other things. The main advantage of Qt is it is multi-platform, so the same application will have same appearance and features in all systems, i.e. Skype. BR, Alan

  6. I followed the above commands and built ktechlab from the source. But when I type ktechlab in the terminal it is showing me the error
    ktechlab: command not found
    There were build warnings when I run make in the build directory.

    1. Hi Samuel, when you run “make install” you need to double check if the ktechlab binary is installed. BR, Alan

  7. Well, it worked.. but KTechLab seems to be a very unhappy piece of software.
    Never stops complaining:

    Could not find ‘klauncher’ executable.
    kdeinit4: Communication error with launcher. Exiting!
    (Critical) ktechlab(3794): No ksycoca4 database available!

    That ksycoca4 gets mentioned in its terminal output constantly.
    Another thing it constantly complains about is this:

    Could not find ‘klauncher’ executable.
    kdeinit4: Communication error with launcher. Exiting!
    (Critical) ktechlab(31075): couldn’t create slave: “Cannot talk to klauncher: The name org.kde.klauncher was not provided by any .service files”

    I’m running Kubuntu 18.10, so I have all KDE bells and whistles installed (I guess). Tried installing
    sudo apt-get install kinit
    sudo apt-get install kio
    sudo apt-get install kio-extras
    sudo apt install kdelibs-bin
    sudo apt install kdelibs5-data
    sudo apt install kdelibs5-plugin
    But they were all already installed.

    Also when I try changing component properties (say, chance resistance of a resistor) in Item Editor pane, then press Enter and click on the circuit diagram field to get back to editing, KTechLab crashes.

    Very discouraging.
    I wonder why they don’t provide a deb package or a repository (PPA).

Leave a comment