update fortran compiler

After installing hdf5, it seems that everytime I update my fortran compiler
(with new folder, e.g. 10.1 to 10.3), I have to reinstall hdf5 for it to
recognize the link to this new compiler. Anyone know a better way for this.
Thank you

Tuan