building version 5.8.0 fails

Yes, it is:

alves@tauruslogin6:~> ml iimpi/2018a
Module iimpi/2018a and 6 dependencies loaded.
alves@tauruslogin6:~> whereis mpiicc
mpiicc: /software/generic/impi/2018.1.163-iccifort-2018.1.163-GCC-6.4.0-2.28/intel64/bin/mpiicc

Which of them (mpicc, mpiicc, icc etc.) is being used, I don’t know: the script – which works fine for version 5.7.0 – just loads the modules and then calls CMake (the only flags being those mentioned above)…