xsection Installation

I have switched computers and needed to download Klayout again. This went smoothly for version 0.30.12. Next I have attempted to install the Ruby based xsection script 1.10. This results in "Error downloading Git repo from https://codeberg.org/klayoutmatthias/xsection.git (subdir 'src',ref")" What am I doing wrong?

Comments

  • edited October 5

    Hi,

    As explained in README.md, we do not need to touch the raw git repository (https://codeberg.org/klayoutmatthias/xsection.git) if we simply use the package.

    Installation step






    Sample run

    When running a .xs script for the first time, select "Run Script" and choose the .xs file.
    The recent scripts are stored in $HOME/.klayout-xsection.

    sekigawa@ubuntu:~ cat $HOME/.klayout-xsection
    <xsection>
    <mru>/home/sekigawa/GitWork/ForumKLayout/Forum/Forum2890/cmos.xs</mru>
    </xsection>
    


    We need to clone the repository to run tests and generate HTML documents.

    Run tests

    MacMiniKS{sekigawa} xsection (1)% cd tests
    
    MacMiniKS{sekigawa} tests (2)% ./run_tests.sh
    /Applications/klayout-std.app/Contents/MacOS/klayout
    Using KLayout binary from: /Applications/klayout-std.app/Contents/MacOS/klayout
    ---------------------------------------------------
    Running testcase xs_bug11 ..
    Running XSection script xs_bug11.xs with -10,40 to 60,40 ..
    Writing run_dir/xs_bug11.gds ..
    No differences found on layer 1/0
    No differences found on layer 2/0
    No differences found on layer 3/1
    No differences found on layer 3/2
    No differences found on layer 3/3
    No differences found on layer 3/4
    No differences found on layer 4/0
    No differences found.
    :
    :
    :
    ---------------------------------------------------
    Running testcase xs_planarize3 ..
    Running XSection script xs_planarize3.xs with -1,0 to 1,0 ..
    Writing run_dir/xs_planarize3.gds ..
    No differences found on layer 100/0
    No differences found on layer 101/0
    No differences found on layer 102/0
    No differences found.
    ---------------------------------------------------
    All tests successful.
    

    Generate HTML documents

    MacMiniKS{sekigawa} xsection (1)% cd docs
    
    MacMiniKS{sekigawa} docs (2)% which pandoc
    /opt/local/bin/pandoc
    
    MacMiniKS{sekigawa} docs (3)% pandoc --version
    pandoc 3.10.1
    Features: +server +lua
    Scripting engine: Lua 5.4
    
    MacMiniKS{sekigawa} xsection (4)% ./builddoc.sh
    
    MacMiniKS{sekigawa} xsection (5)% cd ../doc-html
    
    MacMiniKS{sekigawa} doc-html (6)% ll *.html
    -rw-r--r-- 1 sekigawa staff 22716 Oct  1 22:44 DocEtch.html
    -rw-r--r-- 1 sekigawa staff 26050 Oct  1 22:44 DocGrow.html
    -rw-r--r-- 1 sekigawa staff 37623 Oct  1 22:44 DocIntro.html
    -rw-r--r-- 1 sekigawa staff 30734 Oct  1 22:44 DocReference.html
    -rw-r--r-- 1 sekigawa staff  4527 Oct  1 22:44 index.html <=== open this file with your browser
    

  • I have followed your instruction previously and again after following your instructions.

    Seems quite simple but doesn't work. I have been using the cross-section tool for many years and have a number of Ruby process flows generated and don't want to lose that work.

    I have downloaded the www.klayout.org 1.0 - Ruby scripts with no problems using this approach.

  • I was able to copy the salt directory from my old computer and place it in the KLayout folder on the new computer. I can now run xsection. At least the 1.4 version.

  • OK, then try the following steps as a workaround.

    macOS / Linux terminal with git

    MacMiniKS{sekigawa} ~ (1)% mkdir -p ~/temp
    
    MacMiniKS{sekigawa} ~ (2)% cd temp
    
    MacMiniKS{sekigawa} temp (3)% git clone https://codeberg.org/klayoutmatthias/xsection.git
    Cloning into 'xsection'...
    remote: Enumerating objects: 883, done.
    remote: Counting objects: 100% (20/20), done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 883 (delta 17), reused 16 (delta 16), pack-reused 863 (from 1)
    Receiving objects: 100% (883/883), 720.82 KiB | 835.00 KiB/s, done.
    Resolving deltas: 100% (395/395), done.
    
    MacMiniKS{sekigawa} temp (4)% cd xsection/src
    
    MacMiniKS{sekigawa} src (5)% ll
    total 8
    drwxr-xr-x  5 sekigawa staff  160 Oct 16 06:40 .
    drwxr-xr-x 13 sekigawa staff  416 Oct 16 06:40 ..
    -rw-r--r--  1 sekigawa staff 5512 Oct 16 06:40 grain.xml
    drwxr-xr-x  3 sekigawa staff   96 Oct 16 06:40 macros
    drwxr-xr-x  8 sekigawa staff  256 Oct 16 06:40 ruby
    
    MacMiniKS{sekigawa} src (6)% mkdir -p ~/.klayout/salt/xsection
    
    MacMiniKS{sekigawa} src (7)% cp -Rp * ~/.klayout/salt/xsection
    

    Windows-11 cmd.exe with git.exe

    c:\Users\sekigawa>mkdir "%USERPROFILE%\temp" --- (1)
    
    c:\Users\sekigawa>cd /d %USERPROFILE%\temp --- (2)
    
    C:\Users\sekigawa\temp>git clone https://codeberg.org/klayoutmatthias/xsection.git --- (3)
    Cloning into 'xsection'...
    remote: Enumerating objects: 883, done.
    remote: Counting objects: 100% (20/20), done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 883 (delta 17), reused 16 (delta 16), pack-reused 863 (from 1)
    Receiving objects: 100% (883/883), 720.82 KiB | 862.00 KiB/s, done.
    Resolving deltas: 100% (395/395), done.
    Updating files: 100% (257/257), done.
    
    C:\Users\sekigawa\temp>cd xsection\src --- (4)
    
    C:\Users\sekigawa\temp\xsection\src>dir --- (5)
     Volume in drive C is Windows
     Volume Serial Number is C4EC-0AFC
    
     Directory of C:\Users\sekigawa\temp\xsection\src
    
    10/16/2026  08:55 AM    <DIR>          .
    10/16/2026  08:55 AM    <DIR>          ..
    10/16/2026  08:55 AM             5,527 grain.xml
    10/16/2026  08:55 AM    <DIR>          macros
    10/16/2026  08:55 AM    <DIR>          ruby
                   1 File(s)          5,527 bytes
                   4 Dir(s)  1,087,898,054,656 bytes free
    
    C:\Users\sekigawa\temp\xsection\src>mkdir "%USERPROFILE%\klayout\salt\xsection" --- (6)
    
    C:\Users\sekigawa\temp\xsection\src>xcopy * "%USERPROFILE%\klayout\salt\xsection\" /E /I /H /Y --- (7)
    C:grain.xml
    C:macros\xsection.lym
    C:ruby\layout_data.rb
    C:ruby\mask_data.rb
    C:ruby\material_data.rb
    C:ruby\xsection.rb
    C:ruby\xsection_generator.rb
    C:ruby\xsection_script.rb
    8 File(s) copied
    

Sign In or Register to comment.