tags:

views:

135

answers:

5
+5  Q: 

Unix and FreeBSD

My final goal is to write the program which can run on the Unix OS. I know that there are many Unix versions, and don't know exactly for now which one I need to support. I cannot install any Unix OS right now. The only thing I can do is to use free OS which is close to Unix as much as possible. Is FreeBSD a good choice for this? I know that there is also OpenBSD, possibly something else.

Additional information: The programing language is C++, I am using GCC, with some portable libraries: Boost and wxWidgets.

+5  A: 

Depending on what your program does, what language it is written in etc. you can write portable code on any platform. For example, I routinely port one of my applications written in C++ from Windows, where I develop it, to Linux, with one minor change (I remove ODBC support). So the choice of OS to do the development on is not critical - consciously writing portable code is.

anon
+3  A: 

OpenBSD, FreeBSD, DragonFlyBSD, NetBSD, Open Solaris, etc. are all open and free Unix operating systems, you cannot really get closer than that.

To circumvent the installation restriction consider virtualization with a tool like Sun's Virtual box.

Mimisbrunnr
The BSDs aren't certified Unix, but Open Solaris is.
reinierpost
Thank you, this is information I am looking for. My restriction is that the program is not open source. I need to provide binaries compatible with target OS. So, I need to install one of these OS and build the program there, is this correct?
Alex Farber
@Alex: Binary compatibility will be tough. Learn more details about the target system. Your FreeBSD x86 binaries won't run well on Solaris running on Sparc system.
Tadeusz A. Kadłubowski
+2  A: 

what programs are you writing and what language are you using? Whether you use FreeBSD or Solaris etc, you can write fairly portable code using C++/Python/Perl etc. These programming languages can work in different platforms and i don't think you will have major problems with that.

ghostdog74
+1  A: 

Look at POSIX standard. It's portable API supported by most of Unix like operating systems.

+2  A: 

See the Single UNIX Specification. If you make only the assumptions given in the man pages provided by the OpenGroup in its Single UNIX Specification, then your code should work on all UNIX-compliant OSs.

If you use my development/coding search engine, it is heavily biased in favor of sources from the Single UNIX Specification, and clicking on "Single UNIX Specification" will limit the search to that source. As long as you restrict yourself to the guarantees made by the spec, then it should work on all UNIX variants.

I should also point out that if you restrict yourself even further to using only features provided by the ISO C++ standard, by the Boost C++ libraries, and by WxWidgets, then you should be able to target not only all variants of UNIX, but also Windows as well. However, if you only need to target UNIX, then any of the system interfaces in the Single UNIX Specification as specified therein should be safe to use.

In terms of development environment, I would recommend that you install a copy of Ubuntu Linux in VirtualBox, since setting up a working development environment on that particular distribution of Linux is as simple as a single invocation of sudo apt-get install, and Linux is de-facto compliant with UNIX. The single command sudo apt-get install build-essential pkg-config g++ automake autoconf cmake doxygen libboost1.40-dev libwxgtk2.8-dev is sufficient to get a fully working C++ development environment on Ubuntu with WxWidgets and the Boost C++ Libraries installed.

Michael Aaron Safyan