[Dev Container][CUDA]Fix linker path (#108766)

Building with CUDA in dev container leads to error: `cannot find -lcudart_static`. This is because the libraries are under a custom CUDA_HOME, and `ld` cannot find it.

Updating the `LDFLAGS` environment variable works.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/108766
Approved by: https://github.com/drisspg
This commit is contained in:
Kaichao You
2023-09-07 21:32:35 +00:00
committed by PyTorch MergeBot
parent 09a17c512d
commit 96d269eab1

View File

@ -9,3 +9,5 @@ make setup_lint
# Add CMAKE_PREFIX_PATH to bashrc
echo 'export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}' >> ~/.bashrc
# Add linker path so that cuda-related libraries can be found
echo 'export LDFLAGS="-L${CONDA_PREFIX}/lib/ $LDFLAGS"' >> ~/.bashrc