Apr 5, 2008

NetBeans on Ubuntu

I'm usually a hardcore Vim fan but I've started to use NetBeans for my Ruby work. It's a fairly typical install but the one quirk is that $JAVAHOME has to be defined for the installer and Ubuntu's JDK package doesn't set it.

That's easily remedied though; download NetBeans, install the JDK and pass --javahome to the installer as a command line option.

#> netbeans-6.0.1-ml-linux.sh --java-home /usr/lib/jvm/java-6-sun

Ubuntu 8.04 "Hardy Heron"

The new Ubuntu release, 8.04 "Hardy Heron", is nearly out so I thought I'd take a few minutes to do a fresh 'from scratch' install on to my laptop, a Dell Latitude D830, this weekend. I was pleasently suprised that almost everything worked exactly as expected out of the box, including; wireless networking, dual head monitor support, suspend, hibernate, compiz, etc....

There was one small but very critical change I had to make. It appears that the ACPI hard drive load/unload bug has still not been fixed. It's critically important that you apply this work around unless you want your hard drive to die prematurely.

There was one other non-critical change I made. I didn't dig into the issue to understand it but for what ever reason the default ALSA settings don't support the audio pass through in the docking station. Fortunately the fix is extremely simple. You just need to install the "Gnome Alsa Mixer" and select the IEC958 check box.

#> sudo apt-get install gnome-alsamixer



I've been running Ubuntu on this laptop since the 7.04 Feisty Fawn release and this is by far the smoothest install yet. In the past I've been reluctant to declare Ubuntu's desktop experience to be better than Windows but I think I'm finally convinced.

Setting CFLAGS

It turns out the gento-wiki has a great page indicating which GCC -march flag should be set for which CPUs. To determine which CPU you have, run the following at a command prompt:

#> cat /proc/cpuinfo

It will yield a page of output. The first few lines of output from my laptop are below:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz
stepping : 10

The part you're interested in is the 'cpu family' and 'model'. Once you know those find the corresponding entries on http://gentoo-wiki.com/Safe_Cflags. Then create an entry in $HOME/.bashrc file that looks something like this:
CFLAGS="-march=prescott -O3"
CXXFLAGS="${CFLAGS}"
export CFLAGS CXXFLAGS

Of course substitute the -march value for the one you found on the wiki.