How to Install
Table of contents
C Library – libyt
Go through basic requirements and options and set the dependencies paths. Then compile and install libyt using CMake.
Basic Requirements
- CMake (>=3.15)
- GCC compiler (>4.8): Should be able to support
c++14.-
CXX: Path tog++compiler. -
CC: Path togcccompiler.
-
- Python (>=3.7):
-
PYTHON_PATH: Python installation prefix, the path should contain folders likeinclude,libetc. -
NumPy: Should haveNumPyinstalled.
-
Options
The options are mutually independent to each other.
-DSERIAL_MODE=ON/OFF (Default=OFF)
| Notes | Required Paths | Required Python Packages | |
|---|---|---|---|
| Parallel Mode (OFF) | Compile libyt using MPI. | - MPI_PATH
| - mpi4py
|
| Serial Mode (ON) | Compile libyt using GCC. |
Required Paths
-
MPI_PATH: MPI installation prefix, the path should contain folders likeinclude,libetc.
Make sure you are using the same MPI to compile libytand your simulation code.
Required Python Packages
-
mpi4py: This is Python bindings for the Message Passing Interface (MPI) standard.
Please make sure mpi4pyused in Python and MPI used in simulation are matched. Check how to installmpi4pyhere.
-DINTERACTIVE_MODE=ON/OFF (Default=OFF)
| Notes | Required Paths | |
|---|---|---|
| Normal Mode (OFF) | Shut down and terminate all the processes including simulation, if error occurs during in situ analysis. | |
| Interactive Mode (ON) | Will not terminate the processes if error occurs while doing in situ analysis and supports interactive Python prompt and reloading script. | - READLINE_PATH
|
-
READLINE_PATH: GNUreadlinelibrary installation prefix, the path should contain folders likeinclude,libetc.
-DJUPYTER_KERNEL=ON/OFF (Default=OFF)
| Notes | Required Paths | Required Python Packages | |
|---|---|---|---|
| Jupyter Kernel (ON) | Activate Jupyter kernel and enable JupyterLab UI. (See Jupyter Notebook Access) | - nlohmann_json_DIR - cppzmq_DIR - xtl_DIR - xeus_DIR - xeus-zmq_DIR - ZeroMQ_DIR | - jupyter_libyt - jupyter-client - (Optional) jedi
|
Required Paths
-
nlohmann_json_DIR(>=3.2.0, <4.0.0): Path tonlohmann_jsonConfig.cmakeafter installingnlohmann_json. -
cppzmq_DIR(>=4.8.1, <5.0.0): Path tocppzmqConfig.cmakeafter installingcppzmq. -
xtl_DIR(>=0.7.0, <0.8.0): Path toxtlConfig.cmakeafter installingxtl. -
xeus_DIR(>=3.0.0, <4.0.0): Path toxeusConfig.cmakeafter installingxeus. -
xeus-zmq_DIR(1.x release): Path toxeus-zmqConfig.cmakeafter installingxeus-zmq. -
ZeroMQ_DIR(>=4.2.5, <5.0.0): Path toZeroMQConfig.cmakeafter installingZeroMQ. (Some system may already have ZeroMQ installed, which doesn’t need to provide the path explicitly.)
![]()
nlohmann_json,cppzmq,xtl,xeus, andZeroMQare allxeus-zmq’s dependencies. Check here for how to installxeus-zmq.
Required Python Packages
-
jupyter_libyt: Customized kernel provisioner for libyt Jupyter kernel. -
jupyter-client(>=8.0.0): Jupyter client. -
jedi: Support auto-completion in Jupyter Notebook and JupyterLab. This is optional. (If you have IPython installed, you might already have this.)
-DSUPPORT_TIMER=ON/OFF (Default=OFF)
| Notes | Required Paths | |
|---|---|---|
| Time Profiling (ON) | Support time profiling. (See Time Profiling) |
CMake
-
Toggle options, set paths and generate files to build the project. This can be done through either (a) or (b):
(a) Set it through editing
CMakeLists.txtat root directory. For example, this uses option-DSERIAL_MODE=OFFand providesMPI_PATH:option(SERIAL_MODE "Compile library for serial process" ON) set(MPI_PATH "<path-to-mpi-prefix>" CACHE PATH "Path to MPI installation prefix (-DSERIAL_MODE=OFF)")(b) Set the options and paths through command line. For example, the flags here are equivalent to the above:
-DSERIAL_MODE=OFF -DMPI_PATH=<path-to-mpi-prefix> - (Optional) Set the GCC compiler, export the environment variable
CCto targetgcccompiler andCXXto targetg++compiler before runningcmake. For example:export CC=/software/gcc/bin/gcc export CXX=/software/gcc/bin/g++
It should support c++14. - Generate files for project,
<1-(b)>contains the flags in step 1-(b):cd libyt # go to the root of the project cmake -B <build-dir-name> -S . <1-(b)> - Build the project:
cmake --build <build-dir-name> - Install the library:
cmake --install <build-dir-name> --prefix <install-to-dir>
Example
- The following builds
libytin serial mode using user designated GCC compiler and then installs the library in/home/user/softwares/libyt:cd libyt # go to project root directory export CC=/software/gcc/8.4.0/bin/gcc # set gcc compiler export CXX=/software/gcc/8.4.0/bin/g++ # set g++ compiler rm -rf build # clean up previous build cmake -B build -S . -DSERIAL_MODE=ON # generate files for project cmake --build build # build the project cmake --install build --prefix /home/user/softwares/libyt # install - The following builds
libytin parallel mode using user designated MPI compiler and then installs the library in/home/user/softwares/libyt:cd libyt rm -rf build cmake -B build -S . -DSERIAL_MODE=OFF -DMPI_PATH=/software/openmpi/4.1.1-gnu cmake --build build cmake --install build --prefix /home/user/softwares/libyt
Required Python Package
To use yt as the core analytic tool, we need to install yt_libyt, a yt frontend for libyt.
yt
- Project website: https://yt-project.org/
- Install from PyPI:
pip install yt
yt_libyt
- Project website: https://github.com/data-exp-lab/yt_libyt
- Install from source:
git clone https://github.com/data-exp-lab/yt_libyt.git cd yt_libyt pip install . - Install from PyPI:
pip install yt-libyt
jupyter_libyt
- Project website: https://github.com/yt-project/jupyter_libyt
- Install from source:
git clone https://github.com/yt-project/jupyter_libyt.git cd jupyter_libyt pip install .