I am to take up the task of porting a C++ networking application code base of quite a size from Solaris to Linux platform. The code also uses third party libraries like ACE. The application when written initially was not planned for a possible porting in future.
I would like to get some advice and suggestions as to how I go about the task. What would be the best methods to follow.
-Prabhu. S
ACE is a plus there, as it is multiplatform. You must check where and how your type sizes are used. If ACE_* basic types are used you are hitting a streak there, as those are portable, else I would start by changing the Solaris version into using multiplatform data types and elements (use ACE facilities since you already have that in place).
If you are using any Solaris only external library, you will have to locate an equivalent in linux and write a wrapper so that the rest of the application does not need to know what implementation is being used.
After that, migration into linux should be straight forward with just one code base. You should compile and test it through-fully.
"There is no such thing as a portable application only applications that have been ported"
First start with using the same tools on both platforms, if you can. I.E. if the Solaris version has not been changed to use GCC and GNU make etc, I advise you to change this first and get the Solaris build working. You will find that you will fix compiler problems first and not try to fix them on Linux at the same time as trying to port the application.
Second make sure you can get all the same libraries on each platform at the same version. I think you can get ACE for Linux. Make sure that the libraries at that version work on Solaris. This will limit compatibility problems.
Once you have done that then the real work starts.
You will need to compile each source file one at a time and find the functions that are not available in Linux. First look for a replacement that is available in both OSs. If there is no simple replacement then create two libraries one for Solaris and one for Linux. Create wrapper classes or functions to abstract the incompatibilities away.
If this sounds like a lot of work - it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With