Tuesday, March 9, 2010

Compile and Install Star II (Ubuntu 8.04.4 LTS)

This is my second post about Star, a package of astronomy software for variable star research that some of my colleges use for their work. It was programmed by an astronomer at South African Astronomical Observatory (SAAO). My first post was how to get it compiled and running on CentOS 5.4. This post will show how to do it in Ubuntu 8.04.4 LTS.

I compilied Star using the Absoft (v8, 32-bit) Compiler. It's an older version of Absoft, but this is an old program. Follow the instructions as given with the software to install.

Be sure to download and install the patches (libfio in particular) or there will be epic FAIL.

To install the compiler on Ubuntu 8.04.4 LTS, be sure to also install libxp-devel:

sudo aptitude install libxp-dev
These instructions are for a basic install of Ubuntu 8.04 that has had sudo aptitude dist-upgrade run, hence it is version 8.04.4. The instructions are written assuming you are a sudo user.

To get builds to work for both Mongo and STAR, install the needed software:

sudo aptitude install build-essential
Ubuntu likes to reset environment variables for sudo commands. The fix to compile? Alias the sudo command so it will know enough about the environment to compile and install:

alias sudo='sudo env PATH=$PATH MONGODIR=$MONGODIR ABSOFT=$ABSOFT'

Mongo

We need to set an environment variable for everyone. Add the mongo directory in /etc/bash.bashrc:

# Export the path to mongo for everyone
export MONGODIR=/usr/local/mongo;
Log out and back in for the environment variable to take affect.

Unpack the source:

tar -zxvf mongo.tar.gz && cd mongo

Mongo and Friends

Edit the Makefile. Change:
$(FNTFILE):
mkfont
To:
$(FNTFILE):
./mkfont
Note: Makefile.absoft is older than Makefile. Use Makefile

Complile the FORTRAN subroutines, create the library libmongo.a, create the X-windows driver STARplot and create the font file Font.bin.

sudo mkdir -p /usr/local/mongo &&
sudo cp Fonts /usr/local/mongo &&
make realclean && sudo make;
Install mongo and friends on the system:

sudo mkdir -p /usr/local/man/man2 &&
sudo make install

Help Library

This needs to be compiled and installed, the make command does both.

pushd helpdir && sudo make && popd;

HPGL Converter

This needs to be compiled and installed, the make all command does both.

sudo mkdir -p /usr/local/man/man1 &&
pushd hp2xx314/sources &&
make realclean &&
sudo make all &&
sudo make install-bin &&
sudo make install-man &&
popd;

STAR

Unpack the source in /usr/local/:

sudo tar -zxvf src.tar.gz -C /usr/local/ && cd /usr/local/star
Note: Makefile.absoft is older than Makefile. Use Makefile

Edit the Makefile. There is an instruction missing after the spectrunc instruction, add:

spectrund: spectrund.f
$(FC) $(FFLAGS) $@.f -o $@ $(LIBS)
Note: Be sure it is a tab and not 8 spaces in front of $(FC)

Compile STAR:

sudo make realclean && sudo make;
We want to give everyone access to the STAR binaries. Add the star directory to $PATH in /etc/bash.bashrc:

# Export the path to star for everyone
PATH="$PATH:/usr/local/star"; export PATH;

0 comments:

Post a Comment