From 8c82a8294483ffac4d8e9635376723f26a8ae27b Mon Sep 17 00:00:00 2001
From: Pjotr Prins
Date: Fri, 22 May 2020 07:15:37 -0500
Subject: Fixes for gcc (GCC) 10.1.0 Started to remove eigenlib (again)
---
src/fastblas.cpp | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
(limited to 'src/fastblas.cpp')
diff --git a/src/fastblas.cpp b/src/fastblas.cpp
index b3fcddb..e9e38d0 100644
--- a/src/fastblas.cpp
+++ b/src/fastblas.cpp
@@ -18,7 +18,7 @@
along with this program. If not, see .
*/
-#include "gsl/gsl_matrix.h"
+// #include "gsl/gsl_matrix.h"
#include // std::min
#include
#include
@@ -235,8 +235,39 @@ void fast_dgemm(const char *TransA, const char *TransB, const double alpha,
void fast_eigen_dgemm(const char *TransA, const char *TransB, const double alpha,
const gsl_matrix *A, const gsl_matrix *B, const double beta,
gsl_matrix *C) {
- if (is_legacy_mode())
- eigenlib_dgemm(TransA,TransB,alpha,A,B,beta,C);
- else
fast_cblas_dgemm(TransA,TransB,alpha,A,B,beta,C);
}
+
+/*
+ * Inverse in place
+ */
+
+#include
+#include
+
+void gsl_matrix_inv(gsl_matrix *m)
+{
+ size_t n=m->size1;
+
+ gsl_matrix *temp1=gsl_matrix_calloc(n,n);
+ gsl_matrix_memcpy(temp1,m);
+
+ gsl_permutation *p=gsl_permutation_calloc(n);
+ int sign=0;
+ gsl_linalg_LU_decomp(temp1,p,&sign);
+ gsl_matrix *inverse=gsl_matrix_calloc(n,n);
+
+ gsl_linalg_LU_invert(temp1,p,inverse);
+ gsl_matrix_memcpy(m,inverse);
+
+ gsl_permutation_free(p);
+ gsl_matrix_free(temp1);
+ gsl_matrix_free(inverse);
+
+}
+
+void fast_inverse(gsl_matrix *m) {
+ gsl_matrix_inv(m);
+}
+
+
--
cgit v1.2.3
From b309569fe9497befa008ac2d2cbc04f2e861ce76 Mon Sep 17 00:00:00 2001
From: Pjotr Prins
Date: Fri, 22 May 2020 11:07:44 -0500
Subject: Removing more eigenlib references
---
INSTALL.md | 9 +++++++--
Makefile | 13 +++----------
VERSION | 2 +-
src/fastblas.cpp | 8 +++++++-
src/fastopenblas.h | 4 ++--
src/version.h | 8 ++++----
6 files changed, 24 insertions(+), 20 deletions(-)
(limited to 'src/fastblas.cpp')
diff --git a/INSTALL.md b/INSTALL.md
index 4f7da49..4885ed0 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -17,7 +17,6 @@ dependencies:
* GNU Science library (GSL) 1.x (GEMMA does not currently work with GSL >= 2).
* blas/openblas
* lapack
-* [Eigen3 library](http://eigen.tuxfamily.org/dox/)
* zlib
See below for installation on Guix.
@@ -51,10 +50,16 @@ using the following command
To build GEMMA from source you can opt to install the build tools with GNU Guix
- guix package -i make gcc linux-libre-headers gsl eigen openblas lapack glibc ld-wrapper
+ guix package -i make gcc linux-libre-headers gsl openblas lapack glibc ld-wrapper
+
+The current build container is
+
+ guix environment -C guix --ad-hoc gcc-toolchain gdb gsl openblas zlib bash ld-wrapper perl vim
### Install from source
+Note: Eigen is no longer required!
+
Install listed dependencies and run
make -j 4
diff --git a/Makefile b/Makefile
index 191285a..246cf6f 100644
--- a/Makefile
+++ b/Makefile
@@ -76,15 +76,9 @@ GCC_FLAGS = -DHAVE_INLINE -pthread -Wall -std=gnu++11 # extra flags
GSL_INCLUDE_PATH =
ifeq ($(SYS), WIN)
GSL_INCLUDE_PATH = -isystemc:/MinGW/include -LC:/MinGW/lib
- EIGEN_INCLUDE_PATH = ../eigen-git-mirror
OPENBLAS_INCLUDE_PATH = ../OpenBLAS-v0.2.19-Win64-int32/include -L../OpenBLAS-v0.2.19-Win64-int32/lib
else
OPENBLAS_INCLUDE_PATH = /usr/local/opt/openblas/include
- ifeq ($(SYS), OSX)
- EIGEN_INCLUDE_PATH = /usr/local/include/eigen3
- else
- EIGEN_INCLUDE_PATH = /usr/include/eigen3
- endif
ifndef GUIX
ifdef GUIX_ENVIRONMENT
GUIX=$(GUIX_ENVIRONMENT)
@@ -93,7 +87,6 @@ else
ifdef GUIX
# Effectively disable paths for GNU Guix
OPENBLAS_INCLUDE_PATH = .
- # EIGEN_INCLUDE_PATH = $(GUIX)/include/eigen3
# RPATH = -Xlinker --rpath=$(GUIX)/lib
ifdef FORCE_STATIC
LIBS = -L$(GUIX)/lib
@@ -118,7 +111,7 @@ else
endif
ifeq ($(CPP), clang++)
- GCC_FLAGS=-std=c++11 -isystem$(OPENBLAS_INCLUDE_PATH) -isystem$(EIGEN_INCLUDE_PATH)
+ GCC_FLAGS=-std=c++11 -isystem$(OPENBLAS_INCLUDE_PATH)
ifdef GUIX
CPPFLAGS += -I$(GUIX)/include/c++ -I$(GUIX)/include/c++/x86_64-unknown-linux-gnu
endif
@@ -147,9 +140,9 @@ debug check fast-check: CPPFLAGS += -g $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -Icontri
profile: CPPFLAGS += -pg
-release: CPPFLAGS += -DNDEBUG -O3 $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc
+release: CPPFLAGS += -DNDEBUG -O3 $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc
-static: CPPFLAGS += -DNDEBUG -O3 $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc
+static: CPPFLAGS += -DNDEBUG -O3 $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc
ifeq ($(SYS), WIN)
diff --git a/VERSION b/VERSION
index 359d7a7..85b51db 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.98.1
+0.98.2
diff --git a/src/fastblas.cpp b/src/fastblas.cpp
index e9e38d0..42c59ee 100644
--- a/src/fastblas.cpp
+++ b/src/fastblas.cpp
@@ -29,6 +29,7 @@
#include "mathfunc.h"
#include
#include "eigenlib.h"
+#include
const char *FastblasTrans = "T";
const char *FastblasNoTrans = "N";
@@ -243,7 +244,12 @@ void fast_eigen_dgemm(const char *TransA, const char *TransB, const double alpha
*/
#include
-#include
+// #include
+
+extern "C" {
+ int gsl_linalg_LU_invert(const gsl_matrix * LU, const gsl_permutation * p, gsl_matrix * inverse);
+ int gsl_linalg_LU_decomp(gsl_matrix * A, gsl_permutation * p, int * signum);
+}
void gsl_matrix_inv(gsl_matrix *m)
{
diff --git a/src/fastopenblas.h b/src/fastopenblas.h
index 2fc743e..7f453da 100644
--- a/src/fastopenblas.h
+++ b/src/fastopenblas.h
@@ -25,11 +25,11 @@
#include
extern "C"
{
- // #include // For OpenBlas / Atlas
+ #include // For OpenBlas / Atlas
}
// #include "gsl/gsl_matrix.h"
-void fast_cblas_dgemm(const enum CBLAS_ORDER Order,
+void fast_cblas_dgemm(const enum CBLAS_ORDER ,
const enum CBLAS_TRANSPOSE TransA,
const enum CBLAS_TRANSPOSE TransB,
const size_t M,
diff --git a/src/version.h b/src/version.h
index cfb3ba9..d413933 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1,5 +1,5 @@
// version.h generated by GEMMA scripts/gen_version_info.sh
-#define GEMMA_VERSION "0.98.1"
-#define GEMMA_DATE "2018-12-10"
-#define GEMMA_YEAR "2018"
-#define GEMMA_PROFILE ""
+#define GEMMA_VERSION "0.98.2"
+#define GEMMA_DATE "2020-05-22"
+#define GEMMA_YEAR "2020"
+#define GEMMA_PROFILE "/gnu/store/h9xwdvc7kqx7cvpvs6iascfdw5zgzhyd-profile"
--
cgit v1.2.3