I am trying to quickly calculate the hamming distance between two 64 bit integers in Ruby. I quickly discovered that even with Ruby's optimized string functions etc. it wouldn't be enough, so I turned to C extensions. For comparison, Pure Ruby benchmarked at about 350,000 comparisons per second and C extensions benchmarked at around 4,000,000.
I used the implementation here and compiled it on my computer where it worked fine. The problem I have is using it on Heroku. I tried ruby extconf.rb make
to create the makefile, which worked, and then make
to compile it which failed with make: gcc: Command not found
. It doesn't matter to me if I do this on deploy or not, but I don't know how to run code automatically at deploy. This has vexed me - if anyone could help it would be much appreciated.