#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Usage:
#     cd cuda-python
#     ./toolshed/collect_site_packages_so_files.sh

set -euo pipefail
fresh_venv() {
    python3 -m venv "$1"
    . "$1/bin/activate"
    pip install --upgrade pip
}
cd cuda_pathfinder/
fresh_venv ../TmpCp12Venv
set -x
pip install --only-binary=:all: -e . --group test-cu12
set +x
deactivate
fresh_venv ../TmpCp13Venv
set -x
pip install --only-binary=:all: -e . --group test-cu13
set +x
deactivate
cd ..
set -x
find TmpCp12Venv TmpCp13Venv -name 'lib*.so*' | grep -e nvidia -e nvpl >site_packages_so.txt
