klayout icon indicating copy to clipboard operation
klayout copied to clipboard

Compile errors on Linux when using Qt5 built from source code

Open Kazzz-S opened this issue 2 years ago • 0 comments

Dear @klayoutmatthias,

I'm trying to build KLayout version 0.27.13 on Linux Mint 20.3 Una. For some reason (a bit trivial), I'd like to use a Qt5 built from source code. Since the distribution provides tools using Qt 5.12.8, I chose qt-everywhere-src-5.12.8.tar.xz and could successfully install it under the standard directory, namely, /usr/local/Qt-5.12.8/. While building KLayout using the /usr/local/Qt-5.12.8/bin/qmake tool, I got some compile errors.

To investigate the reasons, I have tested three different environments, as shown in the table below.

Step Linux OS Qt5 Tool Kit KLayout Build Status Log
1 Mint 20.3 5.12.8 built from source compile errors step1-qt5128-everywhere.zip
2 Mint 20.3 5.12.8 distributed binary pkg success step2-qt5128-MintUnaSystem.zip
3 Mint 20.3 5.15.7 built from source compile errors step3-qt5157-everywhere.zip

The apparent difference between Step 2 and other two is the presence of the -isystem flag in the g++ command line of Step 2. However, I do not understand why and how qmake inserted this flag. So far, I'm using the artifacts generated in Step 2.

I have also tested my older work environment:

Step Linux OS Qt5 Tool Kit KLayout Build Status Log
4 Mint 17.1 5.8.0 built from source success step4-qt580-everywhere.zip

Any suggestions to address this issue? Thank you and best regards, Kazzz-S


Edit-1

  • In Qt 5.12.8, -isystem is set in mkspecs/common/gcc-base.conf as
QMAKE_CFLAGS_ISYSTEM        = -isystem

Kazzz-S avatar Dec 06 '22 04:12 Kazzz-S