Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda packaging for holoscan latest version (3.x) #28598

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions recipes/holoscan/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e
set -x

# Create the site-packages dir if it doesn't exist
mkdir -p $SP_DIR

echo "site-packages dir, SP_DIR = $SP_DIR"

check-glibc bin/* lib/* lib/ucx/* lib/gxf_extensions/*
find python/ -name "*.so*" | xargs -I"{}" check-glibc "{}"

cp -rv bin $PREFIX/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we unpacking a redist instead of building from source when the source is available?

https://github.com/nvidia-holoscan/holoscan-sdk

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we already discussed this above back in December 2024.

For gds-tools, onnxruntime and torchvision I will see when we can get respective owners to provide missing DSO, and for TensorRT we'll have to find out a plan for it with respect to conda.

Have you opened issues on the feedstocks for these packages asking for the relevant libraries?

cp -rv examples $PREFIX/
cp -rv lib $PREFIX/
cp -rv include $PREFIX/
cp -rv python/lib/* $SP_DIR/
39 changes: 39 additions & 0 deletions recipes/holoscan/compile_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

set -ex

[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux"
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html?highlight=tegra#cross-compilation
[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "sbsa" ]] && targetsDir="targets/sbsa-linux"
[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "tegra" ]] && targetsDir="targets/aarch64-linux"

if [ -z "${targetsDir+x}" ]; then
echo "target_platform: ${target_platform} is unknown! targetsDir must be defined!" >&2
exit 1
fi

# E.g. $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.3.0/cc1plus
find $CONDA_PREFIX -name cc1plus

GCC_DIR=$(dirname $(find $CONDA_PREFIX -name cc1plus))

export PATH=${GCC_DIR}:$PATH
export LD_LIBRARY_PATH=${GCC_DIR}:$LD_LIBRARY_PATH

# No need for use-linker-plugin optimization, causes compile failure, don't use it for the test
export CXXFLAGS="${CXXFLAGS} -fno-use-linker-plugin"

echo CC = $CC
echo CXX = $CXX

CMAKE_ARGS="-DCMAKE_LIBRARY_PATH=${GCC_DIR} \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCUDAToolkit_INCLUDE_DIRECTORIES=\"$PREFIX/include;$PREFIX/${targetsDir}/include\" \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_CUDA_COMPILER=$PREFIX/bin/nvcc \
-DCUDAToolkit_ROOT=$PREFIX"

cmake -S $PREFIX/examples ${CMAKE_ARGS}

cmake --build .
2 changes: 2 additions & 0 deletions recipes/holoscan/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
c_stdlib_version: # [linux]
- 2.34 # [linux]
Loading
Loading