Why Linux?

I have been told many times of the virtues of Linux and decided after some requests to port our simulation back end (roadRunner, http://code.google.com/p/roadrunnerlib/) to Linux. Well two months later and we’re still trying to port the code. Quite apart from the fact that almost every Linux distribution has to be treated as if its a separate operating system, the subtleties of compiling and linking on the Linux platform are considerable. To give an example, the code runs perfectly on windows but one bug is proving reluctant to solve. The library has both a C++ and a C API. The C++ API works fine, all tests run ok on Linux and Windows. We now run the tests through the C API, and the results on Linux come out wrong. The solution, comment out one of the critical calls in the simulation engine and the C API works fine. The simulation engine should not run without this critical call but if we leave it in, it gets called twice (as seen in the gdb debugger) which results in incorrect numerical answers. At the moment we can only imagine that it must be a bug in the GCC compiler or Linker or perhaps a strange memory corruption.

The question is why Linux? I’ve no idea, it seems to be buggy and certainly very expensive to develop for. Sure the OS is free but the total cost of ownership seems to be high. I’ll keep you updated if the strange compiler bug is resolved.

Update (11 Dec): Kyle Medley and I had a go at fixing the above bug today and between the two of us we found the problem. There are two functions named evalModel but they have different argument signatures. In a C++ work that doesn’t matter but combine a C API on the C++ code and variants of evalModel become indistinguishable to the GCC linker. It turns out the linker would link the first one it found, in this case the wrong one. Neither Visual Studio or the Borland compiler have this problem so I assume it must be a bug in the GCC linker.

This entry was posted in Programming, Software. Bookmark the permalink.

Leave a Reply

Your email address will not be published.