Tuesday, March 9, 2010

Compile and Install Star (CentOS 5.4)

Star is 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) in FORTRAN. From what I can tell it is not actively maintained and can be difficult to get compiled and installed correctly if you have never done it before. The following is the result of several nights of research with trial and error to get Star to compile and install properly on CentOS 5.4.

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 CentOS 5.4, be sure to also install libXp:

yum -y install libXp
These instructions are for a basic install of CentOS 5.4 where yum -y update has been run. The only box checked for the installation is the "Gnome Desktop." The instructions are written assuming you are logged in as the root user.

Also note: SELinux is disabled

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

yum -y install gcc libX11-devel

Mongo

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

# 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.

mkdir -p /usr/local/mongo &&
cp Fonts /usr/local/mongo &&
make realclean && make;

Install mongo and friends on the system:

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

Help Library

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

pushd helpdir && make && popd

HPGL Converter

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

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

Star

Unpack the source in /usr/local/:

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:

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

# Export the path to star for everyone
export PATH="$PATH:/usr/local/star"
Hopefully some astronomers out there will find this useful.

0 comments:

Post a Comment