Klayout编译环境搭建

前期准备

首先参考官方编译指南 https://www.klayout.de/build.html
本次搭建使用的软件版本分别为
VM 16.2.3
Ubuntu 22.04
QT 5.12.12
zilb 使用apt安装最新版
Ruby 使用apt安装最新版
Python 系统自带
C++相关 系统自带

使用VM安装ubuntu注意事项

  • 主板虚拟化功能需手动到bios中打开
  • 安装完成后更换国内源
  • 按照提示安装vmtools

安装vmtoools后重启虚拟机文件共享会时效,可在在/etc/fstab添加
vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0
参考 https://communities.vmware.com/t5/VMware-Workstation-Player/Shared-folder-not-working-W11-host-Ubuntu-22-04-guest-Open-VM/td-p/2905917

依赖安装

QT

qt下载地址 https://download.qt.io/archive/qt/5.12/5.12.12/
安装必须要注册账号,安装过程需手动勾选qt

zilb & Ruby & Python & C++

sudo apt-get install zlib1g-dev
sudo apt install ruby-full
sudo apt-get install python3-dev
sudo apt install build-essential  

可能遇到的问题

1、打开qtcreator失败


安装libxcb-xinerama库解决
sudo apt-get install libxcb-xinerama0
错误原因参考
https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/4
https://blog.csdn.net/LOVEmy134611/article/details/107212845

2、命令行运行build.sh失败

一般会提示找不到qmake,可以通过安装qtchooser指定qmake(直接使用qtcreator不需要)
参考 https://blog.csdn.net/guo_lei_lamant/article/details/82995299

3、python的include目录找不到

没有安装python3-dev,通过apt安装即可

4、编译过程提示缺少库文件

具体情况具体分析,缺啥装啥
sudo apt install libgl1-mesa-dev

添加编译参数

HAVE_RUBY=1 RUBYINCLUDE=/usr/include/ruby-3.0.0 RUBYINCLUDE2=/usr/include/x86_64-linux-gnu/ruby-3.0.0
RUBYHDRDIR=/usr/include/ruby-3.0.0 RUBYLIBFILE=/usr/lib/x86_64-linux-gnu/libruby-3.0.so.3.0.2 
RUBYVERSIONCODE=30002


虚拟机使用宿主机的代理

可将VMnet8的网关地址作为宿主机的地址,可以在任务管理器或网络适配器查看
参考 https://blog.xzr.moe/archives/124/

posted @ 2023-02-15 15:34  chilkings  阅读(542)  评论(0编辑  收藏  举报