warning messages – Can not install openmpi with intel oneapi

I have installed intel oneapi in ubuntu and it seems to work fine as ifort -V returns the correct intel compilor so do icc -V and icpc -V. The trouble is when I try to install openmpi, either it shows some error during sudo make like can not find “libimf.so” or, after several attepmts, when finally I got it installed it did not take ifort or icc as compilors and mpif90 -V does not work; mpif90 –version returns gfortran. I need to have intel as the compiler. What to do? This is how I configured before “sudo make”

./configure --prefix=/usr/local/ f77=/opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/ifort fc=/opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/ifort f90=/opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/ifort icc=/opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/icc icpc=/opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/icpc

as par my documentation of cosmoMC mpfif90 -V should return intel fortran but here is what it says:

gfortran: error: unrecognized command line option ā€˜-Vā€™

mpiifort etc works fine but I do not know if that would be enough for CosmoMC installation. Please help.