How to Install¶
See also
Go through this page to install libyt
that is
fault-tolerant to Python code, supports interactive Python prompt, supports reloading script, and supports Jupyter Notebook access.
To turn off some of the features, go to Details.
libyt¶
Requirements:
- CMake (>=3.15)
A software build system.
- pkg-config
Generally, Linux and macOS already have pkg-config installed. It is a helper tool for finding libraries and compiling applications.
- Compiler (It should support
c++14
) CXX
: Path tog++
compiler.CC
: Path togcc
compiler.
- Python (>=3.7)
The Python environment we want to use when doing in situ analysis. If we compile it from source, use
--enable-shared
when configuring.PYTHON_PATH
: Python installation prefix, the path contains foldersinclude
,lib
etc.numpy
and other Python Dependencies
- OpenMPI or MPICH
MPI used for compiling simulations and for compiling
libyt
should be the same.MPI_PATH
: MPI installation prefix, the path contains foldersinclude
,lib
etc.
- Readline
Readline library is already installed on Linux and macOS generally. If not, we can get through system package manager or compile from source ourselves. If we compile it from source, use
--with-curses
when configuring.READLINE_PATH
:readline
installation prefix. Provide the path if it is not in system search path.
Follow the steps to install libyt
that is fault-tolerant to Python code, and supports interactive Python prompt, reloading script, and Jupyter Notebook access:
Shallow clone
libyt
and enter the folder:git clone --depth 1 https://github.com/yt-project/libyt "libyt" cd libyt
[Optional] Set
gcc
andg++
compiler:export CC=<path-to-gcc> export CXX=<path-to-g++>
Generate build files in
build
folder:Serial Mode (using GCC):
rm -rf build cmake -S . -B build -DSERIAL_MODE=ON \ -DINTERACTIVE_MODE=ON \ -DJUPYTER_KERNEL=ON \ -DPYTHON_PATH=<your-python-prefix>
Parallel Mode (using MPI):
rm -rf build cmake -S . -B build -DINTERACTIVE_MODE=ON \ -DJUPYTER_KERNEL=ON \ -DPYTHON_PATH=<your-python-prefix> \ -DMPI_PATH=<your-mpi-prefix>
Build project and install
libyt
:cmake --build build cmake --install build --prefix <libyt-install-prefix>
libyt
is now installed at<libyt-install-prefix>
folder.
Python Dependencies¶
Option indicates under what circumstances will we need this package.
Python package |
pip |
Required version |
Notes |
Option |
---|---|---|---|---|
|
<2.0 |
The fundamental package for scientific computing with Python. |
Always |
|
|
The core analytic tool. |
Always |
||
|
|
Always |
||
|
Python bindings for the Message Passing Interface (MPI) standard. |
|
||
|
Support auto-completion in Jupyter Notebook and JupyterLab. (We will have this if IPython is already installed.) |
|
||
|
>=8.0.0 |
Jupyter Client. |
|
|
|
Jupyter kernel provisioner for |
|
Note
jupyter-client
and jupyter_libyt
are used for launching Jupyter Notebook and JupyterLab. Make sure the Python environment used for launching the notebook have them installed.
The Python used in in situ analysis which is also for compiling libyt
and the Python used for launching Jupyter Notebook/JupyterLab might be different.
For example, when running libyt
in HPC cluster, the Python environment is different from the one starting Jupyter Notebook on your local laptop. (See Jupyter Notebook Access)