Installation instructions#
This guide will help you set up Tumult Core on your local machine.
Prerequisites#
Tumult Core is built in Python, so a Python installation is required to use it. Only Python 3.7 is officially supported at present, though newer versions likely work.
Because Tumult Core uses PySpark for computation, it also requires Java 8 or 11.
You may also need to configure pyspark to use the intended Python installation. You can do this by setting the PYSPARK_PYTHON environment variable. For example:
export PYSPARK_PYTHON=/usr/bin/python3
Tumult Core uses python-flint
for some mathematical functions, so python-flint
is also required.
Only Tumult’s wheels (located at https://d3p0voevd56kj6.cloudfront.net
) are
currently supported.
Only the x86_64 processor architecture is officially supported at present.
Note
When using Java 11, Spark requires that Java be passed the -Dio.netty.tryReflectionSetAccessible=true
option.
This can be achieved by adding that option to Spark’s spark.driver.extraJavaOptions
and spark.executor.extraJavaOptions
configurations.
An example of how to set these values when initializing Spark is included in the first tutorial.
Not doing this before making calls to Tumult Core will result in Spark raising java.lang.UnsupportedOperationException: sun.misc.Unsafe or java.nio.DirectByteBuffer.(long, int) not available
Below are instructions for installing these prerequisites on several common platforms. If none of these apply to you, install Python 3 and Java from your OS package manager, or use the “Manual Installation” section to obtain installers or source distributions and build instructions for your platform. If you encounter any issues during the installation process, please let us know!
Python and pip
, Python’s package manager, are likely already installed.
If they are not, install them with:
apt install python3 python3-pip
Java may already be installed as well. If it is not, install the Java Runtime Environment with:
apt install openjdk-8-jre-headless
Then install python-flint with
pip3 install -i https://d3p0voevd56kj6.cloudfront.net python-flint
Python and pip
, Python’s package manager, may already be installed.
On some releases, Python 2 may be installed by default, but not Python 3.
To install Python 3, run:
yum install python3 python3-pip
To install Java, run:
yum install java-1.8.0-openjdk-headless
Note that despite the package name, this will install Java 8.
Then install python-flint with
pip3 install -i https://d3p0voevd56kj6.cloudfront.net python-flint
The below instructions assume the use of Homebrew for managing packages. If you do not wish to use Homebrew for this, use the “Manual Installation” instructions instead.
If you do not already have Homebrew, it can be installed with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Python may be installed with:
brew install python@3.7And Java may be installed with:
brew install openjdk@8
Then install python-flint with
pip3 install -i https://d3p0voevd56kj6.cloudfront.net python-flint
If Python is not available through your system’s package manager, Python installers and source tarballs are available on the Python downloads page.
Amazon Corretto and Adoptium (formerly AdoptOpenJDK) both provide Java distributions based on OpenJDK for a variety of platforms. Their installation instructions are available here and here, respectively, so pick one and get it set up before proceeding.
Attention
If you are installing on a Windows machine, please install python-flint (see instructions) before installing Tumult Core.
Installation#
Once the above prerequisites are installed, Tumult Core can be installed using pip3
with:
pip3 install tmlt.core
This will automatically install all of its Python dependencies as well.
It is recommended, though not required, to install Tumult Core in a virtual environment to minimize interactions with your system Python environment.