Description of problem: When using CMake as the build system with an MPI module active (openmpi or mpich), the find_package() command in CMake does not locate the MPI-enabled packages installed through dnf but defaults to the serial versions. This means that the non-MPI libraries have their include and library paths set and result in compilation / linking errors. Setting the CMake prefix through an environment variable: export CMAKE_PREFIX_PATH=/usr/lib64/openmpi/lib will tell CMake to look inside the correct location. Version-Release number of selected component (if applicable): Current stacks with Fedora 26 and 27 How reproducible: Always. Additional info: A potential problem is when an MPI module is enabled and a user tries to compile a serial version. This would result in CMake finding the parallel version from the prefix rather than the serial version and could lead to extra confusion. Maybe less however than accidently leaving an environment variable set.
This bug should be affected to the relative MPI packages, not environment-modules, as these packages provide the modulefiles referred here.
I have already submitted this against the relevant MPI packages. Closing this here.