Build klayout inside conda environment

Has someone experience with building klayout inside a conda environment?
I am trying to build it on a Linux redhat 7 system with python 3.8.1 and qt5 but was not successful. Maybe someone can share a requirement list which works for him/her?

I tried different package combination which end up with different compiling issues. Maybe it is not possible to build it inside a conda environment?

Best regards


  • edited March 3

    Could you be a bit more specific? Like indicating what errors you encounter.

    kazzz is using the Anaconda environment to generate builds on MacOS and I did so experimentally on Windows with MSVC 2017, so basically it should work. I have no experience however on RedHat 7. On Linux I still prefer the system package approach. My experience with external package managers on Linux wasn't always encouraging.

    For CentOS 7 I am providing RPM's, so maybe you can simply use those.


  • As Matthias mentioned above, I could successfully build KLayout from its source using Anaconda3 on macOS(Catalina, Big Sur, Monterey) and Linux Mint 19.
    Please refer to the following for the more detailed environments.
    I hope this info helps you.


    (0) (base) MacBookPro2{sekigawa}(1)$ uname -a
        Darwin MacBookPro2.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jan 13 01:26:33 PST 2022; \
        root:xnu-6153.141.51~3/RELEASE_X86_64 x86_64
    (1) Anaconda3 Installation Path
        /Applications/anaconda3/ (can be a symbolic to  ---> $HOME/opt/anaconda3/)
    (2) (base) MacBookPro2{sekigawa}(2)$ conda --version
        conda 4.11.0
    (3) The three major modules for building KLayout from its source
        qt      5.9.7   h468cd18_1
        python  3.8.2   hc70fcce_0
        ruby    2.5.1   h7107397_0  (must be installed separately; causes the python downgraded to 3.8.2)
    (4) The setup for Anaconda3 build
        (base) MacBookPro2{sekigawa}(3)$ ./ -q qt5ana3 -p ana3 -r ana3 -c
        ### You are going to build KLayout
            for  <Catalina 19.6.0 x86_64>
            with <Qt=Qt5Ana3, Ruby=RubyAnaconda3, Python=PythonAnaconda3>...
        {   'bin': 'qt5Ana3.bin.macos-Catalina-release-Rana3Pana3',
            'build': '',
            'build_cmd': './',
            'check_cmd_only': True,
            'debug_mode': False,
            'deploy_tool': '/Applications/anaconda3/bin/macdeployqt',
            'logfile': '',
            'make_options': '--jobs=4',
            'no_qt_bindings': False,
            'no_qt_uitools': False,
            'project_dir': '/Users/sekigawa/GitWork/klayout',
            'pyinc': '/Applications/anaconda3/include/python3.8',
            'pylib': '/Applications/anaconda3/lib/libpython3.8.dylib',
            'python': '/Applications/anaconda3/bin/python3.8',
            'qmake': '/Applications/anaconda3/bin/qmake',
            'rbinc': '/Applications/anaconda3/include/ruby-2.5.0',
            'rblib': '/Applications/anaconda3/lib/libruby.2.5.1.dylib',
            'rpath': '@executable_path/../Frameworks',
            'ruby': '/Applications/anaconda3/bin/ruby'}
        time \
          ./  -release \
          -qt5 \
          -qmake /Applications/anaconda3/bin/qmake \
          -bin   qt5Ana3.bin.macos-Catalina-release-Rana3Pana3 \
          -build \
          -rpath @executable_path/../Frameworks \
          -with-qtbinding \
          -option --jobs=4 \
          -ruby   /Applications/anaconda3/bin/ruby \
          -rbinc  /Applications/anaconda3/include/ruby-2.5.0 \
          -rblib  /Applications/anaconda3/lib/libruby.2.5.1.dylib \
          -python /Applications/anaconda3/bin/python3.8 \
          -pyinc  /Applications/anaconda3/include/python3.8 \
          -pylib  /Applications/anaconda3/lib/libpython3.8.dylib  2>&1 | tee; \
        test ${PIPESTATUS[0]} -eq 0


    [Linux Mint 19]
    (0) (base) sekigawa@LM19:~/GitWork/klayout$ uname -a
        Linux LM19 5.4.0-100-generic #113~18.04.1-Ubuntu SMP Mon Feb 7 15:02:59 UTC 2022 \
        x86_64 x86_64 x86_64 GNU/Linux
    (1) Anaconda3 Installation Path
    (2) (base) sekigawa@LM19:~/GitWork/klayout$ conda --version
        conda 4.11.0
    (3) The three major modules for building KLayout from its source
        qt      5.9.7   h5867ecd_1
        python  3.8.12  h12debd9_0
        ruby    2.5.1   haf1161a_0 (must be installed separately; causes the python downgraded to 3.8.12)
    (4) The initial parts of the dry-run
        (base) sekigawa@LM19:~/GitWork/klayout$ ./ -dry-run | more
        Scanning installation ..
        Version Info:
            Version: 0.27.8
            Date: 2022-03-04
            Revision: cbd805f8e
        Using qmake: qmake
        Using Ruby interpreter: ruby
            Ruby library found: /home/sekigawa/anaconda3/lib/
            Ruby headers found: /home/sekigawa/anaconda3/include/ruby-2.5.0 and\
            Ruby installation is in:
            - /home/sekigawa/anaconda3/lib/ (lib)
            - /home/sekigawa/anaconda3/include/ruby-2.5.0 (headers)
            - /home/sekigawa/anaconda3/include/ruby-2.5.0/x86_64-linux (arch headers)
            Ruby version code is 20501
        Using Python interpreter: python3
            Python library found: /home/sekigawa/anaconda3/lib/
            Python headers found: /home/sekigawa/anaconda3/include/python3.8
            Python extension suffix:
            Python installation is in:
            - /home/sekigawa/anaconda3/lib/ (lib)
            - /home/sekigawa/anaconda3/include/python3.8 (includes)
            Qt bindings enabled (Qt 5 API)
            Compilation caching is deactivated!
            Installation target: /home/sekigawa/GitWork/klayout/bin-release
            Build directory: /home/sekigawa/GitWork/klayout/build-release
            Building plugins: streamers tools
        Running qmake ..
        QMake version 3.1
Sign In or Register to comment.