Software portability
This article needs additional citations for verification. (November 2011) |
Software portability is a design objective for
Strategies
Software portability may involve:
- Transferring installed program files to another computer of basically the same architecture.
- Reinstalling a program from distribution files on another computer of basically the same architecture.
- Building executable programs for different platforms from source code; this is what is usually understood by "porting".
Similar systems
When
In the simplest case, the file or files may simply be copied from one machine to the other. However, in many cases, the software is
In some cases, software, usually described as "
Software which is not portable in this sense must be modified much more to support the environment on the destination machine.
Different processors
As of 2011 the majority of desktop and laptop computers used
Source code portability
Software can be compiled and linked from source code for different operating systems and processors if written in a programming language supporting compilation for the platforms. This is usually a task for the program developers; typical users have neither access to the source code nor the required skills.
In open-source environments such as Linux the source code is available to all. In earlier days source code was often distributed in a standardised format, and could be built into executable code with a standard Make tool for any particular system by moderately knowledgeable users if no errors occurred during the build. Some Linux distributions distribute software to users in source form. In these cases there is usually no need for detailed adaptation of the software for the system; it is distributed in a way which modifies the compilation process to match the system.
Effort to port source code
Even with seemingly portable languages like C and C++, the effort to port source code can vary considerably. The authors of UNIX/32V (1979) reported that "[t]he (Bourne) shell [...] required by far the largest conversion effort of any supposedly portable program, for the simple reason that it is not portable."[1]
Sometimes the effort consists of recompiling the source code, but sometimes it is necessary to rewrite major parts of the software. Many language specifications describe implementation defined behaviour (e.g. right shifting a signed integer in C can do a logical or an arithmetic shift). Operating system functions or third party libraries might not be available on the target system. Some functions can be available on a target system, but exhibit slightly different behavior such as utime()
fails under Windows with EACCES, when it is called for a directory). The program code can contain unportable things, like the paths of include files, drive letters, or the backslash. Implementation defined things like byte order and the size of an int can also raise the porting effort. In practice the claim of languages, like C and C++, to have the WOCA (write once, compile anywhere) is arguable.
See also
- C (programming language)
- Cross-platform software
- Data portability
- Hardware-dependent software
- Interoperability
- Language interoperability
- Portability testing
- Porting
- Source-to-source compiler
References
- ^ Thomas B. London and John F. Reiser (1978). A Unix operating system for the DEC VAX-11/780 computer. Bell Labs internal memo 78-1353-4.
Sources
- Mooney (1997). "Bringing Portability to the Software Process" (PDF). (help). West Virginia University. Dept. of Statistics and Computer Science. Archived from the original (PDF) on 2008-07-25. Retrieved 2008-03-17.
- Garen (2007). "Software Portability: Weighing Options, Making Choices". The CPA Journal. 77 (11): 3. Archived from the original on 2010-07-08.
- Lehey (1995). "Porting UNIX Software: From Download to Debug" (PDF). (help). Retrieved 2010-05-27.