Testing the program in different OS
I want to test my program by installing it in different OS versions. My development computer is Ubuntu. What other Linux versions can I test by installing them inside VirtualBox开发者_开发百科 and running my program there?
Though it is not critical for me right now, I want to try something different and see what happens.
Also, what is the chance that the program running in Linux will work in the Unix OS? The program is not open source, I can distribute only pre-built binaries.
Let's start from the top. You've built a program on some distro of Linux in some programming language. You haven't told us which.
If it's in C, then your first two problems are hardware and glibc. By hardware, I primary mean 32-bit versus 64-bit, but it's also worth noting that Linux runs on PPC, ARM, and SPARC.
If you have a 64-bit system, you can run a 32-bit VM and test.
Programs written to newer versions of glibc generally work on older versions, but not the other way around. So, if you need to support an older distro, you'll have to build there.
For most programs, the glibc version is an adequate surrogate for the kernel version, but if you work at it hard enough you can create a kernel version dependency as well.
If you program is C++, then you've got an additional worry: the C++ / libstdc++ runtime. Not all distributions have the shared libs needed to run all possible programs.
In some cases, a program compiled and linked to an older version of g++ will not find the libstdc++ that it requires on a newer distro.
Then you mention 'Unix'. There is no such thing as Unix, in any practical sense of the term, in the modern world. There are several systems you might want to support that you might be worrying about here>
- The BSD family: netbsd/freebsd. You can run them in a VM. You can't expect binaries to carry across.
- (Open)Solaris: You can run this in a VM, at least for Intel chips. You can't expect binaries to carry across.
- HP-UX: You can't run this in a VM.
- AIX: you can't run this in a VM.
Maintaining code that works across this whole zoo is a big job, not to be undertaken lightly.
There is no single "Unix OS". You could set up FreeBSD or similar in a VM in order to test with a non-Linux OS though.
You'll need to come up with a good way to distribute your app if it's closed source. You will have to specify things like required libraries. Additionally, you might have to provide a lot of builds for the various architectures (arm, x86, x64, etc). There are a lot of Linux distros and Unix variants - RedHat, SuSE, Debian, FreeBSD, etc. You'll have a lot of combos to work out.
精彩评论