It looks like you're new here. If you want to get involved, click one of these buttons!
Hi there,
trying to build on CentOS7
one of the link stages fail because libklayout_pya.so requires libpython3.8.so.1.0 - which isn't specified in the linker options...
The command that fails is:
g++ -Wl,-O1 -Wl,-z,relro -Wl,-rpath,/home/cad/klayout/28.8 -Wl,-rpath-link,/usr/lib64 -o ../../../../build-release/strm2cif main.o -lz -L/mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../.. -lklayout_bd -lklayout_db -lklayout_tl -lklayout_gsi -lklayout_lib -lklayout_rdb -lklayout_lym -lklayout_rba -lklayout_pya /usr/lib64/libruby.so.2.0.0 -ldl -lQt5PrintSupport -lQt5Designer -lQt5MultimediaWidgets -lQt5Svg -lQt5Widgets -lQt5Multimedia -lQt5Gui -lQt5Xml -lQt5XmlPatterns -lQt5Network -lQt5Sql -lQt5Core -lGL -lpthread
I tried with:
./build.sh -prefix /home/cad/klayout/28.8
and
./build.sh -prefix /home/cad/klayout/28.8 -pylib /full/path/to/libpython3.8.so.1.0
Any idea what I'm doing wrong?
Here is the partial transcript...
gmake[3]: Leaving directory `/mnt/cad/klayout/git/klayout/build-release/buddies/src/bd' cd strm2cif/ && ( test -e Makefile || /usr/bin/qmake-qt5 -o Makefile /mnt/cad/klayout/git/klayout/src/buddies/src/strm2cif/strm2cif.pro CONFIG+=release RUBYLIBFILE=/usr/lib64/libruby.so.2.0.0 RUBYVERSIONCODE=20000 HAVE_RUBY=1 PYTHON=python3 PYTHONLIBFILE=/home/cad/anaconda/Anaconda3-2020.11/lib/libpython3.8.so.1.0 PYTHONINCLUDE=/home/cad/anaconda/Anaconda3-2020.11/include/python3.8 PYTHONEXTSUFFIX=.cpython-38-x86_64-linux-gnu.so HAVE_PYTHON=1 HAVE_QTBINDINGS=1 HAVE_QT_UITOOLS=1 HAVE_QT_NETWORK=1 HAVE_QT_SQL=1 HAVE_QT_SVG=1 HAVE_QT_PRINTSUPPORT=1 HAVE_QT_MULTIMEDIA=1 HAVE_QT_DESIGNER=1 HAVE_QT_XML=1 HAVE_64BIT_COORD=0 HAVE_QT=1 HAVE_CURL=0 HAVE_EXPAT=0 HAVE_PNG=0 PREFIX=/mnt/cad/klayout/28.8 RPATH=/home/cad/klayout/28.8 KLAYOUT_VERSION=0.28.8 KLAYOUT_VERSION_DATE=2023-06-06 KLAYOUT_VERSION_REV=0230783 ) && gmake -f Makefile gmake[3]: Entering directory `/mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif' g++ -Wl,-O1 -Wl,-z,relro -Wl,-rpath,/home/cad/klayout/28.8 -Wl,-rpath-link,/usr/lib64 -o ../../../../build-release/strm2cif main.o -lz -L/mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../.. -lklayout_bd -lklayout_db -lklayout_tl -lklayout_gsi -lklayout_lib -lklayout_rdb -lklayout_lym -lklayout_rba -lklayout_pya /usr/lib64/libruby.so.2.0.0 -ldl -lQt5PrintSupport -lQt5Designer -lQt5MultimediaWidgets -lQt5Svg -lQt5Widgets -lQt5Multimedia -lQt5Gui -lQt5Xml -lQt5XmlPatterns -lQt5Network -lQt5Sql -lQt5Core -lGL -lpthread /usr/bin/ld: warning: libpython3.8.so.1.0, needed by /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so, not found (try using -rpath or -rpath-link) /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `_Py_Dealloc' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyByteArray_Type' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyType_IsSubtype' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyErr_GivenExceptionMatches' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyExc_RuntimeError' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyEval_SetTrace' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyObject_HasAttrString' /mnt/cad/klayout/git/klayout/build-release/buddies/src/strm2cif/../../../libklayout_pya.so: undefined reference to `PyByteArray_Size'
Comments
I'm not sure ... the Python library should not be need to be listed explicitly as libklayout_pya.so is already linked against it.
Like in my case:
I assume in your case it is not found as the library is not located in a standard path. So you can try to follow the advice in the error message and include "/home/cad/anaconda/Anaconda3-2020.11/lib/" - which is the location of that library - in the RPATH:
Alternatively you can patch
./src/buddies/src/buddy_app.pri
and add the following in line 45:In that case I assume linking works, but you will need to set LD_LIBRARY_PATH when you run KLayout.
Matthias