klayout icon indicating copy to clipboard operation
klayout copied to clipboard

Execution an error occurred during build.sh compilation, 'libklayout_rba. so: undefined reference to ` rb_gc_writebarrier_unprotect'. How can I resolve it? '

Open WenjunHuang94 opened this issue 1 year ago • 11 comments

Execution an error occurred during build.sh compilation, 'libklayout_rba. so: undefined reference to ` rb_gc_writebarrier_unprotect'. How can I resolve it? ' image

WenjunHuang94 avatar May 12 '23 01:05 WenjunHuang94

My system is Centos7

WenjunHuang94 avatar May 12 '23 01:05 WenjunHuang94

This is not a log, this is a screenshot. Send the whole log and I may be able to help.

My recommendation is to build inside a clean Docker container. That avoids guessing about your particular system configuration. The centos7 Docker image that works for me is built using this Dockerfile:

FROM centos:7

RUN yum -y update \
 && yum clean all \
 && yum -y install \
      gcc \
      gcc-c++ \
      make \
      qt \
      qt-devel \
      ruby \
      ruby-devel \
      python3 \
      python3-devel \
      wget \
      fontconfig \
      gtk2 \
      dejavu-sans-mono-fonts \
      dejavu-sans-fonts \
      dejavu-serif-fonts \
      dejavu-fonts-common \
      openssh-server \
      git \ 
      which \
      rpm-build \
      xorg-x11-server-Xvfb \
      sudo

klayoutmatthias avatar May 12 '23 20:05 klayoutmatthias

Based on your suggestion, I used Centos7 Docker and successfully compiled klayout. However, when running the klayout program in the container, there is no interface to display it. How can I see the program interface? image

WenjunHuang94 avatar May 16 '23 09:05 WenjunHuang94

I meant using the Docker container you can build KLayout and deploy the resulting binaries to your target system. This way you do not have to deal with build problems arising from a contaminated system.

Just make sure you have installed the corresponding packages there or at least "qt", "ruby" and "python3".

Matthias

klayoutmatthias avatar May 16 '23 17:05 klayoutmatthias

I copied the compiled klayout project from the Docker container to a Centos7 system outside the container. However, when I attempted to run the klayout program, the interface appeared as a blank page rather than the expected klayout interface. What could be the reason for this discrepancy? image

WenjunHuang94 avatar May 17 '23 03:05 WenjunHuang94

https://github.com/KLayout/klayout/issues/1367#issuecomment-1550626276 @klayoutmatthias Could you please answer this question? Thank you very much!

WenjunHuang94 avatar May 22 '23 00:05 WenjunHuang94

Did you check that you have these packages installed : qt, ruby, python3 ?

What is the output when you type these 4 commands separately in console ? which qt which ruby which python3 klayout -d 20

chkkbim avatar May 22 '23 15:05 chkkbim

I think your target system is lacking the font packages and/or the image plugins from Qt.

But without access to the system I cannot tell further details.

Matthias

klayoutmatthias avatar May 22 '23 16:05 klayoutmatthias

Please try to install all the packages listed above also on your target system.

klayoutmatthias avatar May 22 '23 16:05 klayoutmatthias

@klayoutmatthias @chkkbim Thank you very much for your answer. I have successfully run klayout! But I can only copy the entire klayout project compiled in the Docker container to the Centos host, and finally run klayout and successfully display the interface. But I want to use X server directly in the container to display the klayout interface, but reporting errors as shown in the following figure. What should I do?

Centos host environment: image image

Running klayout in the Docker container reported an error: b008a0536ff0bb239ec59354536f29e

WenjunHuang94 avatar May 25 '23 07:05 WenjunHuang94

Docker is a standard technology and there are many tutorials how to use it with UI applications. One I used myself is this one: https://janert.me/guides/running-gui-applications-in-a-docker-container/

klayoutmatthias avatar May 25 '23 18:05 klayoutmatthias