A blog about my experiences with bioinformatics, operating systems, and random other technologies and bits.

Saturday, August 4, 2007

Update 08/03/07

I've been doing a fair amount of coding lately, I don't feel like going in to details just yet. One project is CthughaNix, the resurrection of a great music visualization tool. Speaking of bring back things from the past, I started reading The Wheel of Time saga again, since there's only the last book left to be written. This was most likely a bad decision on my part as it is hard for me to put a book down and I'm fairly busy right now. The other project is work related – it is intended to be parametric alignment software eventually, but right now I'm finalizing regular global alignment and integrating it with EMBOSS.


Here's a SS of Cthughanix running in Solaris, but screen shots don't really do it justice:




Tuesday, July 3, 2007

GMP 4.2.1 on OS X 10.3.9

You don't want the same company that makes the iPhone to make your enterprise servers. Regardless, it seems I'm stuck with using a small OS X 10.3.9 cluster. We can't upgrade easily (I won't get in to the reasons, though some of them are partly Apple's fault of course), but suffice to say that despite having such a nice machine, we are stuck in the 32 bit land of the not so ancient OS X 10.3 and can't even get things like Java JDK 1.5 or 1.6 (an added incentive to upgrade to OS X 10.4 from Apple...).

At any rate, if you also have these problems (unlikely, but I know some of you are out there), here are the options I used to build GMP 4.2.1 with GCC 4.2.0 (prerelease):

CFLAGS and CXXFLAGS: -O3 -m32 -mcpu=7450 -mpowerpc -maltivec

make distclean && ./configure --enable-cxx ABI=32 && make && make check

Monday, July 2, 2007

Sun Consumer Products

Open Solaris isn't perfect for the end user yet, but it has a lot of potential. I'd like to show my support to Sun by buying something from them. There's the media kit, but even though I'm just wanting to show my support I think media kits are kind of useless since Open Solaris is updated so frequently. Star Office appears to be free with Open Solaris, so no need to buy that either. The one thing I found that appeared to be useful and affordable was a plugin for Open Office or Star Office that gives you bogging functionality within the office application. This isn't much, but it is only $10.00 and it is something I can use regularly.


What I'd really like to see is an Open Solaris User membership. Members could vote for new value added features and get some minimal amount of tech support. The tech support is secondary to me however, voting is what Open Solaris needs. I don't know of any commercially driven OS that has such a support option (then again, I'm not keen on every Linux or BSD distribution and I don't get paid to blog). I got the idea from Transgaming's Cedega. Transgaming holds a monthly poll for its subscribers, and subscribers get to cast as many votes as they have subscriptions. To me this seems like a great way to run a software business, and it would be great if someone employed the model for an operating system. I hope that someone will be Sun, though admittedly my hopes aren't high.


Saturday, June 30, 2007

The "simple" way to do things.

Who wants to make play lists or keep an alarm clock when you have your laptop with you 23/24 hours each day?

Say I want to find all the songs with bach or mozart in the title and loop through them. This (somewhat long) one-liner will do the trick:

echo `find ./ -name '*[B|b]ach*' -o -name '*[M|m]ozart*' | xargs -I song echo "'song'"` | xargs mplayer -loop 0

(substitute mplayer with your favorite command line music player) There is probably a shorter way of accomplishing the same thing. If you find such a way, please post it!


Setting an alarm is much simpler. If you want to get up in 8 hours,

bash-3.00$ bc
8*3600
28800
quit
bash-3.00$ sleep 28800 && mplayer Shared/George\ Michael\ wham\ -\ wake_me_up_before_you_go_go.mp4

If you have a more regular sleep schedule (but then, why would you be reading this?) you may find setting up a cron job to play a song more useful.

Tuesday, June 19, 2007

Useful Solaris tips for Linux Users

Since I'm coming from Linux, I thought it would be useful to start a long entry about Solaris tips for Linux users. I'll update this entry with new tips as I find them.

ldconfig and ld.so.conf solaris equivalents (taken from the blog of Chris Miles):

If you're a Linux admin on Solaris and are looking for the Solaris equivalent of ldconfig and /etc/ld.so.conf read on.

The command you are looking for is crle(1) - this is the equivalent of Linux's ldconfig but even more powerful. Read the man pages to crle for all the details. But here's a quick howto - how to add /usr/local/lib to the default ls.so.1 path. Run crle with no arguments to see the default paths.
mad[~] crle

Default configuration file (/var/ld/ld.config) not found
Default Library Path (ELF): /lib:/usr/lib (system default)
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
Use crle -u -l /usr/local/lib to add /usr/local/lib to the default ld.so.1 path.
mad[~] sudo crle -u -l /usr/local/lib
Password:
mad[~] crle

Configuration file [version 4]: /var/ld/ld.config
Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)

Command line:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib
And that's it really. The configuration is stored in /var/ld/ld.config but crle should always be used to manipulate it. Hope that is useful.

08/11/07
prstat can be used instead of top, and is supposedly more robust.

Monday, June 18, 2007

Building GCC on Solaris

Update: On OpenSolaris 2008.11 I used the following (after having intalled gcc packages from blastwave):

../gcc-4.3.2/configure --with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,objc,fortran --with-mpfr=/opt/csw --with-gmp=/opt/csw --with-libiconv-prefix=/opt/csw --prefix=/usr/local && gmake -j4


I got a new laptop (my old one was 2 1/2 years old, huge, and prone to overheating - but other than that still not a bad machine). The new laptop is a Dell Inspiron E1505N, shipped with Ubuntu. I removed Ubuntu immediately as my experiences have never been good with it. Vista was installed and removed the next day as well. I'm now happily running (for the most part) Windows XP 64 edition and Solaris Developer edition on the machine. Perhaps a full review of Solaris will be in order later, but for now, I wanted to show how to build GCC 4.2.0 on Solaris.

It is rather simple once you know the tricks.... I leave it to the reader to deduce why all this works, as much of it was just trial and error. Note: I never got gcj to work and I didn't bother with ada. There were several bugs in boehm-gc with which I ran out of patience. Please let me know if you have better success =) I'm new to Solaris still; I've primarily been a user of Linux for the past few years.

Here is the path that was used to build GCC:
bash-3.00$ echo $PATH
/usr/ccs/bin/amd64:/usr/ccs/bin:/opt/csw/gcc4/bin:/usr/local/bin:/opt/csw/bin:/usr/bin:/usr/openwin/bin:/usr/ucb

export LD_LIBRARY_PATH=/opt/csw/lib
(make sure you have mpfr and gmp installed - I installed the packages from blastwave)

And the command to build:
../gcc-4.2.0/configure --with-as=/opt/csw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-threads=posix --enable-multilib --enable-nls --with-included-gettext --with-system-zlib --with-mpfr=/opt/csw --with-gmp=/opt/csw --enable-languages=c,c++,objc,fortran --enable-shared --with-libiconv-prefix=/opt/csw && gmake -j 4


The result:

bash-3.00$ gcc -v
Reading specs from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/specs
Target: i386-pc-solaris2.8
Configured with: ../sources/gcc-4.0.2/configure --prefix=/opt/csw/gcc4 --with-local-prefix=/opt/csw --with-gnu-as --with-as=/opt/csw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix --enable-shared --enable-multilib --enable-nls --with-included-gettext --with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib --with-system-zlib --enable-languages=c,c++,f95,java,objc,ada
Thread model: posix
gcc version 4.0.2