Skip to content

Commit

Permalink
Fixing Travis build, remove gcc warnings and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Sep 29, 2020
1 parent a59bc9a commit 1cd41f0
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 66 deletions.
2 changes: 2 additions & 0 deletions .guix-dev-gcc-older
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Typical Guix container invocation
~/opt/guix/bin/guix environment -C guix --ad-hoc [email protected] gdb gsl openblas zlib bash ld-wrapper perl vim which
34 changes: 3 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
language: C++
matrix:
# OSX testing is under development
# allow_failures:
# - os: osx
include:
- os: linux
compiler: gcc
Expand All @@ -11,36 +8,11 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
# Our dev environment is a more recent GNU C++ and GSL2
- g++-4.9
- libgsl-dev
- libopenblas-dev
- zlib1g-dev
- libgsl0-dev
- os: osx
compiler: clang
# - os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - g++-6
# env:
# - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install gsl openblas zlib eigen lapack ; fi
script:
- echo $MATRIX_EVAL
- eval "${MATRIX_EVAL}"
- $CXX --version
# build and test debug version
- make CXX=$CXX OPENBLAS_LEGACY=1 WITH_GSLCBLAS=1 -j 4 -k
- time make CXX=$CXX OPENBLAS_LEGACY=1 WITH_GSLCBLAS=1 check
# - make clean
# build and test release version (integration test mostly)
# - make CXX=$CXX EIGEN_INCLUDE_PATH=$EIGEN_INCLUDE_PATH DEBUG= FORCE_DYNAMIC=1 WITH_OPENBLAS=1 OPENBLAS_LEGACY=1 -j 4
# - time make CXX=$CXX DEBUG= WITH_OPENBLAS=1 fast-check
# build static release (fast-check only)
# - make clean
# - make CXX=$CXX TRAVIS_CI=1 -j 4 fast-check
# - ldd ./bin/gemma
- make -j 4 OPENBLAS_LEGACY=1
- make OPENBLAS_LEGACY=1 fast-check
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and it should give you the version.
GEMMA runs on Linux and MAC OSX and the runtime has the following
dependencies:

* C++ tool chain >= 4.9
* C++ tool chain >= 6.5.0 (we test with file .guix-dev-gcc-older)
* GNU Science library (GSL) 1.x (GEMMA does not currently work with GSL >= 2).
* blas/openblas
* lapack
Expand Down
5 changes: 4 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ see
and
[commits](https://github.com/genetics-statistics/GEMMA/commits/master).

## ChangeLog v0.98.2 (2018/05/28)
## ChangeLog v0.98.3 (2020/?)


## ChangeLog v0.98.2 (2019/05/28)

GCC 10.1 fix release

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.98.2
0.98.3
43 changes: 21 additions & 22 deletions src/fastblas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Genome-wide Efficient Mixed Model Association (GEMMA)
Copyright © 2011-2017, Xiang Zhou
Copyright © 2017, Peter Carbonetto
Copyright © 2017, Pjotr Prins
Copyright © 2017-2020, Pjotr Prins
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -25,6 +25,7 @@
#include "debug.h"
#include "mathfunc.h"
#include <string.h>
#include "fastblas.h"

const char *FastblasTrans = "T";
const char *FastblasNoTrans = "N";
Expand Down Expand Up @@ -246,29 +247,27 @@ extern "C" {
int gsl_linalg_LU_decomp(gsl_matrix * A, gsl_permutation * p, int * signum);
}

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 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);
}


3 changes: 2 additions & 1 deletion src/fastblas.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

#include <assert.h>
#include <iostream>
// #include "gsl/gsl_matrix.h"
#include "gsl/gsl_cblas.h"
#include "gsl/gsl_matrix.h"

gsl_matrix *fast_copy(gsl_matrix *m, const double *mem);

Expand Down
8 changes: 4 additions & 4 deletions src/lmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ void CalcPab(const size_t n_cvt, const size_t e_mode, const gsl_vector *Hi_eval,
const gsl_matrix *Uab, const gsl_vector *unused, gsl_matrix *Pab) {


size_t n_index = (n_cvt + 2 + 1) * (n_cvt + 2) / 2; // result size
auto ni_test = Uab->size1; // inds
// size_t n_index = (n_cvt + 2 + 1) * (n_cvt + 2) / 2; // result size
// auto ni_test = Uab->size1; // inds
assert(Uab->size1 == Hi_eval->size);
assert(Uab->size2 == n_index);

Expand Down Expand Up @@ -593,8 +593,8 @@ double LogL_dev1(double l, void *params) {
$8 = 6
*/

auto Uab = p->Uab;
auto ab = p->ab;
// auto Uab = p->Uab;
// auto ab = p->ab;
assert(n_index == (n_cvt + 2 + 1) * (n_cvt + 2) / 2);
assert(Uab->size1 == ni_test);
assert(Uab->size2 == n_index); // n_cvt == 1 -> n_index == 6?
Expand Down
2 changes: 1 addition & 1 deletion src/mathfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ uint count_abs_small_values(const gsl_vector *v, double min) {
// and the ratio of max and min but one (min is expected to be zero).
bool isMatrixIllConditioned(const gsl_vector *eigenvalues, double max_ratio) {
auto t = abs_minmax(eigenvalues);
auto absmin = get<0>(t);
// auto absmin = get<0>(t);
auto absmin1 = get<1>(t);
auto absmax = get<2>(t);
if (absmax/absmin1 > max_ratio) {
Expand Down
8 changes: 4 additions & 4 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// version.h generated by GEMMA ./scripts/gen_version_info.sh
#define GEMMA_VERSION "0.98.2"
#define GEMMA_DATE "2020-05-28"
// version.h generated by GEMMA scripts/gen_version_info.sh
#define GEMMA_VERSION "0.98.3"
#define GEMMA_DATE "2020-09-29"
#define GEMMA_YEAR "2020"
#define GEMMA_PROFILE ""
#define GEMMA_PROFILE "/gnu/store/a7a35vv75zk9k23k8ws4v2wrs123dln1-profile"

0 comments on commit 1cd41f0

Please sign in to comment.