Windows MSYS2 构建安装 PyMesh

1. 前言

关于PyMesh

PyMesh is a code base developed by Qingnan Zhou for his PhD research at New York University. It is a rapid prototyping platform focused on geometry processing. PyMesh is written with both C++ and Python, where computational intensive functionalities are realized in C++, and Python is used for creating minimalistic and easy to use interfaces.

PyMesh GitHub仓库:GitHub - PyMesh/PyMesh: Geometry Processing Library for Python

在Linux和MacOS中,PyMesh可以使用setup.py完成一键安装,但由于依赖库及编译环境所限,在Windows中使用该脚本会导致许多错误,而无法完成编译和安装。

经过多次踩坑,我成功地在Windows中安装运行了PyMesh,在此进行记录。

系统环境

  • Windows 10 20H2
  • MSYS2

2. 环境配置

PyMesh安装指南中涉及到一些系统依赖,这些依赖需要单独安装:

  • Python
  • NumPy
  • SciPy
  • GMP
  • MPFR
  • Boost

本次编译在MSYS2环境下进行。开发软件包选择mingw-w64-x86_64-*,因此编译产品可以直接在Windows原生环境中运行。

  1. 运行MSYS2 MinGW x64终端,并运行以下命令安装所需工具:

    # 安装必需的dev库和工具
    pacman -S base-devel msys2-devel
    # 安装MinGW工具链
    pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
    # 安装Python和依赖库
    pacman -S mingw-w64-x86_64-python3 mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-scipy
    # 安装GMP和MPFR所需的m4依赖
    pacman -S m4
    
    # 我的环境配置如下
    $ which make gcc g++ gfortran cmake ninja
    /mingw64/bin/make
    /mingw64/bin/gcc
    /mingw64/bin/g++
    /mingw64/bin/gfortran
    /mingw64/bin/cmake
    /mingw64/bin/ninja
    
  2. 克隆PyMesh仓库。此处建议使用FastGit代理来加速完整仓库和子模块的克隆。

    git clone https://github.com/PyMesh/PyMesh.git
    cd PyMesh
    git submodule update --init
    
  3. 前往pymesh/以外的文件夹,在Boost网站下载、解压、安装Boost。本案例使用boost_1_78_0

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

nullptrjzz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值