Skip to content

Add option to build SymEngine from source instead of using a system install - #538

Open
isuruf wants to merge 1 commit into
symengine:mainfrom
isuruf:external-symengine
Open

isuruf wants to merge 1 commit into
symengine:mainfrom
isuruf:external-symengine

Conversation

@isuruf

@isuruf isuruf commented Nov 6, 2026

Copy link
Copy Markdown
Member

Adds a USE_SYSTEM_SYMENGINE CMake option. It defaults to ON for now, so the existing behaviour is unchanged.

When OFF, cmake/ExternalSymEngine.cmake builds SymEngine with ExternalProject_Add at the commit in symengine_version.txt:

  • static library with PIC
  • INTEGER_CLASS=boostmp; SymEngine downloads the standalone Boost.Multiprecision headers itself
  • no optional dependencies (MPFR/MPC/FLINT/LLVM)

This means pip install symengine from an sdist works without a preinstalled SymEngine:

pip install symengine-*.tar.gz -Ccmake.define.USE_SYSTEM_SYMENGINE=OFF

Plans for future releases

  • USE_SYSTEM_SYMENGINE=OFF will become the default in a future release, so a plain pip install from an sdist will work out of the box.
  • Wheels will keep using USE_SYSTEM_SYMENGINE=ON and link against a SymEngine with batteries included (MPFR, MPC, FLINT, LLVM, etc.), so wheel users don't lose any features.

symengine_version.txt is bumped to c3b2d541f2ffef52f4f8bb26c04c6c494bfce65f.

CI

Adds a build-bundled-symengine job on ubuntu-24.04 and macos-15. It uses actions/setup-python with no conda, so no SymEngine is installed beforehand. The job builds the sdist, installs from it with the bundled SymEngine, and runs the test suite from an empty directory.

Tested locally on Linux: 262 passed, 107 skipped.

🤖 Generated with Claude Code

…nstall

Add USE_SYSTEM_SYMENGINE (default ON). When OFF, SymEngine is built with
ExternalProject at the commit in symengine_version.txt as a static library
using Boost.Multiprecision. Add a CI job that exercises this path.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant