From 93f42ee115245cb7515267cd3a0b3aa054c04f00 Mon Sep 17 00:00:00 2001 From: "Jason W. Bacon" Date: Tue, 14 Jan 2020 22:35:36 +0000 Subject: [PATCH] biology/gemma: Unbreak build Conflict between cblas.h and gsl_cblas.h --- biology/gemma/Makefile | 12 ++++------ biology/gemma/files/Makefile | 2 +- biology/gemma/files/patch-src_fastopenblas.h | 15 ++++++++++++ biology/gemma/files/patch-src_gemma.cpp | 24 +++++++++++++++++++- 4 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 biology/gemma/files/patch-src_fastopenblas.h diff --git a/biology/gemma/Makefile b/biology/gemma/Makefile index ada67a32f052..6dec370bd0fc 100644 --- a/biology/gemma/Makefile +++ b/biology/gemma/Makefile @@ -2,7 +2,7 @@ PORTNAME= gemma DISTVERSION= 0.98.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= biology MAINTAINER= jwb@FreeBSD.org @@ -11,8 +11,7 @@ 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 @@ -21,13 +20,12 @@ 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 diff --git a/biology/gemma/files/Makefile b/biology/gemma/files/Makefile index e70996bcde6c..56519ee79dc0 100644 --- a/biology/gemma/files/Makefile +++ b/biology/gemma/files/Makefile @@ -1,7 +1,7 @@ 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 diff --git a/biology/gemma/files/patch-src_fastopenblas.h b/biology/gemma/files/patch-src_fastopenblas.h new file mode 100644 index 000000000000..32d2c4b1b94c --- /dev/null +++ b/biology/gemma/files/patch-src_fastopenblas.h @@ -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, diff --git a/biology/gemma/files/patch-src_gemma.cpp b/biology/gemma/files/patch-src_gemma.cpp index 09272489a8be..ce4f026b7f26 100644 --- a/biology/gemma/files/patch-src_gemma.cpp +++ b/biology/gemma/files/patch-src_gemma.cpp @@ -1,5 +1,18 @@ ---- 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) { @@ -164,3 +177,12 @@ << 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