klayout-r2739: Small patch for build.sh and build error

edited April 2015 in General

Hello,

I just tried to run build.sh of the latest source (klayout-r2739) under my Ubuntu 14.04 x64 VM, after using the following line to install the necessary requirements:

sudo apt-get install qt4-dev-tools python2.7-dev ruby1.9.1-dev 

Using this setup, build.sh ran into a problem in that it couldn't automatically find the Python library path.

The problem is mentioned here, which led to a solution which I added to the build.sh file. Here is the patch:

--- build.sh.old    2015-03-31 09:04:11.000000000 +1030
+++ build.sh    2015-04-01 16:06:21.515434154 +1030
@@ -310,6 +310,11 @@
         echo "*** WARNING: Could not get Python library path"
       else
         PYTHONLIBFILE="$PYTHONLIBFILEPATH/$PYTHONLIBFILENAME"
+        if [ ! -f "$PYTHONLIBFILE" ]; then
+          echo "*** WARNING: Python library not in default path, trying to use MULTIARCH"
+          PYHTONMULTIARCH=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('MULTIARCH')[0])"`
+          PYTHONLIBFILE="$PYTHONLIBFILEPATH/$PYHTONMULTIARCH/$PYTHONLIBFILENAME"
+        fi
         echo "    Python library found: $PYTHONLIBFILE"
       fi
     fi

Using that, build.sh was able to find the Python library.

Unfortunately, there was a build error which I haven't been able to solve yet:

gsiDeclLayApplication.o: In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.248]':
gsiDeclLayApplication.cc:(.text.startup+0xd11): undefined reference to `gsi::decl_QApplication'
gsiDeclLayDialogs.o: In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.1323]':
gsiDeclLayDialogs.cc:(.text.startup+0x1763): undefined reference to `gsi::decl_QDialog'
gsiDeclLayDialogs.cc:(.text.startup+0x3395): undefined reference to `gsi::decl_QMainWindow'
gsiDeclLayMainWindow.o: In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.251]':
gsiDeclLayMainWindow.cc:(.text.startup+0x5e95): undefined reference to `gsi::decl_QMainWindow'
collect2: error: ld returned 1 exit status

Has anyone come across this problem?

Comments

  • edited April 2015

    Hi friendfx,

    thanks for the build script patch - I'll include that in the snapshot.

    The build issues are strange. The message indicates that there is something wrong with the Qt bindings feature. The feature seems to be halfway enabled - the references to the Qt bindings of QApplication, QDialog and QMainWindwo are required but not included.

    Have you tried a complete rebuild? Maybe the Qt binding feature was enabled (-with-qtbinding) but maybe dropped later so the build is incomplete.

    Matthias

  • edited April 2015

    Hi Matthias,

    Thanks for pointing me into the right direction, seems like I made a silly mistake when re-typing the commands, re-building with the -with-qtbinding option set worked nicely.

    One question about the reported version, though: At the Help/About dialog, it still says "KLayout 0.24-python-eval" and "r2587", which doesn't match the name of the downloaded package "klayout-r2739.tar.gz". Is that just a display thing?

  • edited April 2015

    Hi friendfx,

    yes, the version string is a display topic.

    It's not updated currently by the snapshot cronjob. I'll fix that. Thanks for pointing that out.

    Matthias

Sign In or Register to comment.