Index: head/biology/gemma/Makefile =================================================================== --- head/biology/gemma/Makefile (revision 523073) +++ head/biology/gemma/Makefile (revision 523074) @@ -1,41 +1,39 @@ # $FreeBSD$ PORTNAME= gemma DISTVERSION= 0.98.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= biology MAINTAINER= jwb@FreeBSD.org COMMENT= Genome-wide Efficient Mixed Model Association LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE -LIB_DEPENDS= libcblas.so:math/cblas \ - libgsl.so:math/gsl +LIB_DEPENDS= libgsl.so:math/gsl USES= blaslapack:openblas compiler:c++11-lang eigen:3 gmake \ localbase:ldflags USE_GITHUB= yes GH_ACCOUNT= genetics-statistics GH_PROJECT= GEMMA MAKEFILE= ${FILESDIR}/Makefile -CXXFLAGS+= -I${LOCALBASE}/include/eigen3 -DOPENBLAS -DOPENBLAS_LEGACY -LDFLAGS+= -lopenblas +# Assuming openblas is built with pthreads, not openmp +CXXFLAGS+= -I${LOCALBASE}/include/eigen3 -DOPENBLAS -pthread +LDFLAGS+= -lopenblasp -pthread OPTIONS_DEFINE= EXAMPLES - -BROKEN= Conflict between math/gsl and math/cblas constant redeclarations pre-configure: @${REINPLACE_CMD} -e 's|../bin/gemma|../gemma|' ${WRKSRC}/test/*.sh do-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} (cd ${WRKSRC}/example && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) do-test: (cd ${WRKSRC}/test && ${SH} test_suite.sh) .include Index: head/biology/gemma/files/Makefile =================================================================== --- head/biology/gemma/files/Makefile (revision 523073) +++ head/biology/gemma/files/Makefile (revision 523074) @@ -1,68 +1,68 @@ GEMMA_VERSION = $(shell cat ./VERSION) VGEN = scripts/gen_version_info.sh -CXXFLAGS += -DHAVE_INLINE -pthread -Wall -std=gnu++11 +CXXFLAGS += -DHAVE_INLINE -Wall -std=gnu++11 CXXFLAGS += -DNDEBUG -Icontrib/catch-1.9.7 -Isrc SRC_DIR = ./src TEST_SRC_DIR = ./test/src DESTDIR ?= . PREFIX ?= /usr/local MKDIR ?= mkdir INSTALL ?= install BIN = gemma HDR = $(wildcard src/*.h) ./src/version.h SOURCES = $(wildcard src/*.cpp) OBJS = $(SOURCES:.cpp=.o) LDFLAGS += -lgsl -lz .PHONY: all test all: $(BIN) ./src/version.h: ./VERSION $(shell bash $(VGEN) $(GUIX_PROFILE) > src/version.h) $(BIN): $(OBJS) $(CXX) $(CXXFLAGS) -o $(BIN) $(OBJS) $(LDFLAGS) $(OBJS): $(HDR) install: all $(MKDIR) -p $(DESTDIR)$(PREFIX)/bin $(INSTALL) -s -c $(BIN) $(DESTDIR)$(PREFIX)/bin .SUFFIXES : .cpp .c .o $(SUFFIXES) ./bin/unittests-gemma: contrib/catch-1.9.7/catch.hpp $(TEST_SRC_DIR)/unittests-main.o $(TEST_SRC_DIR)/unittests-math.o $(OBJS) $(CXX) $(CXXFLAGS) $(TEST_SRC_DIR)/unittests-main.o $(TEST_SRC_DIR)/unittests-math.o $(filter-out src/main.o, $(OBJS)) $(LIBS) -o ./bin/unittests-gemma unittests: all ./bin/unittests-gemma ./bin/unittests-gemma fast-check: all unittests rm -vf test/output/* cd test && ./dev_test_suite.sh | tee ../dev_test.log grep -q 'success rate: 100%' dev_test.log slow-check: all rm -vf test/output/* cd test && ./test_suite.sh | tee ../test.log grep -q 'success rate: 100%' test.log lengthy-check: all rm -vf test/output/* cd test && ./lengthy_test_suite.sh | tee ../lengthy_test.log grep -q 'success rate: 100%' lengthy_test.log check: fast-check slow-check check-all: check lengthy-check clean: rm -vf $(SRC_DIR)/*.o rm -vf $(SRC_DIR)/*~ rm -vf $(TEST_SRC_DIR)/*.o rm -vf $(BIN) rm -vf ./bin/unittests-gemma Index: head/biology/gemma/files/patch-src_fastopenblas.h =================================================================== --- head/biology/gemma/files/patch-src_fastopenblas.h (nonexistent) +++ head/biology/gemma/files/patch-src_fastopenblas.h (revision 523074) @@ -0,0 +1,15 @@ +--- src/fastopenblas.h.orig 2018-12-11 05:34:29 UTC ++++ src/fastopenblas.h +@@ -23,10 +23,12 @@ + + #include + #include ++/* Conflicts with gsl_cblas.h, included from gsl_matrix.h + extern "C" + { + #include // For OpenBlas / Atlas + } ++*/ + #include "gsl/gsl_matrix.h" + + void fast_cblas_dgemm(const enum CBLAS_ORDER Order, Property changes on: head/biology/gemma/files/patch-src_fastopenblas.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/biology/gemma/files/patch-src_gemma.cpp =================================================================== --- head/biology/gemma/files/patch-src_gemma.cpp (revision 523073) +++ head/biology/gemma/files/patch-src_gemma.cpp (revision 523074) @@ -1,166 +1,188 @@ ---- src/gemma.cpp.orig 2019-04-18 21:03:48 UTC +--- src/gemma.cpp.orig 2018-12-11 05:34:29 UTC +++ src/gemma.cpp +@@ -75,9 +75,9 @@ void gemma_gsl_error_handler (const char * reason, + std::raise(SIGINT); // keep the stack trace for gdb + } + +-#if defined(OPENBLAS) && !defined(OPENBLAS_LEGACY) +-#include +-#endif ++//#if defined(OPENBLAS) && !defined(OPENBLAS_LEGACY) ++//#include ++//#endif + + void GEMMA::PrintHeader(void) { + @@ -154,7 +154,7 @@ void GEMMA::PrintHelp(size_t option) { if (option == 0) { cout << endl; - cout << " type ./gemma -h [num] for detailed help" << endl; + cout << " type gemma -h [num] for detailed help" << endl; cout << " options: " << endl; cout << " 1: quick guide" << endl; cout << " 2: file I/O related" << endl; @@ -176,116 +176,116 @@ void GEMMA::PrintHelp(size_t option) { if (option == 1) { cout << " QUICK GUIDE" << endl; cout << " to generate a relatedness matrix: " << endl; - cout << " ./gemma -bfile [prefix] -gk [num] -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -gk [num] -o [prefix]" + cout << " gemma -bfile [prefix] -gk [num] -o [prefix]" << endl; + cout << " gemma -g [filename] -p [filename] -gk [num] -o [prefix]" << endl; cout << " to generate the S matrix: " << endl; - cout << " ./gemma -bfile [prefix] -gs -o [prefix]" << endl; - cout << " ./gemma -p [filename] -g [filename] -gs -o [prefix]" + cout << " gemma -bfile [prefix] -gs -o [prefix]" << endl; + cout << " gemma -p [filename] -g [filename] -gs -o [prefix]" << endl; - cout << " ./gemma -bfile [prefix] -cat [filename] -gs -o [prefix]" + cout << " gemma -bfile [prefix] -cat [filename] -gs -o [prefix]" << endl; - cout << " ./gemma -p [filename] -g [filename] -cat [filename] -gs " + cout << " gemma -p [filename] -g [filename] -cat [filename] -gs " "-o [prefix]" << endl; - cout << " ./gemma -bfile [prefix] -sample [num] -gs -o [prefix]" + cout << " gemma -bfile [prefix] -sample [num] -gs -o [prefix]" << endl; - cout << " ./gemma -p [filename] -g [filename] -sample [num] -gs -o " + cout << " gemma -p [filename] -g [filename] -sample [num] -gs -o " "[prefix]" << endl; cout << " to generate the q vector: " << endl; - cout << " ./gemma -beta [filename] -gq -o [prefix]" << endl; - cout << " ./gemma -beta [filename] -cat [filename] -gq -o [prefix]" + cout << " gemma -beta [filename] -gq -o [prefix]" << endl; + cout << " gemma -beta [filename] -cat [filename] -gq -o [prefix]" << endl; cout << " to generate the ldsc weigthts: " << endl; - cout << " ./gemma -beta [filename] -gw -o [prefix]" << endl; - cout << " ./gemma -beta [filename] -cat [filename] -gw -o [prefix]" + cout << " gemma -beta [filename] -gw -o [prefix]" << endl; + cout << " gemma -beta [filename] -cat [filename] -gw -o [prefix]" << endl; cout << " to perform eigen decomposition of the relatedness matrix: " << endl; - cout << " ./gemma -bfile [prefix] -k [filename] -eigen -o [prefix]" + cout << " gemma -bfile [prefix] -k [filename] -eigen -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -k [filename] -eigen " + cout << " gemma -g [filename] -p [filename] -k [filename] -eigen " "-o [prefix]" << endl; cout << " to estimate variance components: " << endl; - cout << " ./gemma -bfile [prefix] -k [filename] -vc [num] -o " + cout << " gemma -bfile [prefix] -k [filename] -vc [num] -o " "[prefix]" << endl; - cout << " ./gemma -p [filename] -k [filename] -vc [num] -o [prefix]" + cout << " gemma -p [filename] -k [filename] -vc [num] -o [prefix]" << endl; - cout << " ./gemma -bfile [prefix] -mk [filename] -vc [num] -o " + cout << " gemma -bfile [prefix] -mk [filename] -vc [num] -o " "[prefix]" << endl; cout - << " ./gemma -p [filename] -mk [filename] -vc [num] -o [prefix]" - << endl; - cout << " ./gemma -beta [filename] -cor [filename] -vc [num] -o " + << " gemma -p [filename] -mk [filename] -vc [num] -o [prefix]" + << endl; + cout << " gemma -beta [filename] -cor [filename] -vc [num] -o " "[prefix]" << endl; - cout << " ./gemma -beta [filename] -cor [filename] -cat [filename] " + cout << " gemma -beta [filename] -cor [filename] -cat [filename] " "-vc [num] -o [prefix]" << endl; cout << " options for the above two commands: -crt -windowbp [num]" << endl; - cout << " ./gemma -mq [filename] -ms [filename] -mv [filename] -vc " + cout << " gemma -mq [filename] -ms [filename] -mv [filename] -vc " "[num] -o [prefix]" << endl; cout << " or with summary statistics, replace bfile with mbfile, " "or g or mg; vc=1 for HE weights and vc=2 for LDSC weights" << endl; - cout << " ./gemma -beta [filename] -bfile [filename] -cat " + cout << " gemma -beta [filename] -bfile [filename] -cat " "[filename] -wsnp [filename] -wcat [filename] -vc [num] -o [prefix]" << endl; - cout << " ./gemma -beta [filename] -bfile [filename] -cat " + cout << " gemma -beta [filename] -bfile [filename] -cat " "[filename] -wsnp [filename] -wcat [filename] -ci [num] -o [prefix]" << endl; cout << " to fit a linear mixed model: " << endl; - cout << " ./gemma -bfile [prefix] -k [filename] -lmm [num] -o " + cout << " gemma -bfile [prefix] -k [filename] -lmm [num] -o " "[prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -a [filename] -k " + cout << " gemma -g [filename] -p [filename] -a [filename] -k " "[filename] -lmm [num] -o [prefix]" << endl; cout << " to fit a linear mixed model to test g by e effects: " << endl; - cout << " ./gemma -bfile [prefix] -gxe [filename] -k [filename] " + cout << " gemma -bfile [prefix] -gxe [filename] -k [filename] " "-lmm [num] -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -a [filename] -gxe " + cout << " gemma -g [filename] -p [filename] -a [filename] -gxe " "[filename] -k [filename] -lmm [num] -o [prefix]" << endl; cout << " to fit a univariate linear mixed model with different residual " "weights for different individuals: " << endl; - cout << " ./gemma -bfile [prefix] -weight [filename] -k [filename] " + cout << " gemma -bfile [prefix] -weight [filename] -k [filename] " "-lmm [num] -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -a [filename] " + cout << " gemma -g [filename] -p [filename] -a [filename] " "-weight [filename] -k [filename] -lmm [num] -o [prefix]" << endl; cout << " to fit a multivariate linear mixed model: " << endl; - cout << " ./gemma -bfile [prefix] -k [filename] -lmm [num] -n " + cout << " gemma -bfile [prefix] -k [filename] -lmm [num] -n " "[pheno cols...] -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -a [filename] -k " + cout << " gemma -g [filename] -p [filename] -a [filename] -k " "[filename] -lmm [num] -n [pheno cols...] -o [prefix]" << endl; cout << " to fit a Bayesian sparse linear mixed model: " << endl; - cout << " ./gemma -bfile [prefix] -bslmm [num] -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -a [filename] -bslmm " + cout << " gemma -bfile [prefix] -bslmm [num] -o [prefix]" << endl; + cout << " gemma -g [filename] -p [filename] -a [filename] -bslmm " "[num] -o [prefix]" << endl; cout << " to obtain predicted values: " << endl; - cout << " ./gemma -bfile [prefix] -epm [filename] -emu [filename] " + cout << " gemma -bfile [prefix] -epm [filename] -emu [filename] " "-ebv [filename] -k [filename] -predict [num] -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -epm [filename] -emu " + cout << " gemma -g [filename] -p [filename] -epm [filename] -emu " "[filename] -ebv [filename] -k [filename] -predict [num] -o " "[prefix]" << endl; cout << " to calculate correlations between SNPs: " << endl; - cout << " ./gemma -bfile [prefix] -calccor -o [prefix]" << endl; - cout << " ./gemma -g [filename] -p [filename] -calccor -o [prefix]" + cout << " gemma -bfile [prefix] -calccor -o [prefix]" << endl; + cout << " gemma -g [filename] -p [filename] -calccor -o [prefix]" << endl; cout << endl; } +@@ -3148,7 +3148,7 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPa + #ifdef OPENBLAS + + #ifndef OPENBLAS_LEGACY +- outfile << "## OpenBlas =" << OPENBLAS_VERSION << " - " << openblas_get_config() << endl; ++ //outfile << "## OpenBlas =" << OPENBLAS_VERSION << " - " << openblas_get_config() << endl; + outfile << "## arch = " << openblas_get_corename() << endl; + outfile << "## threads = " << openblas_get_num_threads() << endl; + #else