Sunday, June 17, 2007
Getting eclipse working on solaris
Why is it so painful to set up eclipse on solaris?
I have recently started working with java and although
java on MicrosoftWindows is very nice I have to have java
working on Solaris. Hence I thought, "let's get eclipse
on solaris so I can use its great debugging facility".
I put a request in with the helpdesk and left it at that.
A couple of weeks later eclipse still hadn't arrived
so I thought, "I'll do it myself, how hard can it be?".
I have an ancient Ultra5 at home running Solaris 7 so
I thought I would install it on that and bring it in on
a small USB drive.
It turns out the eclipse executable you download from the
sun website has all sorts of library dependencies that take
a while to get sorted out. But even when those are sorted
there are still pitfalls.
You would think that with solaris and java being invented
by Sun Microsystems the company would find ways to get the
things to work together. Well I say, "where's the evidence?".
I tried to get eclipse working on my Ultra5 for a couple of
weeks now. I just succeeded this weekend. Here is the long
and painful story of how I did it:
1) The first step had to to be to abandon using solaris 7.
The version of X11 that comes with solaris 7 is just too old.
Eclipse has all sorts of problems using the so-called ready-built
installs that are around, so there is some build from source
needed. However, it turns out that this is just too hard to do
on older versions of solaris due to X11 differences.
It is easier said than done to get an alternative version of
X11 installed. I tried building the latest X11 release 7.2 from
source and it will only build with the very latest GCC.
Unfortunately there are eclipse components that currently won't
build with that version of GCC. So after a week of trying to build
X11, install the right version of GCC and build the various parts
of GTK that eclipse depends on, I gave up and installed solaris 9.
This was also a painful experience but more due to bad luck than
anything else. The machine threw a wobbly during the solaris
install. I'll admit there was a thunderstorm at the time.
Solaris managed to get itself in a state where it tried
booting in CPR mode, then shutting down, then rebooting again,
only to shutdown again. Apparently, this is rare condition
with a very esoteric escape route. On the reboot, type STOP+A
to get to the ROM prompt, then enter the command:-
set-default boot-file
This broke the CPR boot cycle and the system eventually booted
normally. It was then I found the file system was corrupt.
One very tedious fsck later I was up and running again.
2) Use the famous Freeware for Solaris website, http://sunfreeware.com.
I used to take a macho pride in building all the GNU tools I needed
from source, and from knowing about the dependencies between the
packages. But the trouble is some packages have become so big and
complex that all the components required for a successful build
have to be at particular versions, requiring particular versions
of the GCC compiler. I can't cope any more. I made heavy use of
this wonderful website. I wrote a little shellscript that used
wget to suck all the pkgadd packages over in one go. Phew!
Then the installs started. Here are the steps I took:
a) create /usr/local, create other transfer dir someplace else.
b) ftp the unzippd gzip package to the transfer dir from my
linux machine (no openssh yet, so have to initiate ftp from
linux to solaris).
c) pkgadd -d gzipPackage to install into /usr/local/bin.
d) ftp all the other packages to the transfer dir
e) use gzip to unpack them all.
f) Did selective installs of these packages.
Started with bash (phew), bzip, gcc, zlib, tar, bison, flex,
automake, autoconf, binutils and make. Installed many others
that I won't mention here.
g) Installed some of the packages eclipse requires,
such as glib, atk, libtiff, pango and gtk.
h) Tried to start eclipse and found a few libraries
still missing, e.g. libglib-2.0, libgmodule-2.0 and
libgobject-2.0. Installed glib-2.13.0 which made this
problem go away. At last, doing an ldd on the eclipse executable
says that all libraries are found.
3) Build gtk+-2.2.4 from source.
This step was necessary because it turns out that the version
of gtk on the sun freeware site has been built wrongly.
Some of the symbols have internal linkage instead of
external linkage. This problems shows up as a fatal relocation
error, symbol gdk_font_equals not found when you try to run eclipse.
The first thing to realise is that when you have to build a GTK
component from source, do not make the mistake I did, which was
to try to use the most recent version. Use the one closest to
what you already have instead. I already tried using the latest
GTK components when I was on solaris 7 and there are just too
many problems. So I downloaded v2.2.4. It failed to configure.
I had pkgadd'd glib1.2.10 but gtk+-2.2.4 requires at least
glib-2.1.4. So I pkgadd'd glib-2.13.0 on top which seemed to work.
The next problem was configure did not spot that I had installed
freetype 2.3.1. This is because freetype changed the way you have
to include their header files. I had to hack the configure script
to cope, changing the include code to:
#include
#include FT_FREETYPE_H
Next the X11 check failed. This was because the test app was
failing to find gethostbyname but the configure script assumed
it must be failing to find the X11 symbols. I hacked configure
again to force -lsocket -lnsl.
Next, it failed to find libexpat. I pkgadd'd it and then, eventually,
configure succeeded. At last!
Doing a make at this point also failed but the failure was in
one of the demo programs. The libraries built so I did a 'make install'
and tried to run eclipse.
Eclipse said there were no fonts, but at least it ran.
4) Set up X11 fonts.
At first I thought the problem was do with the fontconfig install,
so I did a build from source of that. But it made no difference.
Eventually, I realised that the fontconfig configuration was
not being installed in the proper place and was not referring
to the X11 fonts that come with solaris. The tipoff is to use the
command "xlsfonts", which lists the fonts solaris-X11 knows about,
then give the command "fc-list" which gives the fonts fontconfig
knows about. The former gave a reasonable list,
the latter gave an empty list.
The fontconfig install creates the directory /usr/local/etc/fonts.
This needs to be symbolically linked to /etc/fonts (which didn't even
exist at this point). Then fonts.conf needs to be edited.
The command "xset q" shows where the solaris standard X11 install
puts its fonts. But beware! Do not add all of these to fonts.conf!
Only add the dirs that contain compressed pcf files. Do not mention
the directories with the TrueType fonts. If you do then fc-list
will hang and so will eclipse.
5) Get JDK1.5.0.
At this point eclipse ran but immediately produced an error
saying that the JRE is too old. Solaris 9 comes with JRE1.4.
This is not recent enough. Come on Sun! Eclipse is THE number 1
java development environment, so please make sure that your
downloadable solaris installs support it.
Tracking down suitable versions of the JDK is harder than
I thought it would be, thanks to sun's confusing website,
their mandatory registration proceedure, and the confusing
plethora of java environment names (jdk, sdk, j2ee, standard edition,
enterprise edition, java studio etc etc etc).
Eventually, after a number of false starts, I got hold of
jdk-1_5_0_12-solaris-sparc.sh which installed ok.
6) Take the rest of the day off.
That's it! With the right sun freeware packages installed,
with gtk+-2.2.4 built from source, the X11 fonts configured
and JDK1.5.0 installed, eclipse is now up and running.
Friday, March 09, 2007
What to do when grub gets in the way of windoze
When you've put linux on a machine it tends to use grub during the boot. This can pose a problem if you decide to revert to windoze. Most windoze install procedures leave the MBR alone. This causes problems because a windoze install usually means at least one reboot during the installation process. If grub is still on the MBR this causes a problem because grub will then try to boot linux but will fail because the windoze install that is partway through overwrote it. At this point the boot tends to hang. Heres how to get around it:
and save to a USB flash drive.Download MbrFix (http://www.ambience.sk/fdisk-master-boot-record-windows-linux-lilo-fixmbr.php) Whilst linux is still there use the following grub commands:
grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot
Now you can install windoze. When it gets to the boot you will be put into grub again. Use the commands above to let the boot carry on and it will boot windoze. Once windoze has fully installed you need to run a MbrFix . Get it from the flash drive you prepared earlier. Help is builtin. Now grub will be gone and reboots will behave normally!
Sunday, February 11, 2007
postfix email forwarding issues
I tried to configure postfix to use email forwarding, both by postfix configuration and by the use of a .forward file. It failed silently. Eventually I found out that it was the fault of SELinux, which was enabled during my installation of Fedora Core 5. There doesn't seem to be any fix I know off other than turning it off via the command: setenforce 0.
With selinux disabled, procmail does invoke my whitelist filter correctly.
Tuesday, September 12, 2006
An ebay weirdness
I have just started to sell some junk (what else?) on ebay and came across a little nasty I thought I would document here. I was using Windoze (cough, cough), and Micro$oft Internet Exploiter. After quite a while I noticed that the web pages were no longer working properly. I could not enter the category of a new item and was getting a warning triangle on the bottom left hand corner warning of scripting errors. Several other people also get this and I saw a range of conflicting advice. However, on guy said to uninstall the flash player. I went to uninstall in the control panel. I did not see flash listed but I saw Macromedia shockwave player so I uninstalled that. Suddenly, ebay started working again! Go figure....
Saturday, September 02, 2006
privoxy on linux
Here's what I did to get privoxy working on linux, using the source tarball:-
The unpacked source does not come with a configure script. You have say:
autoheader
autoconf
before you can say configure;make;make install
It builds and installs just fine once this is known. It installs into /usr/local/sbin with the config files in /usr/local/etc/privoxy. This is actually a mis-match - when privoxy is run from /usr/local/sbin it complains that it cannot find the config file /usr/local/sbin/config. Of course it can't find it! The files are in /usr/local/etc/privoxy! Create a symbolic link:-
cd /usr/local/sbin
ln -s /usr/local/etc/privoxy/config .
Then the privoxy daemon will start up ok. Then you just change the proxy settings in firefox to point to 127.0.0.1:8118 for all protocols. That's it!
Friday, August 25, 2006
xmms on linux
There is a new version of xmms, version 2, which works with GTK2 and supports the latest codecs. I started to look at this because I recently obtained a number of music files in m4a format, which the old xmms cannot handle. This blog describes my experience trying to get xmms2 up and running on linux.
xmms2 depends on scons (which is installed via python) and SQLite (configure;make;make install).
xmms2 will, in theory, build without any other dependencies being satisfied but it is as well to get some other things installed for the optional components of xmm2. First is the mad library for mp3 support (configure;make;make install). Next is ogg/vorbis (configure;make;make install). Next is ALSA support (configure etc...). Next is the crucial one, AAC support via the faac library from www.audiocoding.com. This proved to be some hassle:
faac has a slightly non-std build in that ./bootstrap must be run before running configure. When I downloaded faac the bootstrap script has been DOSified so I had to say "dos2unix bootstrap bootstrap" to fix that. The configure script then started to produce the usual output but near the end fell over with:
.infig.status: error: cannot find input file:
This looked like another DOS-ism and indeed it is. configure.in and Makefile.am also need to be unDOSified but that's not all. I run the following script found on a faac WIKI:
#! /bin/bash
if [ -d $1 ]; then
for i in $1/*; do
./$0 $i
done
else
mv $1 tmp
cat tmp tr -d \\r >$1
rm tmp
fi
I then re-added execute permission (to every file for simplicity). Re-running configure still did not work so I re-ran bootstrap. This generated a configure script that ran to completion. The make then worked although there were several warnings about missing newlines at end of file. Clearly this release still has some rough edges.
Finally I was ready to try using scons to build xmm2. Then I found that xmms2 also depends on the command git-rev-parse. I tried to download and build git. Its tarball comes with a Makefile and just typing 'make' seemed to do the trick. One small suprise was that once the build finished, saying make install as root caused lots of other building to happen. However, finally, it did install but when I re-ran scons on xmms2 I still had problems. git installs to /root/bin so I tried running scons as root with /root/bin added to my PATH. The error I got was:
fatal: Not a git repository
scons seemed to blunder on and got several other later errors such as list index out of range. At this point I gave up for the night. If I return to this I will add notes as comments to this blog entry.
Saturday, July 01, 2006
External USB drives, Linux and Windoze
I recently bought a Maxtor 250GB external USB drive. This was to share files between my Linux and Windoze systems without having to worry about blowing away my linux installation if I decided to go with a new distro. There were several problems. First, the maxtor drives comes preformatted as NTFS so by default it can only be read on Linux. That was no good for me. I needed to reformat it as FAT32 but this proved to be much harder than you might think.
I blanked out using the disk using dd so start completely from scratch.
Windoze 2000 and Windows XP do not seem to recognise completely blank disks. The option to partition them is greyed out. Third party tools such as Partition Magic also seem to have the same problem. I tried to set the disk up under Linux using fdisk. This was very problematic but I did eventually get it to work. Here's what happened:
using fdisk to set the partition to FAT32 (type = 'c') did not seem to do the trick. The next time I went into fdisk it claimed the partition table was empty. Eventually I came across some info that said the mkdosfs command has to be used and there is where I found a very nasty gotcha. Unlike most unix commands the mkdosfs command takes the options AFTER the device filename. If you put the options first as I did then the command claims to be working and sits there for ages as if it is working, but it does not produce any output. When it eventually finishes you think it has done the job but actually it has done nothing. Trying to mount the partition gives errors because the disk is still empty (you get various errors that basically indicate it could not find what it wanted from the superblock). The command that I used that does give the right results is:
mkdosfs /dev/sdb -c -F 32 -I -v
The command I was using was mkdosfs -F 32 -I -v /dev/sdb.
When the command does work it takes a very long time but you can see it is working because it comes up with a long list of during the bad block search.
Another gotcha to be aware of is to avoid having the disk mounted during boot time. This is because because large partitions can cause problems for certain boot loaders.
Sunday, March 12, 2006
Setting up MySQL
This blog entry describes my attempts to set up mySQL on my Linux machine.
First, download the source tarball from http://dev.mysql/downloads. Uncompress and de-tar. It is built in the standard way, i.e. configure; make; make install. There are quite a few dependencies etc so it takes a while for the configure to run. There are loads of files to compile to it takes quite a while to make.
Movie file formats
Movie clips in AVI form tend be unplayable in DVD players even when the play has been multi-regioned. So there needs to be a way to convert these files to MPGs. Googling for AVI to MPG converters gives loads of hits but these hits turn out to be mostly dead-ends. This blog entry is about my discoveries into getting a working AVI to MPG converter.
The hits from google tend to be references to shareware for Windoze. I tried one of these in desperation and although it initially seemed to work I later realised that the MPG was truncated to the first hour of the film. It also took AGES to run (I left it converting overnight). I looked for open source solutions and these seem to be very thin on the ground. I came across ffmpeg (http://www.ffmeg.org) but the last official source release fails to compile with the latest GNU compiler. The latest CVS snapshot also did not work properly when I ran it on Linux. It consumed more and more memory and CPU until eventually all the machine was doing was swapping. I then tried building the last official release on cygwin and amazingly, this works! Not only does it work but the command is quite quick as well. To convert fred.avi to fred.mpg the command to use is:
ffmpeg -i fred.avi -target vcd fred.mpg
Wednesday, January 04, 2006
Interesting s/w: gramps
gramps
gramps is a program for displaying and editing genealogical information in the standard GEDCOM file format. Julian Cohen gave me the GEDCOM file for Brenda's family tree and I tried to build gramps so I could display it. There are some teething troubles building gramps which I document in this blog.
gramps requires very recent versions of gconf and gnome-python. A little gotcha which is not at all obvious is that gnome-python also requires a very recent version of pyorbit otherwise gnome.ui will not be built. When this happens, the grams configure says that gnome-python is not there even when it is! So here is what you have to do:
install gconf (I used version 2.12.1)
install python (2.4.2)
install pygtk (2.8.2)
install pyorbit (2.13.1)
install gnome-python (2.12.3)
Now a configure && make && make install for gramps should work.
Tuesday, October 11, 2005
Sunday, August 21, 2005
This is my very first blog posting
This is my first first trip into the world of Blogging. I created this blog using www.blogger.com. The setup was very very easy. Then I created this entry just to see what would happen.
Subscribe to:
Posts (Atom)