distcc for Distributed Compilation – gotchas!

After getting our builds run with gnu make in parallel, we spent some time evaluating “distcc” for distributed compilation. I had some hiccups and learnings. I’m hopeful that the following shall be useful and handy if you are just starting to use distcc.

  • In our build environment, the directory where compiler is stored keeps changing as we have very frequent SDK updates. The compiler is accessed via soft link, and only this soft link is moved to the new path when we have SDK updates. So, we do not have a fixed absolute location to compiler that can be used by the distcc wrapper, and I’d to make sure that the distcc wrappers are written on-fly with absolute path to compiler before the build starts. So, what I did was, while the CC/C++ Compiler path was initialized, I ensured that the wrappers are written into the user home directory/a directory(DISTCC_WRAP_STORE) that is available both on build machine, and the distcc servers.

CC := $(PUMP) $(DISTCC) $(DISTCC_WRAP_STORE)/x86_64-unknown-linux-gnu-gcc -m32

$(shell echo $$(readlink -f $(LINUX_I686_GCC_BIN_DIR)/x86_64-unknown-linux-gnu-gcc) \""\$$@"\" >> $(DISTCC_WRAP_STORE)/x86_64-unknown-linux-gnu-gcc )
$(shell chmod a+x $(DISTCC_WRAP_STORE)/x86_64-unknown-linux-gnu-gcc)

  • disctcc wrappers must be executable files, and they seem to work only when they have the absolute path to the compiler in them! Otherwise, the errors you see are quite weird, and they give no clue about the missing execute permissions or the relative path.
  • If you are using .d files generated by GCC compilers, then the .d files may end up created in current directory from where compilation starts, while you might be expecting them in the object directory This problem can only occur if you’re using gcc 3.0 or later, have the source and object files in different directories or under different names, and you are using -MD or -MMD but not -MF. Even with -MF in place, the first line in the .d file, which is the path to the object file, may not really contain the object.o, instead it will be source.o if source, and object files have different name! ie. you are compiling errorHandler.c to errorHandlerM.o and in this case, you gotta make sure you correct the .d file after it is generated.

I will add more findings, if I come across any. We have some troubles with PUMP mode right now, hopefully, we will get through them.

Rocky and Mickey

Those who have watched Rocky Movie Series would know who Rocky, and Mickey are, the two amazing characters. The following scene is one of the best of the series. I find it hard to write about this scene because I can’t be eloquent with my writing. In the small group of those that Rocky knew, Mickey’s place is perhaps equally best as that of Adrian, Rocky’s wife, wonderful character in the entire series.

What strikes me when I see these characters is, sometimes we all need help desperately. Perhaps, luckiest are those who have people in their lives that stand by and help without you yelling out for it and what hurts is losing them away. Doesn’t it?



Filthy Minded Petrol Retailers

It is pretty common that every now and then you get cheated at fuel pumps either knowingly or unknowingly. And after you get cheated once, the next visit makes you feel skeptical about the fuel quantity, and quality etc., Doesn’t it?

If your mindset is “I will pay whatever the money to get the right quality and quantity”, you lose your nerve when you get cheated. Don’t you? I’ve such mindset. I cannot take these things lightly. I’ve a very huge expectation on how things should look like. In countries like Germany, you don’t see any staff a fuel outlet. You got to help yourself for whatever the amount. I wish it happens even in India someday and the quality, and trust is given utmost prominence by each Indian company at all their retail outlets. Shell Petroleum cares a lot for the quality, and the trust of their consumers. I’ve never seen such care and importance given to these very important aspects by any of the Indian oil business leaders. A lot of Indian Oil petrol pumps are having this cheating mentality. I can give a list of such outlets if you want! Looks like it is same even with HP. I’ve had comparatively more trust on HP pumps, not anymore.

Yesterday, after getting cheated for 100/- at a HP petrol pump, I logged a complaint at their website I’ve been given a ticket number. I wonder what action they take on the outlet I complained against. Whatever maybe their action, I did my bit for my own satisfaction. And I don’t want to get upset visiting them again. So, I’ve decided to start using Shell Petrol. Hopefully, Shell people stand their motto on quality and trust of consumers.