Hi guys,
I am an EE with some C programming experience in DSP(always in windows environment). I am currently making the transition to working with C++ in unix environment with large data.
I am having a few difficulties and was wandering if someone could guide me for some good books and reference material for total beginners. I have never used UNIX or programmed in a UNIX environment.
I downloaded VM VirtualBox and installed openSolaris. After reading some forums I read that OpenBSD and freeBSD are very good. I tried installing OpenBSD but all I was able to install was X (I don't even know if that's right). I wasn't able to install a GUI on top of it (I know I sound helpless).
What I would like to know is where can I find material and books for:
1)learning how to operate in UNIX environment with OpenBSD if possible. How to install packages (openSolaris has an automated feature), and how to manage files and folders from the terminal.
2)I tried Emacs and Vim but failed miserably understanding how to use them. It was much simpler on windows with CodeBlocks. So I need some reference on how to code with C++ in a Unix environment. How to develop what program to use to write my code and how to compile. Should I use GNU g++ or some thing else?
3) Also if anyone knows of advanced books in C++ on how to manage large data to perform MonteCarlo simulations, solving stochastic differntial equations,etc....
I don't want to sound lazy but I have spent already 3 month of trying to find the solutions on my own. Amazon is filled with tons of books and it is hard to really know which ones are really good. Many internet forums are filled with UNIX snobs who told me to "download Ubuntu" and that "OpenBSD is not for idiots", which makes it even more frustrating.
I appreciate any help including referencing me to threads with similar questions.
Easiest thing to do is to go to http://www.thoughtpolice.co.uk/vmware/ and download vmplayer and one or more of the VMs that have been created. I do recommend sticking with Linux until you are more familiar with the Unix environment. You will find more tools and a more beginner-friendly environment there that will make it easier and less frustrating to learn. Once you get the hang of Linux, you can branch out to OpenBSD, FreeBSD, OpenSolaris (which is pretty much dead since Oracle took over Sun) and any other freely available Unix variant.
The latest Fedora release (13) is pretty nice. And I know a lot of folks who really like Ubuntu.
But, from experience, the Linux environment is going to be a lot easier to start with.
I'd start with Eclipse/CDT as a development environment. The version that comes with Fedora 13 is very nice. You will want to use GCC. It's the most standards-compliant compiler available on Unix.
I can't really help with your other questions other than to point you to the Boost Libraries: http://www.boost.org/ You'll find lots of useful tools there.
Is vmplayer better than VM virtualBox? Also, will coding in Linux environment be the same as coding C++ in Unix environment?
Any suggestions about a good starting book for unix or linux then?
If you are just starting out in UNIX, I personally feel that any of the UNIX variants are fine: OpenBSD, FreeBSD, OpenSolaris, Ubuntu, etc... ...just use the one that installs easily and works for you! Most of what you learn on Linux, as a programmer, will be transferrable/portable to the other OSes.
If you want to go old school/hard-core:
1. Learn emacs and/or vim - both have steep learning curves and are extremely useful and allow you to ultimately, code without touching the mouse - much faster this way.
2. Use g++/gcc/gnu make for compiling - it will usually come pre-installed in your distribution. If not, it's easy to get.
The easier route:
3. +1 PanGalactic - Eclipse or any IDE (like Ultimate++) will make you more productive quickly.
Other Notes:
4. For large data, having UNIX is a huge advantage. For a lot of text file data manipulation, you can just script Ruby, python, or use any number of mini UNIX tools.
5. To do MonteCarlo simulations and solve SDEs, C++ is the wrong tool. Look into R, gnu Octave, Sage, etc...
6. Best way to learn Unix is to have a specific problem/project you would like to work on and look for tools/ways to get the job done. Learn through experience.
If you are just starting out in UNIX, I personally feel that any of the UNIX variants are fine: OpenBSD, FreeBSD, OpenSolaris, Ubuntu, etc...
While I agree with you in principle, in practice the complete set of all of the software that I use on a regular basis is readily available on Linux, and I find only subsets are available on the other platforms.
Linux is easier for me to use in that regard. I am confident that any tool I want will be available on that platform. There's a good chance that, on the other platforms mentioned, at least one key tool is either not available or so poorly supported as to be unusable.
Do you recomend a certain GUI such as KDE.
By the way I can code in R and Matlab very well this is not an issue. The problem is to manipulate large quantity of Data and and run simulations for real time environments.
Also any intake on whether I should start with ksh or bash or sh...
Last is there a good book or good reference out there from which I could learn how to work with the terminal in Unix or Linux?
I actually use Ubuntu myself, but have no qualms switching over to any other UNIX variant, as long as the sysadmin required to load packages or do OS updates doesn't become a time-sink.
KDE or gnome are standards. If you are using the command-line most of the time, it doesn't matter much which window manager you use. As for shells, bash is pretty standard, but there, too, you can pick whichever one you like.
Google around and you should find some good tutorials on how to use the readline functionality built into bash. This allows you to quickly edit your command-line history using vi or emacs mode.
Part of what makes UNIX great is, you have many choices for tools - just try them out and find out for yourself what fits you best (don't wait for us to tell you what we like...).
OpenBSD is an almost openly hostile environment for beginners. Even the installation requires partition sizes in blocks. Recomending Linux isn't pure snobbery, it's helpful advice, even if it wasn't meant to be.
If you are programming then a lot of linux distros aren't helpful.
A lot of the "friendly" distros (like Ubuntu) don't come ready to roll for programming.
you often need to install the compiler, make, manual pages, development libraries etc etc
and often you don't know what you need.
I use FreeBSD, and it is really good for programming but it can take a bit of initial setting up which
can also be frustrating. Once it's set up though, it's done.
And FreeBSD has a massive selection of ports to browse.
As for vim, sit down, open the vimtutor and learn it.
there is a reason we unix geeks use vi.
it isn't because we are old fashioned, or luddites, or stuck in the past.
it's because we are lazy and it's the most powerful editor you can get.
A lot of the "friendly" distros (like Ubuntu) don't come ready to roll for programming.
That's not quite true. Due to the large selection of libraries in its repositories, usually even with debug build packages, Ubuntu is an excellent choice for programmers.
I started learning vi. In the mean time untill I understand it better I started coding with eclipse in ubuntu, as some suggested above.
I also installed OpenBSD and X (no GUI like KDE). I started vi from the terminal but it isn't as easy as the version with user interface under ubuntu.
By the way is there any way to make vi to automatically follow the ANSI (Allman) format?
I am using pdksh shell, do you guys think it is a wise choice?
There are a few annoying things about Ubuntu (there should be better verification of packages on OS updates), but overall, I am very happy with it. Athar is right - these days, most programming tools come pre-installed, and whenever things are missing, doing an app-get install some-package is one of the joys of using Ubuntu.
But to be honest, more than once, I, too, have chosen an OS because it's easier to install; don't have a ton of time to fiddle around with finicky systems.
vim is a good choice - google around for vim packages to customize it the way you want.
Never used pdksh, so can't tell you, but generally, choice of shells doesn't matter much unless you do a lot of shell programming (as long as it has history and pushd/popd equivalents). Anyhow, changing shells is trivial if you need to switch. Just use one and switch later if you need to.
Can your explain why, the only reason I chose OpenBSD over FreeBSD was because it was way easier to install.
There's more support for FreeBSD, more beginner support as well, especiall now that bsdforums is gone.
It's targeted at PCs so it has a nice installer and nice ports system to (although OpenBSD has that too).
It's just so much easier to get started with FreeBSD, develop on, rebuild the kernel and so on. Once you've got going, you can better appreciate the aims of the OpenBSD project, which in my view is running hardened production systems.
I also choose pdksh. I recently discovered mksh is the inheritor of pdksh so I'll be trying that.
I haven't tried the other BSDs, I chose FreeBSD as it's probably the most popular.
It has a more thought-out feel for me than most other unices.
I think most people use X. I use sawfish window manager and rox filer for desktop
which are very lightweight and configurable.
be aware though that flash players and such like don't work well on BSD.
But I run virtualbox for windows XP, linux and Haiku when i need to.
You can also try QT for a development environment. It runs on windows, mac, linux and freebsd.
(it even has a vi mode editor!)
opensolaris has a cloud hanging over it so we don't know what will happen there.
linux is fine though if you prefer.