You need to set the variables
to the right gcc/gfortran compilers, in the beginning of the sections that compile HDF5 and CGNS. I have never had to set DCMAKE_C_COMPILER. I am sure
And you are using very old gcc and gfortran compilers (4.8.2). Use a module for gnu compilers at least higher than 5. But to be honest, I had never to do this at least for version 2.3.0.