Skip to content

Build on Linux

Prerequisites

The following dependencies are required to build the project.

Name Version Usage Import
CMake >=3.26 build system system install
Python >=3.11 build system system install
Cuda >=12.4 GPU programming system install
Vcpkg >=2025.7.25 package manager git clone

Install Vcpkg

If you haven't installed Vcpkg, you can clone the repository with the following command:

mkdir ~/Toolchain
cd ~/Toolchain
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh

Clone Libuipc

Clone the repository with the following command:

git clone https://github.com/spiriMirror/libuipc.git

Conda Environment

We recommend using conda environments to build the project on Linux.

conda env create -f conda/env.yaml
conda activate uipc_env

Please make sure your Nvidia driver is compatible with the installed Cuda version.

https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html

You can check your nvidia driver version with the following command.

nvidia-smi

You can set the CMAKE_TOOLCHAIN_FILE environment variable in the conda environment with the following command:

conda env config vars set CMAKE_TOOLCHAIN_FILE=~/Toolchain/vcpkg/scripts/buildsystems/vcpkg.cmake

It's important to set the environment variable in the conda environment, so that CMake can find the Vcpkg toolchain file when building the project.

Build Libuipc

Build the project with the following commands.

conda activate uipc_env
cd libuipc; mkdir build; cd build
cmake -S .. -DUIPC_BUILD_PYBIND=1 -DCMAKE_BUILD_TYPE=<Release/RelWithDebInfo> 
cmake --build . -j8

Note

Use multi-thread to speed up the build process as possible, becasue the NVCC compiler will take a lot of time.

Run Project

Just run the executable files in build/<Release/RelWithDebInfo>/bin folder.

Install Pyuipc

With UIPC_BUILD_PYBIND option set to ON, the Python binding will be built and installed in the specified Python environment.

If some errors occur during the installation, you can try to manually install the Python binding.

cd build/python
pip install .

Check Installation

You can run the uipc_info.py to check if the Pyuipc is installed correctly.

cd libuipc/python
python uipc_info.py

More samples are at Pyuipc Samples.

Install in Any Python Venv

If you want to install the Pyuipc to any Python Venv (like uv) after build, you can use the following command:

cmake -S .. -DUIPC_BUILD_PYBIND=1 -DUIPC_PYTHON_EXECUTABLE_PATH=<YOUR_PYTHON_EXECUTABLE_PATH> -DCMAKE_BUILD_TYPE=<Release/RelWithDebInfo>
cmake --build .  -j8