Building SymEngine - isuruf/symengine GitHub Wiki

Installation

Install prerequisites.

###Linux

Using gcc (Recommended)

For Debian based systems (Ubuntu etc.):

apt-get install cmake libgmp-dev g++

For RPM based systems (Fedora etc.):

yum install cmake gmp-devel gcc-c++

Other systems

  • g++ v4.6 or above
  • CMake v2.8 or above
  • GMP 5.0 or above with C++ bindings

To install do

cmake .
make

Using clang

Prerequisites

  • clang v3.4 or above
  • CMake v2.8 or above
  • GMP 5.0 or above with C++ bindings

To install do

CC=clang CXX=clang++ cmake .
make
Using libc++ and clang (Not supported yet)

To install with libc++ follow the above instructions except for GMP

Install GMP with libc++ (Only valid till https://github.com/sympy/symengine/issues/478 is resolved)

To install do

CXXFLAGS="-std=libc++" CC=clang CXX=clang++ cmake .
make

OS X

With clang (Recommended)

With homebrew

brew install cmake gmp

Without homebrew

  • clang v3.4 or above
  • CMake v2.8 or above
  • GMP 5.0 or above with C++ bindings

To install do

cmake .
make

With gcc

OS X 10.8 or below

Prerequisites

  • g++ v4.8 or above
  • CMake v2.8 or above
  • GMP 5.0 or above with C++ bindings

To install do

CC=gcc-4.8 CXX=g++-4.8 cmake .
make
OS X 10.9 or above

Follow above instructions and compile GMP v5.0 or above with C++ support (Until https://github.com/sympy/symengine/issues/478 is resolved)

Windows

With MinGW

Add mingw-get to PATH and then

 mingw-get install mingw32-make
 mingw-get install mingw32-gmp

Install CMake v2.8 or above and put cmake.exe to PATH

To install do

 cmake -G "MinGW Makefiles" -DCOMMON_DIR=C:\MinGW -DBUILD_BENCHMARKS=no .
 mingw32-make

With MinGW-w64

Compile gmp with MinGW-w64 and MSYS. Install CMake v2.8 or above and put cmake.exe to PATH

To install do

 cmake -G "MinGW Makefiles" -DWITH_MINGW_W64=yes -DCOMMON_DIR=C:\MinGW -DBUILD_BENCHMARKS=no .
 mingw32-make

Installing into Sage

Login into SageMath Cloud, then:

wget http://files.sagemath.org/linux/64bit/sage-6.8-x86_64-Linux-Ubuntu_15.04_64_bit.tar.lrz
lrzuntar sage-6.8-x86_64-Linux-Ubuntu_15.04_64_bit.tar.lrz
cd sage-6.8-x86_64-Linux
wget https://github.com/isuruf/symengine-dependencies/raw/spkgs/cmake-3.2.3.spkg
wget https://github.com/isuruf/symengine-dependencies/raw/spkgs/symengine-0.1.spkg
./sage -i cmake-3.2.3.spkg
./sage -i symengine-0.1.spkg

You can try it out as follows:

$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath Version 6.8, Release Date: 2015-07-26                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage: import symengine as se
sage: se.var("x y z")
(x, y, z)
sage: e = (x**y+y**z+z**x+1)**15
sage: f = e*(e+1)
sage: g = f.expand()