Compiling KLayout on Debian 10 Buster

I've been trying to compile the current version of KLayout on Debian 10 Buster.
Sadly, I get stuck in a sort of compilation loop, which repeats itself.

I'd be grateful for any help, and have attached the repeating segment below:

At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-reserved-user-defined-literal’
g++ -c -m64 -pipe -std=c++0x -fvisibility=hidden -O2 -D_REENTRANT -Wall -W -pedantic -Woverloaded-virtual -Wsign-promo -Wsynth -Wno-deprecated -Wno-long-long -Wno-strict-aliasing -Wno-deprecated-declarations -Wno-reserved-user-defined-literal -fPIC -DHAVE_QTBINDINGS -DHAVE_PYTHON -DHAVE_RUBY -DHAVE_RUBY_VERSION_CODE=20505 -DHAVE_QT -DKLAYOUT_VERSION=0.26.3 -DKLAYOUT_VERSION_REV=ab32f260 -DKLAYOUT_VERSION_DATE=2020-02-02 -DKLAYOUT_MAJOR_VERSION=0 -DKLAYOUT_MINOR_VERSION=26 -DKLAYOUT_TINY_VERSION=3 -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I../../../src/db/unit_tests -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I/usr/include/qt4/QtTest -I../../../src/tl/tl -I../../../src/db/db -I../../../src/gsi/gsi -I. -I../../../src/db/unit_tests -I. -o dbLayout.o ../../../src/db/unit_tests/
In file included from ../../../src/tl/tl/tlEvents.h:133,
from ../../../src/tl/tl/tlObjectCollection.h:28,
from ../../../src/tl/tl/tlLog.h:31,
from ../../../src/tl/tl/tlClassRegistry.h:29,
from ../../../src/db/db/dbUserObject.h:36,
from ../../../src/db/db/dbBoxConvert.h:32,
from ../../../src/db/db/dbInstances.h:32,
from ../../../src/db/db/dbCell.h:28,
from ../../../src/db/db/dbLayout.h:33,
from ../../../src/db/unit_tests/
../../../src/tl/tl/tlEventsVar.h: In member function ‘virtual void tl::generic_event_function<T, void, void, void, void, void>::call(tl::Object)’:
../../../src/tl/tl/tlEventsVar.h:118:13: warning: unnecessary parentheses in declaration of ‘argv’ [-Wparentheses]
void *(argv[]) = { _CALLARGPTRS };
../../../src/tl/tl/tlEventsVar.h: In member function ‘virtual void tl::generic_event_function_with_data<T, D, void, void, void, void, void>::call(tl::Object
../../../src/tl/tl/tlEventsVar.h:148:13: warning: unnecessary parentheses in declaration of ‘argv’ [-Wparentheses]
void *(argv[]) = { _CALLARGPTRS };



  • Is the compilation really stuck or are there just a lot of these warnings? Compilation may take about one hour on a single CPU.


  • Hi Matthias, indeed i just got a lot of those warnings.
    Didn't know compilation would take so long. Thank you very much for your help.

  • Sorry to bother again. Once the compile is finished I end up with the binary files in "bin-release".
    I can't execute the "klayout" file from bash, is that correct?
    How do I proceed with the binaries? I didn't find any info on github or the build instructions how to get to an executable program, and somehow always assumed the binaries would be executable...

    Sorry for the rookie questions.

  • Hi,

    Not a rookie question in my opinion :smile: . It is not always that easy to find out how to do it, since there are usually multiple different ways to do it with any projects.

    Maybe I can show you how I do it:

    First obviously git clone the repository.

    Then do the following in the repository folder:

    sudo ./ -j$(nproc) -prefix /usr/local/klayout -python /usr/bin/python3
    cd build-release/
    sudo make install
    sudo ln -s /usr/local/bin/klayout /usr/local/klayout/klayout

    This will first build KLayout, build it ( with how many processors your machine has), and then install it to /usr/local/klayout (this is the make install part). /usr/local is the folder (at least in debian) where user compiled projects should reside. Then finally I install a symlink into the bin to make it directly accessible in any shell.

    I know that ideally library files would reside in /usr/local/lib/klayout and the binary in /usr/local/bin, but I haven't figured out how to separate them, yet. The ideal approach would be to build a .deb package, but I am a bit lost how to build one. Maybe Matthias can bring more insight to that, as I think he has a CI way to build it :tongue: .


    P.S. @Matthias , is the multiline code formatting different than in the old style? I had to use quote for it, as the preview would look horrible otherwise, at least in the preview.

  • Hi Sebastian, thanks for the quick reply, and the clear and detailed instructions.
    With your suggestions I was able to complete the install. Instead of creating a symbolic link I went for a normal .desktop file.

    Thanks again for the great support. I learned a lot in the process!

  • Very good :)

    Actually "-prefix" is very similar to what you need in autoconf too. As KLayout's build is qmake based I can't make good use of autoconf, hence the build script.

    Instead of using prefix you can also copy "bin-released" wherever you want and set "LD_LIBRARY_PATH" to point to it. This is how I run test builds. Recently the Linux people added a nice feature to allow RPATH to be set to a relative one. But I have not tried whether this will solve the binary path relocation problem once and for all.

    @Sebastian I'm not aware of changes in the Markdown processing. I have used fenced code blocks ( before and it still works. Maybe indented code blocks don't work any more. Vanilla appears to be using php-markdown ( So please see the documentation there.


Sign In or Register to comment.