Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,116 @@ jobs:
mkdir -p empty && cd empty
python -m pytest -v --pyargs symengine
python ../bin/test_python.py

build-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- PYTHON_VERSION: '3.14'
PLATFORM: x64
WITH_MPFR: yes
WITH_MPC: yes
WITH_LLVM: yes
- PYTHON_VERSION: '3.11'
PLATFORM: Win32
WITH_MPFR: yes
WITH_MPC: yes
- PYTHON_VERSION: '3.13'
PLATFORM: x64
WITH_MPFR: yes
WITH_MPC: yes
- PYTHON_VERSION: '3.12'
PLATFORM: x64
- PYTHON_VERSION: '3.14'
PLATFORM: x64
WITH_SYMPY: no
- PYTHON_VERSION: '3.11'
PLATFORM: x64
WITH_NUMPY: no

env:
BUILD_TYPE: Release
PLATFORM: ${{ matrix.PLATFORM }}
WITH_MPFR: ${{ matrix.WITH_MPFR }}
WITH_MPC: ${{ matrix.WITH_MPC }}
WITH_LLVM: ${{ matrix.WITH_LLVM }}
WITH_NUMPY: ${{ matrix.WITH_NUMPY }}
WITH_SYMPY: ${{ matrix.WITH_SYMPY }}
DEPS_PREFIX: C:\deps
SYMENGINE_PREFIX: C:\symengine

defaults:
run:
shell: bash -el {0}

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON_VERSION }}
architecture: ${{ matrix.PLATFORM == 'Win32' && 'x86' || 'x64' }}

- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
activate-environment: ""
channels: conda-forge
conda-remove-defaults: "true"

- name: Install C++ dependencies
run: |
if [[ "$PLATFORM" == "Win32" ]]; then export CONDA_SUBDIR=win-32; fi
deps="mpir=3.0.0 vc=14"
if [[ "$WITH_MPFR" == "yes" ]]; then deps="$deps mpfr=3.1.5"; fi
if [[ "$WITH_MPC" == "yes" ]]; then deps="$deps mpc=1.0.3"; fi
if [[ "$WITH_LLVM" == "yes" ]]; then deps="$deps llvmdev=9.0 zlib"; fi
# The old mpfr/mpc builds need vc=14, which only the defaults channel has.
conda create -p "$DEPS_PREFIX" --yes -c conda-forge -c defaults $deps

- name: Install Python dependencies
run: |
# setup-miniconda puts Miniconda's python first on PATH in login
# shells, so record the setup-python interpreter and use it explicitly.
echo "PY=$(cygpath -u "$pythonLocation")/python.exe" >> "$GITHUB_ENV"
PY="$(cygpath -u "$pythonLocation")/python.exe"
"$PY" -c "import sys, struct; print(sys.version, struct.calcsize('P') * 8, 'bit')"
"$PY" -m pip install pytest cython scikit-build-core cython-cmake setuptools_scm
if [[ "$WITH_NUMPY" != "no" ]]; then "$PY" -m pip install numpy; fi
if [[ "$WITH_SYMPY" != "no" ]]; then "$PY" -m pip install sympy; fi

- name: Build and install SymEngine
run: |
git clone https://github.com/symengine/symengine symengine-cpp
cd symengine-cpp
git checkout "$(cat ../symengine_version.txt)"
cmake_args="-DCMAKE_PREFIX_PATH=$DEPS_PREFIX\\Library"
if [[ "$WITH_MPFR" == "yes" ]]; then cmake_args="$cmake_args -DWITH_MPFR=yes"; fi
if [[ "$WITH_MPC" == "yes" ]]; then cmake_args="$cmake_args -DWITH_MPC=yes"; fi
if [[ "$WITH_LLVM" == "yes" ]]; then
cmake_args="$cmake_args -DWITH_LLVM=yes -DMSVC_USE_MT=no"
# LLVMExports.cmake links against a bare "z" (z.lib from conda-forge zlib);
# give its directory to link.exe via LINK.
export LINK="/LIBPATH:$DEPS_PREFIX\\Library\\lib"
fi
cmake -S . -B build -G "Visual Studio 17 2022" -A "$PLATFORM" $cmake_args \
-DBUILD_SHARED_LIBS=yes -DBUILD_TESTS=no -DBUILD_BENCHMARKS=no \
-DCMAKE_INSTALL_PREFIX="$SYMENGINE_PREFIX"
cmake --build build --config "$BUILD_TYPE" --target install

- name: Build symengine.py
run: |
export PATH="$(cygpath -u "$SYMENGINE_PREFIX")/bin:$(cygpath -u "$DEPS_PREFIX")/Library/bin:$PATH"
export SYMENGINE_PY_ADD_PATH_TO_SEARCH_DIRS=1
export CMAKE_PREFIX_PATH="$SYMENGINE_PREFIX"
"$PY" -m pip install -e . --no-build-isolation -Ccmake.build-type=$BUILD_TYPE -vv

- name: Test
run: |
export PATH="$(cygpath -u "$SYMENGINE_PREFIX")/bin:$(cygpath -u "$DEPS_PREFIX")/Library/bin:$PATH"
export SYMENGINE_PY_ADD_PATH_TO_SEARCH_DIRS=1
mkdir -p empty && cd empty
"$PY" ../bin/test_python.py
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Python wrappers to the C++ library [SymEngine](https://github.com/symengine/syme
a fast C++ symbolic manipulation library.

[![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py)
[![Build status](https://ci.appveyor.com/api/projects/status/sl189l9ck3gd8qvk/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine-py/branch/master)

## Installation

Expand Down
114 changes: 0 additions & 114 deletions appveyor.yml

This file was deleted.

Loading