Skip to content

Update pybind11 2.11.1. #454

Update pybind11 2.11.1.

Update pybind11 2.11.1. #454

Workflow file for this run

name: build
on:
push:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12, ubuntu-20.04, ubuntu-22.04]
python-version: ['3.8', '3.9', '3.10']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Before install
run: |
# 安装 eigen3
if [ "${{ matrix.os }}" = "macos-11" ] || [ "${{ matrix.os }}" = "macos-12" ]; then
rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core;
brew update;
brew install eigen;
else
# 现已停止对ubuntu-16.04的测试, 但仍能安装使用.
# ubuntu-16.04下apt安装的最新版本是eigen3.3的beta版, 会导致结果异常, 因此需要手动安装eigen3.3.7+
# sudo apt update;
# sudo apt install -y libeigen3-dev;
# sudo cp -r /usr/include/eigen3 /usr/local/include/eigen3;
# 更新gcc, ubuntu 16.04 使用stdc++17编译存在问题.
sudo apt install --upgrade -y gcc;
# 下载源码
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz;
tar -zxvf eigen-3.4.0.tar.gz;
# 编译安装
cd eigen-3.4.0;
mkdir build;
cd build;
cmake ..;
sudo make;
sudo make install;
# 返回home目录
cd ~;
fi
# 安装 pybind11, pytest和wheel
python -m pip install --upgrade pip;
pip install pybind11==2.11.1;
pip install pytest wheel;
- name: Install
run: |
pip install .;
- name: Test with pytest
# 测试模块功能
run: |
pytest;
- name: Test examples
# 测试全部的样例能否正常运行
run: |
for filename in `ls examples`; do
python3 examples/$filename;
done