Skip to content

Instantly share code, notes, and snippets.

@josephwb
Last active November 20, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephwb/7c274949803110170262332c4d2722c9 to your computer and use it in GitHub Desktop.
Save josephwb/7c274949803110170262332c4d2722c9 to your computer and use it in GitHub Desktop.
Simple makefile to compile BayesTraitsv3
## Simple makefile to compile BayesTraitsv3 ##
#
# Program info:
# BayesTraits V3.0 (Mar 14 2017)
# Mark Pagel and Andrew Meade
# www.evolution.reading.ac.uk
#
# source: http://www.evolution.rdg.ac.uk/BayesTraitsV3/BayesTraitsV3.html
#
# By default, compiles serial version. To compile threaded version, do:
#
# make threaded
CC = gcc
# *lots* of warnings, so turning off -Wall
#CFLAGS = -O3 -Wall
CFLAGS = -O3
LFLAGS = -lm -lgsl -lgslcblas -lnlopt -llapack
threaded: CFLAGS += -fopenmp -DOPENMP_THR
.PHONY: default all serial threaded clean
default: serial
all: default
OBJS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
serial: $(OBJS)
$(CC) $(OBJS) -Wall $(LFLAGS) -o BayesTraitsv3_serial
threaded: $(OBJS)
$(CC) $(OBJS) -Wall $(LFLAGS) -DOPENMP_THR -fopenmp -o BayesTraitsv3_threaded
clean:
rm -f *.o BayesTraitsv3_*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment