From cec6c09b63754e20aff056459be92e7e6dc435af Mon Sep 17 00:00:00 2001 From: Chi Zhang Date: Mon, 6 Apr 2015 14:38:18 +0000 Subject: [PATCH] apply patch for configure --prefix option --- src/Makefile.in | 17 ++++++++++------- src/utils.c | 16 ++++++++-------- src/utils.h | 1 - 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index c1d08325..5a9e4042 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,10 +1,12 @@ -srcdir = @srcdir@ -RM = rm -CC = @CC@ -CFLAGS = @CFLAGS@ -DUSECONFIG_H -LDFLAGS = @LDFLAGS@ -lm -INSTALL = @INSTALL@ -BINDIR = /usr/local/bin +SRCDIR = @srcdir@ +RM = rm +CC = @CC@ +CFLAGS = @CFLAGS@ -DUSECONFIG_H +LDFLAGS = @LDFLAGS@ -lm +INSTALL = @INSTALL@ +prefix ?= @prefix@ +exec_prefix ?= @exec_prefix@ +BINDIR ?= @bindir@ SRC = bayes.c command.c model.c mcmc.c likelihood.c proposal.c sumpt.c utils.c mbbeagle.c best.c OBJECTS = bayes.o command.o model.o mcmc.o likelihood.o proposal.o sumpt.o utils.o mbbeagle.o best.o @@ -16,6 +18,7 @@ mb: $(OBJECTS) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) install: $(PROGS) + mkdir -p $(BINDIR) $(INSTALL) -m 755 $(PROGS) $(BINDIR) clean: diff --git a/src/utils.c b/src/utils.c index 63937865..071ffae9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -12622,7 +12622,7 @@ MrBFlt LnPriorProbLognormal (MrBFlt val, MrBFlt *params) z = (log(val) - params[0]) / params[1]; - return -log(params[1] * val * sqrt(2.0 * PI)) - z * z / 2.0; + return - log(params[1] * val * sqrt(2.0 * PI)) - z * z / 2.0; } @@ -12636,7 +12636,7 @@ MrBFlt LnPriorProbLognormal_Param_Mean_Sd (MrBFlt val, MrBFlt *params) z= (log(val) - mean_log) / sd_log; - return -log(sd_log * val * sqrt(2.0 * PI)) - z * z / 2.0; + return - log(sd_log * val * sqrt(2.0 * PI)) - z * z / 2.0; } @@ -12647,7 +12647,7 @@ MrBFlt LnPriorProbNormal (MrBFlt val, MrBFlt *params) z = (val - params[0]) / params[1]; - return -log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0; + return - log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0; } @@ -12710,7 +12710,7 @@ MrBFlt LnPriorProbOffsetLognormal (MrBFlt val, MrBFlt *params) z = (log(x) - mean_log) / sd_log; - return -log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0; + return - log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0; } @@ -12727,7 +12727,7 @@ MrBFlt LnPriorProbOffsetLognormal_Param_Offset_Mean_Sd (MrBFlt val, MrBFlt *para z = (log(x) - mean_log) / sd_log; - return -log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0; + return - log(sd_log * x * sqrt(2.0 * PI)) - z * z / 2.0; } @@ -12741,7 +12741,7 @@ MrBFlt LnPriorProbTruncatedNormal (MrBFlt val, MrBFlt *params) z_0 = (0.0 - params[0]) / params[1]; normConst = CdfNormal(z_0); - return -log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst); + return - log(params[1] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst); } @@ -12755,14 +12755,14 @@ MrBFlt LnPriorProbTruncatedNormal_Param_Trunc_Mean_Sd (MrBFlt val, MrBFlt *param z_trunc = (params[0] - params[1]) / params[2]; normConst = CdfNormal(z_trunc); - return -log(params[2] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst); + return - log(params[2] * sqrt(2.0 * PI)) - z * z / 2.0 - log(normConst); } /* Calculate probability of a realization for uniform random variable */ MrBFlt LnPriorProbUniform (MrBFlt val, MrBFlt *params) { - return -log(params[1] - params[0]); + return - log(params[1] - params[0]); MrBayesPrint ("%lf", val); /* just because I am tired of seeing the unused parameter error msg */ } diff --git a/src/utils.h b/src/utils.h index e8fda800..d7a1dfe4 100644 --- a/src/utils.h +++ b/src/utils.h @@ -7,7 +7,6 @@ struct complex MrBFlt re; MrBFlt im; }; - typedef struct complex complex; typedef struct