with mpigcc and mpiicc I'm able to select the clang compiler via -cc=clang. I checked with -show and was able to compile a program.
Using mpicc -cc=clang, I get the following:
Error: unsupported compiler name 'clang'.
Check -cc=<compiler_name> command line option and I_MPI_CC='icc' and MPICH_CC='' variables.
I'm wondering why mpicc's behavior differs from mpigcc and mpiicc and if there is a recommendation which wrapper to prefer.
Thanks for reaching out to us.
Initially when we tried to run the command without setting up the oneAPI(2021.3) environment, we also encountered the same error as below.
Later, We have tried executing a sample code using the below command after setting up oneAPI environment and observed that the code compiles and runs fine.
>> I'm wondering why mpicc's behavior differs from mpigcc and mpiicc and if there is a recommendation which wrapper to prefer.
By default mpiicc uses ICC whereas mpicc/mpigcc uses GCC compiler. However you can change the compiler by using -CC flag. But if you want to use clang compiler for mpicc, make sure you initialize the oneAPI environment.
However, it is recommended to use “mpiicc with -cc=dpcpp” if you want to run any dpcpp applications.
Based on the programming language we use, we can choose the compiler wrapper. For more information, please go through the link <https://software.intel.com/content/www/us/en/develop/documentation/mpi-developer-reference-linux/top/command-reference/compiler-commands/compilation-command-options.html>
We didn't hear back from you, If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue.
As we have not heard back from you, we assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.