Saturday, December 6, 2008

Graphical layout of dependencies between static libraries

Back to linux! This week at work I got introduced into a new tool that helps resolve dependencies between static libraries. To organize your C++ code better, it might be a good idea to develop static libraries, which are linked to the executable. In our situation we had several static libraries that had interrelationships that caused linkage problems. It is a known fact that g++ (ld) has a strong dependency on the order of the static libraries on the command line. Other compiler/linkers such as IBM xlc and Microsoft Visual Studio compiler are less if at all sensitive to this. And so it also caused problems when linking our libraries with the program. Some libraries had to be repeated on the command line for the linker to resolve all the symbols.
Again, the power of the linux command line came to the rescue this time. There is a tool called lorder that is able to generate output showing which static libraries depend on each other. It uses nm that outputs the symbols in the static library. The program lorder will list for each static library on which other library it (directly) depends. This output is then massaged a bit such that it can be used with dot (a tool that is able to generate a graph from a text input file). Dot can write its output to .png, .jpg, .svg and even .pdf files! So, by using lorder, five lines of script to convert the output of lorder into the correct format for dot, and dot itself, a graph was created showing the interdependencies between the static libraries. A picture says more than a 1000 words. And, also in this case, we found some cycles in the graph, causing the linkage problems!

Yahoo going private?

In recent days the news surfaced that group of investors led by Jonathan Miller (of AOL fame) is interested in buying Yahoo and taking it off the stock exchange source: nytimes. At the same time Microsoft has made another attempt to buy Yahoo (this time hidden as 'we are only interested in the search business') for $20 billion. Of course the offer by Microsoft should not come as a surprise, as they were always interested (and determined) to take over Yahoo. It's also up to the board of directors of Yahoo to decide what they want to do with the company. Carl Icahn has now three seats on the board, and for sure will look for the most value. (At this point he should show his true colors: if he goes with the private investors, he was always looking for the best value; if, on the other hand, he goes with the Microsoft offer.... it will raise again the question: was he always working in favor of Microsoft?)
Microsoft might hit a snag with an offer made by Jonathan Miller. But, eventually I believe Microsoft will get Yahoo, one way or another. It is just a matter of time. The group of investors might cause a better price for the current share holders of Yahoo. Time will tell, but I'd put my money on Microsoft (even though I am a Linux enthusiast!)