`Segmentation fault’. One of the most annoying things ever to appear on our screens. Right up there with `fftw.h not found’. Compilation errors are the (rock-hard) bread and (rancid) butter of any of us that need to
debug write codes. Tahina is deeply down the rabbit hole and asks:
Why does my code not compile?
I am assuming you already thoroughly searched Stack Exchange for your specific error(s) and rage-quitted after reading some of those cringe-worthy answers: “But why would you want to do that?”, “It works on my machine.”, “Why don’t you use this simpler code instead?”. Because I gave you a minimal working example, you dufus! Obviously printing `2+2=4′ on my GPU cluster is not the end goal here!
Anyway, I digress.
If after ticking all the boxes your code does not compile when it should, it’s because your machine does not want it to. It may sound petty, but I firmly believe computers have their own personality. And most of the times that personality expresses itself as “I don’t wanna!”. I can already hear you telling me: “Come on Sassy! Computers only do exactly what you tell them to.”. I heard this dogma many times. To that I reply that if you still believe that, you simply have not coded enough. How many times have you successfully compiled a code one day, only for the same exact steps to result in an unhelpful error message the day after. And you changed nothing. How many times have your simulations mysteriously crashed, but resubmitting the exact same job an hour later results in a successful run? And you changed nothing. If your answer is “never”, I must repeat myself: you have not coded enough.
Some may say: “It’s because some processes are so complex that some errors are due to the state of the system. But the machine still does only what you tell them to.”. Fair enough, but aren’t our own personality the result of our brains being very complex machines too? Aren’t we sometimes bad at something we should normally be good at? Potayto, potahto.
Your computer might simply be a dunce. Yell at it, threaten him, ask it to compile your code over and over again. Like a stubborn toddler, it may take a while, but you will eventually educate it.
The Sassy Scientist
PS: My laptop did not like this piece. It crashed multiple times while writing it. Bad laptop! Bad!