Description of problem: mpich injects various flags which prevents clang from compiling. This prevents using mpich from projects that require clang, as well as Version-Release number of selected component (if applicable): rawhide to f30 How reproducible: always Steps to Reproduce: 0. module load mpi/mpich-x86_64 1. export MPICH_CC=clang 2. mpicc test.c Actual results: clang-10: error: unknown argument: '-fstack-clash-protection' Expected results: a.out is created Additional info: Related to #1795674 This works fine with openmpi
Any progress on this issue? It not only blocks clang from being used as a compiler for MPICH's mpicc or mpicxx, but also results in unexpected behavior for any compiler. The manpage for mpicc says in its description: """ This command can be used to compile and link MPI programs written in C. It provides the options and any special libraries that are needed to compile and link MPI programs. It is important to use this command, particularly when linking programs, as it provides the necessary libraries. """ I.e. when simply compiling a single source file with mpicc source.c I expect it to be compiled with all options required and the necessary libraries, but no other particular options. With the current setup it will automatically turn on -g, -O2, -Wall, and even treats at least one warning as an error (-Werror=format-security). These options are in no way "needed to compile and link MPI programs", it might even cause my code to not compile anymore. Or cause other compilers than gcc to not work with mpicc / mpicxx. According to the MPICH 3.3 Readme (https://www.mpich.org/static/downloads/3.3/mpich-3.3-README.txt) the output of mpicc -compile_info / -link_info depends on the following: """ 3. Compiler Flags ================= MPICH allows several sets of compiler flags to be used. The first three sets are configure-time options for MPICH, while the fourth is only relevant when compiling applications with mpicc and friends. (a) CFLAGS, CPPFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS and LIBS (abbreviated as xFLAGS): Setting these flags would result in the MPICH library being compiled/linked with these flags and the flags internally being used in mpicc and friends. (b) MPICHLIB_CFLAGS, MPICHLIB_CPPFLAGS, MPICHLIB_CXXFLAGS, MPICHLIB_FFLAGS, and MPICHLIB_FCFLAGS (abbreviated as MPICHLIB_xFLAGS): Setting these flags would result in the MPICH library being compiled with these flags. However, these flags will *not* be used by mpicc and friends. (c) MPICH_MPICC_CFLAGS, MPICH_MPICC_CPPFLAGS, MPICH_MPICC_LDFLAGS, MPICH_MPICC_LIBS, and so on for MPICXX, MPIF77 and MPIFORT (abbreviated as MPICH_MPIX_FLAGS): These flags do *not* affect the compilation of the MPICH library itself, but will be internally used by mpicc and friends. +--------------------------------------------------------------------+ | | | | | | MPICH library | mpicc and friends | | | | | +--------------------+----------------------+------------------------+ | | | | | xFLAGS | Yes | Yes | | | | | +--------------------+----------------------+------------------------+ | | | | | MPICHLIB_xFLAGS | Yes | No | | | | | +--------------------+----------------------+------------------------+ | | | | | MPICH_MPIX_FLAGS | No | Yes | | | | | +--------------------+----------------------+------------------------+ All these flags can be set as part of configure command or through environment variables. """ The current mpich.spec file (https://src.fedoraproject.org/rpms/mpich/blob/master/f/mpich.spec) uses the %configure rpm macro, hence sets the xFLAGS. For the reasons given above it should be changed to only set the MPICHLIB_xFLAGS. RPM opt flags *should* only be used to compile MPICH and not force everyone to use them. Fedora (and CentOS, RHEL) are the only systems I have seen so far configuring MPICH like this. Without this change the mpicc / mpicxx wrapper seem to be useless to me (apart from being used to build other packages).
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle. Changing version to 33.
Should be fixed now.