Cobalt Sky are working with UNICOM Systems Inc., the owners of the UNICOM Intelligence suite of survey software, to update Quantum for 64-bit operating systems. Quantum is one of the most widely used tabulation and data processing packages in the survey research industry, and despite there having been few updates for many years, it is still the product of choice for many companies. We continue to use it for all manner of projects due to its power and ease of use.
However, the hardware world has moved on and UNICOM now want to update Quantum to take advantage of increased computing power. Quantum is written in C and we have worked with C and Quantum since the 1980s; we relished the challenge of the update.
The source code was written for a 32-bit architecture with modifications for different operating systems, e.g. Linux, Windows, Solaris etc. Our task was to make the 32-bit version run on Windows and Linux under a 64-bit environment. We converted first for Linux. Some sections of the code relied on 32-bit sizes and used very old tricks to save memory space. These had to be rewritten or modified so that they would work with 64-bit pointers and not worry so much about memory. Secondly, some of the code was very old and wouldn’t compile under more modern compilers. These were also fixed. In the main though, the code has stood the test of time and it is a compliment to the original programmers that we didn’t hit any major hurdles.
UNICOM provided the test suite used to check Quantum compilations; this consisted of multiple Quantum runs and their known output. The test suite runs all these programs and then checks that the output is consistent with the benchmarks. This has proved invaluable in locating odd differences caused by the conversion of the code to 64-bit.
Once we had a working 64-bit version, we then took the exact same codebase and compiled for Windows. The Windows version it had been compiled for was ancient, mostly MS-DOS. Where Windows/MS-DOS specific code was present, this was examined and altered to use later API calls if required. Because we had already done a lot of upfront work in converting the code to be 64-bit compatible, the Windows port was reasonably straight forward. The only major change in the Windows version was how Quantum “compiled” its code. We had to make this compatible with different versions of Visual Studio.
A further complication is that Windows and Linux use slightly different datatype sizing. Under Windows a long integer is 32-bits but on Linux it is 64-bits. This would have caused compatibility issues not only with the existing Quanvert DSC as it uses 32-bit values, but the range of the values stored in its data structures. We had to alter the Linux version so that it used 32-bit values. Added to this, some data structures that are saved on disk hold 64-bit pointers. The Quanvert DSC was expecting 32-bits. We had to write “shim” layers that saved such data structures down to disk with 32-bits and convert back to 64-bit when reading from disk regardless of Windows or Linux. The code has been written such that, when the Quanvert DSC is ready to move to 64-bit in the future, then both the Linux and Windows version can easily move to full 64-bits.
This has been a very interesting project so far. Now that the code is working on 64-bit machines we are looking forward to working with UNICOM on enhancements and bug fixes so that users can continue enjoying the power of Quantum well into the future.