From owner-svn-ports-all@freebsd.org Wed Apr 15 15:22:06 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBCEC2B9E69; Wed, 15 Apr 2020 15:22:06 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 492R0t4rNxz4016; Wed, 15 Apr 2020 15:22:06 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A183B210F4; Wed, 15 Apr 2020 15:22:06 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03FFM6Fo004949; Wed, 15 Apr 2020 15:22:06 GMT (envelope-from jwb@FreeBSD.org) Received: (from jwb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03FFM4r9004938; Wed, 15 Apr 2020 15:22:04 GMT (envelope-from jwb@FreeBSD.org) Message-Id: <202004151522.03FFM4r9004938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jwb set sender to jwb@FreeBSD.org using -f From: "Jason W. Bacon" Date: Wed, 15 Apr 2020 15:22:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r531770 - in head/biology: . gcta gcta/files X-SVN-Group: ports-head X-SVN-Commit-Author: jwb X-SVN-Commit-Paths: in head/biology: . gcta gcta/files X-SVN-Commit-Revision: 531770 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2020 15:22:06 -0000 Author: jwb Date: Wed Apr 15 15:22:04 2020 New Revision: 531770 URL: https://svnweb.freebsd.org/changeset/ports/531770 Log: biology/gcta: Genome-wide Complex Trait Analysis GCTA (Genome-wide Complex Trait Analysis) was originally designed to estimate the proportion of phenotypic variance explained by genome- or chromosome-wide SNPs for complex traits (the GREML method), and has subsequently extended for many other analyses to better understand the genetic architecture of complex traits. Added: head/biology/gcta/ head/biology/gcta/Makefile (contents, props changed) head/biology/gcta/distinfo (contents, props changed) head/biology/gcta/files/ head/biology/gcta/files/patch-Makefile (contents, props changed) head/biology/gcta/files/patch-eigen__func.h (contents, props changed) head/biology/gcta/files/patch-gcta.h (contents, props changed) head/biology/gcta/files/patch-ld.cpp (contents, props changed) head/biology/gcta/files/patch-mkl.cpp (contents, props changed) head/biology/gcta/pkg-descr (contents, props changed) Modified: head/biology/Makefile Modified: head/biology/Makefile ============================================================================== --- head/biology/Makefile Wed Apr 15 14:55:03 2020 (r531769) +++ head/biology/Makefile Wed Apr 15 15:22:04 2020 (r531770) @@ -43,6 +43,7 @@ SUBDIR += freebayes SUBDIR += garlic SUBDIR += gatk + SUBDIR += gcta SUBDIR += gemma SUBDIR += gff2ps SUBDIR += gmap Added: head/biology/gcta/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/Makefile Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +PORTNAME= gcta +DISTVERSION= 1.26.0 +CATEGORIES= biology +MASTER_SITES= https://cnsgenomics.com/software/gcta/pre_gcta/ +DISTNAME= ${PORTNAME}_${PORTVERSION}_src + +MAINTAINER= jwb@FreeBSD.org +COMMENT= Genome-wide Complex Trait Analysis + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/GNU_General_Public_License_v3.txt + +BUILD_DEPENDS= eigen>=3:math/eigen3 +LIB_DEPENDS+= libopenblas.so:math/openblas + +USES= compiler:openmp dos2unix gmake localbase zip + +CXXFLAGS+= -I${LOCALBASE}/include/eigen3 -fopenmp +LDFLAGS+= -lopenblas + +INSTALL_TARGET= install-strip +PLIST_FILES= bin/gcta + +.include + +.if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} <= 42 +USE_GCC= yes +.endif + +do-extract: + ${UNZIP_NATIVE_CMD} -d ${WRKSRC} ${DISTDIR}/${DISTFILES} + +.include Added: head/biology/gcta/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/distinfo Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,3 @@ +TIMESTAMP = 1489125670 +SHA256 (gcta_1.26.0_src.zip) = 554c48f421c93cbaf64b1c300ca507d8e7a56086b5c7d857227fbd4048f42acf +SIZE (gcta_1.26.0_src.zip) = 198045 Added: head/biology/gcta/files/patch-Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/files/patch-Makefile Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,59 @@ +--- Makefile.orig 2020-04-15 01:43:44 UTC ++++ Makefile +@@ -6,21 +6,27 @@ + # --------------------------------------------------------------------- + + # Directory of the target +-OUTPUT = gcta64 ++OUTPUT = gcta + + # Compiler +-CXX = g++ ++CXX ?= g++ + + # EIGEN library +-EIGEN_PATH = ../../../Lib/eigen ++EIGEN_PATH ?= ../../../Lib/eigen + + # Intel MKL library +-MKL_PATH = /opt/intel/mkl ++MKL_PATH ?= /opt/intel/mkl + + # Compiler flags +-CXXFLAGS = -w -O3 -m64 -static -fopenmp -I $(EIGEN_PATH) -DEIGEN_NO_DEBUG -I $(MKL_PATH)/include +-LIB += -static -lz -Wl,--start-group $(MKL_PATH)/lib/intel64/libmkl_intel_lp64.a $(MKL_PATH)/lib/intel64/libmkl_gnu_thread.a $(MKL_PATH)/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl ++CXXFLAGS ?= -w -O3 -m64 -static -fopenmp -I $(EIGEN_PATH) -DEIGEN_NO_DEBUG -I $(MKL_PATH)/include ++LDFLAGS += -lz -Wl,--start-group -lpthread -lm -ldl + ++MKDIR ?= mkdir ++DESTDIR ?= . ++PREFIX ?= /usr/local ++INSTALL ?= install ++STRIP ?= strip ++ + HDR += CommFunc.h \ + cdflib.h \ + dcdflib.h \ +@@ -58,7 +64,7 @@ OBJ = $(SRC:.cpp=.o) + all : $(OUTPUT) + + $(OUTPUT) : +- $(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ) $(LIB) ++ $(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ) $(LDFLAGS) + + $(OBJ) : $(HDR) + +@@ -69,6 +75,13 @@ $(OBJ) : $(HDR) + $(OUTPUT) : $(OBJ) + + FORCE: ++ ++install: ++ ${MKDIR} -p ${DESTDIR}${PREFIX}/bin ++ ${INSTALL} -c ${OUTPUT} ${DESTDIR}${PREFIX}/bin ++ ++install-strip: install ++ ${STRIP} ${DESTDIR}${PREFIX}/bin/${OUTPUT} + + clean: + rm -f *.o Added: head/biology/gcta/files/patch-eigen__func.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/files/patch-eigen__func.h Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,15 @@ +--- eigen_func.h.orig 2016-06-22 03:11:01 UTC ++++ eigen_func.h +@@ -12,9 +12,9 @@ + #ifndef _EIGENFUNC_H + #define _EIGENFUNC_H + +-#ifndef EIGEN_USE_MKL_ALL +-#define EIGEN_USE_MKL_ALL +-#endif ++//#ifndef EIGEN_USE_MKL_ALL ++//#define EIGEN_USE_MKL_ALL ++//#endif + + #include "CommFunc.h" + #include "StatFunc.h" Added: head/biology/gcta/files/patch-gcta.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/files/patch-gcta.h Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,29 @@ +--- gcta.h.orig 2016-06-22 03:11:01 UTC ++++ gcta.h +@@ -17,9 +17,9 @@ + #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET + #endif + +-#ifndef EIGEN_USE_MKL_ALL +-#define EIGEN_USE_MKL_ALL +-#endif ++//#ifndef EIGEN_USE_MKL_ALL ++//#define EIGEN_USE_MKL_ALL ++//#endif + + #include "CommFunc.h" + #include "StrFunc.h" +@@ -36,8 +36,11 @@ + #include + #include + #include +-#include +-#include ++#include ++#include ++// Looks like openblas, cblas and lapacke are all that's needed ++//#include ++//#include + + using namespace Eigen; + using namespace std; Added: head/biology/gcta/files/patch-ld.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/files/patch-ld.cpp Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,13 @@ +--- ld.cpp.orig 2020-04-15 12:56:27 UTC ++++ ld.cpp +@@ -1004,7 +1004,9 @@ void gcta::calcu_max_ld_rsq_blk(eigenVector &multi_rsq + } + + +- SelfAdjointEigenSolver pca(rsq_sub.array()); ++ // Fixed compile by removing .array(). Not sure about the validity ++ // of this change, but it seemed reasonable based on constructor docs. ++ SelfAdjointEigenSolver pca(rsq_sub); + + // debug + // ofstream tmp("tmp_R.txt"); Added: head/biology/gcta/files/patch-mkl.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/files/patch-mkl.cpp Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,56 @@ +--- mkl.cpp.orig 2020-04-15 00:54:40 UTC ++++ mkl.cpp +@@ -357,7 +357,7 @@ bool gcta::comput_inverse_logdet_LDLT_mkl(eigenMatrix + // MKL's Cholesky decomposition + int info = 0, int_n = (int) n; + char uplo = 'L'; +- dpotrf(&uplo, &int_n, Vi_mkl, &int_n, &info); ++ dpotrf_(&uplo, &int_n, Vi_mkl, &int_n, &info); + //spotrf( &uplo, &n, Vi_mkl, &n, &info ); + if (info < 0) throw ("Error: Cholesky decomposition failed. Invalid values found in the matrix.\n"); + else if (info > 0) return false; +@@ -369,7 +369,7 @@ bool gcta::comput_inverse_logdet_LDLT_mkl(eigenMatrix + } + + // Calcualte V inverse +- dpotri(&uplo, &int_n, Vi_mkl, &int_n, &info); ++ dpotri_(&uplo, &int_n, Vi_mkl, &int_n, &info); + //spotri( &uplo, &n, Vi_mkl, &n, &info ); + if (info < 0) throw ("Error: invalid values found in the varaince-covaraince (V) matrix.\n"); + else if (info > 0) return false; +@@ -405,7 +405,7 @@ bool gcta::comput_inverse_logdet_LU_mkl(eigenMatrix &V + int LWORK = N*N; + double *WORK = new double[n * n]; + int INFO; +- dgetrf(&N, &N, Vi_mkl, &N, IPIV, &INFO); ++ dgetrf_(&N, &N, Vi_mkl, &N, IPIV, &INFO); + if (INFO < 0) throw ("Error: LU decomposition failed. Invalid values found in the matrix.\n"); + else if (INFO > 0) { + delete[] Vi_mkl; +@@ -418,7 +418,7 @@ bool gcta::comput_inverse_logdet_LU_mkl(eigenMatrix &V + } + + // Calcualte V inverse +- dgetri(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO); ++ dgetri_(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO); + if (INFO < 0) throw ("Error: invalid values found in the varaince-covaraince (V) matrix.\n"); + else if (INFO > 0) return false; + else { +@@ -453,7 +453,7 @@ bool gcta::comput_inverse_logdet_LU_mkl_array(int n, f + int LWORK = N*N; + double *WORK = new double[n * n]; + int INFO; +- dgetrf(&N, &N, Vi_mkl, &N, IPIV, &INFO); ++ dgetrf_(&N, &N, Vi_mkl, &N, IPIV, &INFO); + if (INFO < 0) throw ("Error: LU decomposition failed. Invalid values found in the matrix.\n"); + else if (INFO > 0) { + delete[] Vi_mkl; +@@ -467,7 +467,7 @@ bool gcta::comput_inverse_logdet_LU_mkl_array(int n, f + } + + // Calcualte V inverse +- dgetri(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO); ++ dgetri_(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO); + if (INFO < 0) throw ("Error: invalid values found in the varaince-covaraince (V) matrix.\n"); + else if (INFO > 0) return (false); // Vi.diagonal()=Vi.diagonal().array()+Vi.diagonal().mean()*1e-3; + else { Added: head/biology/gcta/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/gcta/pkg-descr Wed Apr 15 15:22:04 2020 (r531770) @@ -0,0 +1,7 @@ +GCTA (Genome-wide Complex Trait Analysis) was originally designed to estimate +the proportion of phenotypic variance explained by genome- or chromosome-wide +SNPs for complex traits (the GREML method), and has subsequently extended for +many other analyses to better understand the genetic architecture of complex +traits. + +WWW: http://cnsgenomics.com/software/gcta/index.html