Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Apr 2020 15:22:04 +0000 (UTC)
From:      "Jason W. Bacon" <jwb@FreeBSD.org>
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
Message-ID:  <202004151522.03FFM4r9004938@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <bsd.port.pre.mk>
+
+.if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} <= 42
+USE_GCC=	yes
+.endif
+
+do-extract:
+	${UNZIP_NATIVE_CMD} -d ${WRKSRC} ${DISTDIR}/${DISTFILES}
+
+.include <bsd.port.post.mk>

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 <unsupported/Eigen/SparseExtra>
+ #include <unsupported/Eigen/IterativeSolvers>
+ #include <omp.h>
+-#include <mkl_cblas.h>
+-#include <mkl_lapack.h>
++#include <cblas.h>
++#include <lapacke.h>
++// Looks like openblas, cblas and lapacke are all that's needed
++//#include <blaspp.h>
++//#include <lapackpp.h>
+ 
+ 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<MatrixXf> 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<MatrixXf> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004151522.03FFM4r9004938>