I would like to generate samples from a gamma distribution in c++. I am compiling my code on a supercomputer, which does not have an up-to-date version of g++ (nor can it be updated). I have written code which uses chrono and random to generate samples from a gamma distribution. Unfortunately, the version of g++ does not allow me to compile the code (I also cannot use the flags -std=c++11 or -std=c++0x). I also cannot use boost/TR1 as the compiler does not have it.
Other than going back to basics (generating gamma from a sum of exponentials etc.) is there another way that I can sample from this distribution? I am thinking of pure c++ rather than implementing MCMC.