No support for `nvcc --compiler-bindir=...`

Issue #204 resolved
Paul Hargrove created an issue

If I $ export UPCXX_CUDA_NVCC='nvcc --compiler-bindir=/usr/bin'

then nobs fails when extracting the link flags:

nvcc error

"nvcc --dryrun" output format unrecognized.
#$ "/usr/bin"/g++ -m64 -o "a.out" -Wl,--start-group "/tmp/tmpxft_000046f2_00000000-5_a_dlink.o" "foo.o"   "-L/opt/nvidia/cudatoolkit9.1/9.1.85_3.10-1.0502.df1cc54.3.1/bin/..//lib64/stubs" "-L/opt/nvidia/cudatoolkit9.1/9.1.85_3.10-1.0502.df1cc54.3.1/bin/..//lib64" -lcudadevrt  -lcudart_static  -lrt -lpthread  -ldl  -Wl,--end-group

Comments (3)

  1. Paul Hargrove reporter

    Background:

    nvcc is tightly integrated with gcc/g++.
    For that reason, it will refuse to operate with a version newer than the one it was validated against.
    By default the gcc/g++ used are the ones found in one's $PATH.
    If the ones in $PATH are too new for nvcc, the --compiler-bin (aka -ccbin) provide the means to override the $PATH search.
    This issue is currently blocking use of CUDA support on such a system.

    Work around:

    There is a work-around available.
    That is to save the following script (suitable edited, and chmod +x) as nvcc_for_upcxx.
    Then you would set UPCXX_CUDA_NVCC='nvcc_for_upcxx', possibly using a full path. /bin/sh exec env PATH=/full/path/to/gcc/bindir:$PATH nvcc "$@"

  2. Log in to comment