The configure in yaksa will set correct -ccbin​ option for nvcc to use the compiler set by CC​. Reference https://github.com/pmodels/yaksa/blob/e4063c04b6ceeda7d863449a4e92124feb5b739a/src/backend/cuda/subconfigure.m4#L65-L70

Ideally, it should use CXX​ rather than CC. But it currently works to compile the cu files in yaksa.

--
Hui


From: Raffenetti, Ken <raffenet@anl.gov>
Sent: Friday, April 15, 2022 3:02 PM
To: discuss@mpich.org <discuss@mpich.org>
Cc: Zhou, Hui <zhouh@anl.gov>
Subject: Re: [mpich-discuss] CUDA support with clang instead of nvcc
 
The Yaksa configure is currently hardcoded to use `nvcc` for .cu files. We'll have to patch it to support alternatives, right?

Ken

On 4/15/22, 2:57 PM, "Zhou, Hui via discuss" <discuss@mpich.org> wrote:

    Yes, just set CC=clang​ and CXX=clang++​.

    --

    Hui Zhou

    ________________________________________
    From: Sajid Ali via discuss <discuss@mpich.org>
    Sent: Friday, April 15, 2022 11:49 AM
    To: discuss@mpich.org <discuss@mpich.org>
    Cc: Sajid Ali <sajidsyed2021@u.northwestern.edu>
    Subject: [mpich-discuss] CUDA support with clang instead of nvcc 

    Hi MPICH-developers,


    Is it possible to compile MPICH with CUDA awareness, but with clang as the CUDA compiler? (i.e. use clang capable of targeting the nvptx backend to compiler cuda files instead of nvcc).

    Thank You,
    Sajid Ali (he/him) | Research Associate

    Scientific Computing Division

    Fermi National Accelerator Laboratory

    s-sajid-ali.github.io <http://s-sajid-ali.github.io>