Skip to content

Commit

Permalink
fix way to link files, so cudnn.h is visible
Browse files Browse the repository at this point in the history
  • Loading branch information
STEFANO BOSISIO committed Jan 15, 2025
1 parent d341fcd commit 62000ec
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/container/install-cudnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,26 @@ for cudnn_file in $(dpkg -L ${libcudnn_pkgs} | sort -u); do
echo "Skipping ${cudnn_file}"
fi
done

# replicate the original symlinks too, so we'll have /opt/nvidia/cudnn/include/cudnn.sh
find /usr/include -maxdepth 1 -name "cudnn*.h" -type l | while read -r symlink; do
symlink_name=$(basename "${symlink}")
symlink_target=$(readlink "${symlink}")
# Check if the symlink points to x86_64-linux-gnu/
if [[ "${symlink_target}" == "${arch}/"* ]]; then
# Adjust the symlink target to point within our symlink directory
adjusted_target="${prefix}/include/${symlink_target#${arch}/}"
# Destination symlink within the symlink directory
link_name="${prefix}/include/${symlink_name}"
link_dir=$(dirname "${link_name}")
mkdir -p "${link_dir}"
# Check if the symlink already exists
if [[ -e "${link_name}" ]]; then
echo "Symlink ${link_name} already exists. Skipping."
else
ln -s "${adjusted_target}" "${link_name}"
fi
else
echo "Skipping symlink ${symlink} with target ${symlink_target}"
fi
done

0 comments on commit 62000ec

Please sign in to comment.