RHEL / CentOS 6 Build Scripts

edited October 2015 in KLayout Development
I delved into building KLayout 0.24.1 for CentOS 6 as I wanted to use the Python scripting feature. It wasn't too difficult, but I had to make some non-trivial changes for the 0.23.11 version.

The main problem was that Python and Ruby both have an include file named node.h. So the python files require different CFLAGS. Another Python file was missing an include.

If you are interested in building RPM on CentOS 6, please grab these changes at https://www.dropbox.com/s/pmhs64h5z20blrh/klayout_rpm_spec.tar.gz

Comments

  • edited October 2015

    Hi satya,

    thanks for providing this RPM.

    I assume that you are building against Ruby 1.8 since only with this combination, node.h is present twice. However, I recommend to use 1.9 and later. It's very difficult for me to maintain compatibility with all versions and sooner or later I will drop 1.8 support.

    I am usually also providing RPM's for download by employing OpenSuSE's build service. I have a setup for 0.24.1, but it's not building reliably due to the increased resource requirements for the build. If someone has experience with fixing these issues and wants to help out: here is the link to my OSC branch: https://build.opensuse.org/project/show/home:koefferl67:branches:Education.

    Matthias

  • edited November -1
    Hi Matthias,

    Thanks a lot for the new build.

    I understand Ruby 1.8 is a problem for you. But CentOS 6 is what I'll be using for a while due to other software dependencies. CentOS 6 only provides Ruby 1.8.7 and Python 2.6. Ruby 1.9.3 and Python 2.7 are available as Software Collections, but the build gets a little more complicated while referring to an SCL package. If I can make it work, and it's something you'd consider, I will share the SPEC file and patches.

    Regards,
    Satya
  • edited November -1

    Hi Satya,

    I have published the CentOS 6 RPM's on the downloads page in between for version 0.24.2. The OSC branch has expired in between, so please use the download links from there.

    But please note that the RPM provided there does not feature Python because of the reasons discussed in your post.

    Some of the patches you suggested should not be required any longer in 0.24.2. The Makefile patch is a smart one and it solves the problem with node.h. But I have not tested Python 2.6 myself. If you can confirm it works as expected, I will add 2.6 to the supported Python versions.

    In the next major release I will switch to qmake as the build frontend. That will open an opportunity to handle Python and Ruby interfaces differently with respect to include paths.

    Thanks,

    Matthias

  • edited November -1
    Hi Matthias,

    Thanks for the updates. I have modified the patches for the 0.24.2 release. The Makefile patch was a hack to get the build working without too much change. I think qmake should make it easier to handle Python and Ruby. Also, newer versions of Ruby and Python support pkg-config, making configuration much easier.

    Python 2.6 compiled alright, but it does not work in practice. So the SCL route is the only way to have KLayout with Python support installed system-wide. I think my SCL build using the Ruby200 and Python27 SCL works, but the spec file may need further cleanup. There are two packages needed for the SCL, a metapackage and the package proper. So there are two spec files. If you are interested you can get these at https://www.dropbox.com/s/pfh8uyzuwl9hbsh/klayout_scl.tar.gz

    To run the SCL klayout, the command is "scl enable klayout klayout"

    Thanks,
    Satya
  • edited November -1

    Hi satya,

    Thanks for your suggestions and your support.

    I want to try another option which is to enable Python 2.6. But I'm kind of busy rightno so that will have to wait a little.

    Thanks,

    Matthias

Sign In or Register to comment.