Compiling frealign v8.09_110505, the MacOS X-Linux edition.

Frealign can be downloaded as a *.tar.gz file. There are several 8.09 version but the LATEST is labeled as such and it is easy to spot.

Upon download and decompress you should have a frealign_v8.09 directory. The very obvious README file there contains the version history as well as instructions on how to use frealign. You should also have a bin, examples and src directories. If you are running linux at 64 bits you might be in luck and can run this executables. If not, well, read on..

Let’s dive into the src (short for source) directory (you can do this via Finder or command line) and you will find a series of Makefile_* with instructions for compiling frealign for a range of platforms and configurations ranging from OS X in G5 to SGI.

Since I am running Mac OS X 10.6.8 and have the intel compilers installed I am immediately drawn to the file named Makefile_OSX_86-64_intel.

To get frealign compiled all I have to do now is go to the src folder in the command-line and then type:

make -f Makefile_OSX_86-64_intel

and Boom now there are two new files in /bin: frealign_v8.exe and set_polarity.exe and both run in Mac OS X!

NB If you want a fancier binary try flags such as -openmp and others.

In case you don’t have the Intel compilers you can just use this Makefile I created by modifying the one provided for G5_OSX:

#
# ------ MAKEFILE FILE FOR Linux FREALIGN -----------
#
# Using: gnu compiler
#
# Thanks to: Shixin Yang & Dr Edward Egelman at University of Virginia
# for providing this file
#
# Notes: To create executable: make -f Makefile_G5_OSX_gnu
#

SHELL = /bin/sh

FFLAGS = -c -O3 -fno-second-underscore -w

CFLAGS = -c -O3 -DPROTOTYPE -Dpowerpc -w

COMP = gfortran

CC = gcc

LF = #-no-c++filt

PGM = frealign_v8

LIB = $(PGM).a

.PRECIOUS : $(PGM) $(LIB)

include Makefile.inc

$(PGM) : $(PGM).o $(LIB)
@echo linking $(PGM)
$(COMP) $(LF) $(PGM).o $(LIB) /usr/lib/libSystemStubs.a -o ../bin/$(PGM).exe
@\rm $(PGM).o

$(PGM).o : $(PGM).f
$(COMP) $(FFLAGS) -o $(PGM).o $(PGM).f
$(COMP) -o ../bin/set_polarity.exe set_polarity.f

ioc.o : ioc.c
$(CC) $(CFLAGS) -o ioc.o ioc.c
$(AR) r $(LIB) ioc.o
@\rm ioc.o

$(LIB) : ioc.o $(ELEMENTS)
@echo all object files placed in library

.f.a:
$(COMP) $(FFLAGS) $<
$(AR) r $(LIB) $*.o
@\rm $*.o


That’s it. I think that these instructions should be compatible with most Linux installations. Try it!

Comments

Popular Posts