{"id":13418741,"url":"https://github.com/symengine/symengine","last_synced_at":"2025-05-14T08:08:28.434Z","repository":{"id":422458,"uuid":"42376","full_name":"symengine/symengine","owner":"symengine","description":"SymEngine is a fast symbolic manipulation library, written in C++","archived":false,"fork":false,"pushed_at":"2025-04-02T02:33:05.000Z","size":477693,"stargazers_count":1223,"open_issues_count":249,"forks_count":291,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-11T02:52:00.165Z","etag":null,"topics":["c-plus-plus","computer-algebra","math"],"latest_commit_sha":null,"homepage":"https://symengine.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/symengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2008-08-13T18:40:14.000Z","updated_at":"2025-04-09T15:24:36.000Z","dependencies_parsed_at":"2023-07-06T08:33:34.125Z","dependency_job_id":"64b48514-7f7d-48c1-97d1-d1fc1b52d455","html_url":"https://github.com/symengine/symengine","commit_stats":{"total_commits":4888,"total_committers":89,"mean_commits":54.92134831460674,"dds":0.7635024549918167,"last_synced_commit":"e5a4f4cd5f4b1f3442fb12a3ca868d571976c012"},"previous_names":["sympy/symengine"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symengine%2Fsymengine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symengine%2Fsymengine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symengine%2Fsymengine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symengine%2Fsymengine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symengine","download_url":"https://codeload.github.com/symengine/symengine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101558,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","computer-algebra","math"],"created_at":"2024-07-30T22:01:06.404Z","updated_at":"2025-05-14T08:08:23.425Z","avatar_url":"https://github.com/symengine.png","language":"C++","readme":"# SymEngine\n\n[![Build and test symengine](https://github.com/symengine/symengine/actions/workflows/ci.yml/badge.svg)](https://github.com/symengine/symengine/actions/workflows/ci.yml)\n[![Build status](https://ci.appveyor.com/api/projects/status/qs1gvno1ht1gf0q8/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine/branch/master)\n[![codecov.io](https://codecov.io/github/symengine/symengine/coverage.svg?branch=master)](https://codecov.io/github/symengine/symengine?branch=master)\n\nSymEngine is a standalone fast C++ symbolic manipulation library. Optional thin\nwrappers allow usage of the library from other languages, e.g.:\n\n* C wrappers allow usage from C, or as a basis for other wrappers (the [symengine/cwrapper.h](https://github.com/sympy/symengine/tree/master/symengine/cwrapper.h) file)\n* Python wrappers allow easy usage from Python and integration with [SymPy](http://sympy.org/) and [Sage](http://www.sagemath.org/) (the [symengine.py](https://github.com/symengine/symengine.py) repository)\n* Ruby wrappers (the [symengine.rb](https://github.com/symengine/symengine.rb) repository)\n* Julia wrappers (the [SymEngine.jl](https://github.com/symengine/SymEngine.jl) repository)\n* Haskell wrappers (the [symengine.hs](https://github.com/symengine/symengine.hs) repository)\n* ...\n\n## Try SymEngine\n\nTutorials are at [SymEngine.org](https://symengine.org/design/design.html).\n\nRun an interactive C++ session with SymEngine using [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/symengine/symengine/master?filepath=docs/mystMD/firststeps.myst.md).\n\n## License\n\nAll files are licensed under MIT license, see the [LICENSE](LICENSE) for more\ninformation. Third party code packaged are licensed under BSD 3-clause license\n(see the LICENSE file).\n\n## Mailinglist, Chat\n\nSymEngine mailinglist: http://groups.google.com/group/symengine\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/symengine/symengine?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## Installation\n\n### Conda package manager\n\n    conda install symengine -c conda-forge\n\n### Conan package manager\n\n    conan install --requires=\"symengine/[*]\"\n\n### Building from source\n\nInstall prerequisites.\nFor Debian based systems (Ubuntu etc.):\n\n    apt-get install cmake libgmp-dev\n\nFor RPM based systems (Fedora etc.):\n\n    yum install cmake gmp-devel\n\nInstall SymEngine:\n\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n    make\n    make install\n\nThis will configure and build SymEngine in the default Release mode with all\ncode and compiler optimizations on and then install it on your system.\n\nRun tests:\n\n    ctest\n\n### Development\n\n[GitHub Actions checks](https://github.com/symengine/symengine/actions/workflows/ci.yml)\nthe code in both Release and Debug mode with all possible checks, so just\nsending a GitHub pull request is enough and you can use any mode you want to\ndevelop it. However, the best way to develop SymEngine on Linux is to use the\nDebug mode with `BFD` support on:\n\n    cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_BFD=yes ..\n\nThis `BFD` support turns on nice Python-like stack traces on exceptions, assert\nerrors or segfaults, and the Debug mode automatically turns on\n`WITH_SYMENGINE_RCP=no` (which uses `Teuchos::RCP` with full Debug time\nchecking) and `WITH_SYMENGINE_ASSERT=yes`, so the code cannot segfault in Debug\nmode, as long as our style conventions (e.g. no raw pointers) are followed,\nwhich is easy to check by visual inspection of a given Pull Request. In Release\nmode, which is the default, the code is as performing a manual reference\ncounting and raw pointers (and if there is a bug, it could segfault, in which\ncase all you have to do is to turn Debug mode on and get a nice exception with\na stack trace).\n\nTo make `WITH_BFD=yes` work, you need to install `binutils-dev` first,\notherwise, you will get a `CMake` error during configuring.\nFor Debian-based systems (Ubuntu etc.)\n\n    apt-get install binutils-dev\n\nFor RPM-based systems (Fedora etc.)\n\n    yum install binutils-devel\n\nOn OpenSuSE, you will additionally need `glibc-devel`.\n\n## CMake Options\n\nHere are all the `CMake` options that you can use to configure the build, with\ntheir default values are indicated below:\n\n    cmake -DCMAKE_INSTALL_PREFIX:PATH=\"/usr/local\" \\  # Installation prefix\n        -DCMAKE_BUILD_TYPE:STRING=\"Release\" \\         # Type of build, one of: Debug, Release, RelWithDebInfo, MinSizeRel\n        -DWITH_BFD:BOOL=OFF \\                         # Install with BFD library (requires binutils-dev)s\n        -DWITH_SYMENGINE_ASSERT:BOOL=OFF \\            # Test all SYMENGINE_ASSERT statements in the code\n        -DWITH_SYMENGINE_RCP:BOOL=ON \\                # Use our faster special implementation of RCP\n        -DWITH_SYMENGINE_THREAD_SAFE:BOOL=OFF \\       # Build with thread safety\n        -DWITH_ECM:BOOL=OFF \\                         # Build with GMP-ECM library for integer factorization\n        -DWITH_PRIMESIEVE:BOOL=OFF \\                  # Install with Primesieve library\n        -DWITH_FLINT:BOOL=OFF \\                       # Install with Flint library\n        -DWITH_ARB:BOOL=OFF \\                         # Install with ARB library\n        -DWITH_TCMALLOC:BOOL=OFF \\                    # Install with TCMalloc linked\n        -DWITH_OPENMP:BOOL=OFF \\                      # Install with OpenMP enabled\n        -DWITH_PIRANHA:BOOL=OFF \\                     # Install with Piranha library\n        -DWITH_MPFR:BOOL=OFF \\                        # Install with MPFR library\n        -DWITH_MPC:BOOL=OFF \\                         # Install with MPC library\n        -DWITH_LLVM:BOOL=OFF \\                        # Build with LLVM libraries\n        -DWITH_SYSTEM_CEREAL:BOOL=OFF \\               # Build with cereal headers from the system instead of\n                                                        the vendored copy\n        -DBUILD_TESTS:BOOL=ON \\                       # Build with tests\n        -DBUILD_BENCHMARKS:BOOL=ON \\                  # Build with benchmarks\n        -DBUILD_BENCHMARKS_GOOGLE:BOOL=OFF \\          # Build with Google Benchmark benchmarks\n        -DINTEGER_CLASS:STRING=gmp \\                  # Choose storage type for Integer. one of gmp, gmpxx,\n                                                        flint, piranha, boostmp\n        -DBUILD_SHARED_LIBS:BOOL=OFF \\                # Build a shared library.\n        -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF\\ # Add dependencies to rpath when a shared lib is built\n        ..\n\nIf `OpenMP` is enabled, then `SYMENGINE_THREAD_SAFE` is also enabled automatically\nirrespective of the user input for `WITH_SYMENGINE_THREAD_SAFE`.\n\n`CMake` prints the value of its options at the end of the run.\nIf you want to use a different compiler, do:\n\n    CC=clang CXX=clang++ cmake ..\n\nIf you want to set additional compilation flags, do:\n\n    CXXFLAGS=\"$CXXFLAGS -march=native\" cmake ..\n\nThese environment variables are checked only in the first run of\ncmake and you have to delete the build directory or `CMakeCache.txt` file\nfor these environment variables to be picked up in subsequent runs.\n\nUsing `INTEGER_CLASS=boostmp` would remove the dependency on gmp and use boost's\nmultiprecision integer and rational classes. This would make boost, the only\ndependency and all the code would be under permissive licenses, namely, MIT,\nBSD 3-clause and Boost License.\n\nPiranha (`WITH_PIRANHA`) depends on Boost, so it is off by default. The benchmarked\ncode seems to depend on the order in which you\nexecute the benchmarks in a given executable, due to internal malloc\nimplementation. We have found that this order dependence is reduced by enabling\n`WITH_TCMALLOC=ON` and since it also speeds the benchmarks up, we recommend\nto always use TCMalloc when benchmarking (and the `Release` mode of SymEngine,\nwhich is the default).\n\n### External Libraries\n\nUse `CMAKE_PREFIX_PATH` to specify the prefixes of the external libraries.\n\n    cmake -DCMAKE_PREFIX_PATH=\u003cprefix1\u003e;\u003cprefix2\u003e\n\nIf the headers and libs are not in `\u003cprefix\u003e/include` and `\u003cprefix\u003e/lib` respectively,\nuse `CMAKE_LIBRARY_PATH` and `CMAKE_INCLUDE_PATH`.\n\nIf CMake still cannot find the library, you can specify the path to the library by\ndoing `cmake -DPKG_LIBRARY=/path/libname.so .`, where `PKG` should be replaced\nwith the name of the external library (`GMP`, `ARB`, `BFD`, `FLINT`, `MPFR`, ...).\nSimilarly, `-DPKG_INCLUDE_DIR` can be used for headers.\n\n### Recommended options to build\n\n#### For package managers\n\nFor packaging symengine it is recommended to use `GMP, MPFR, MPC, FLINT, LLVM` as\ndependencies if they are available and built with thread safety on.\n\n    cmake -DWITH_GMP=on -DWITH_MPFR=on -DWITH_MPC=on -DINTEGER_CLASS=flint -DWITH_LLVM=on\n    -DWITH_SYMENGINE_THREAD_SAFE=on ..\n\n#### Optimized build\n\nTo build with more optimizations, you can use the above dependencies and options, and also,\n\n    CXXFLAGS=\"-march=native -O3\" cmake -DWITH_TCMALLOC=on -DWITH_SYMENGINE_THREAD_SAFE=no ..\n\n## Developer Documentation\n\nPlease follow the [C++ Style Guide](docs/Doxygen/md/style_guide.md) when developing.\n\nThe design decisions are documented in [Design](https://symengine.org/design/design.html).\n","funding_links":[],"categories":["TODO scan for Android support in followings","Math","Related resources","C++","Libraries","进程间通信"],"sub_categories":["Domain specific formats","Math","数学"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymengine%2Fsymengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymengine%2Fsymengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymengine%2Fsymengine/lists"}