genetics-statistics / GEMMA

Genome-wide Efficient Mixed Model Association
https://github.com/genetics-statistics/GEMMA
GNU General Public License v3.0
334 stars 126 forks source link

undefined reference error #205

Closed samfux84 closed 5 years ago

samfux84 commented 5 years ago

Hi I am trying to install GEMMA 0.98.1, but it fails with an undefined reference error.

In the Makefile I use:

LIBS += -L/cluster/apps/gdc/gsl/1.16_gcc630/lib -lgsl -lz -L${GOTOBLAS2}/lib -lopenblas

and get the following error:

[sfux@eu-c7-041-01 GEMMA-0.98.1]$ make release
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/param.o src/param.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/fastblas.o src/fastblas.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/gemma.o src/gemma.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/varcov.o src/varcov.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/vc.o src/vc.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/logistic.o src/logistic.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/lapack.o src/lapack.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/prdt.o src/prdt.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/mathfunc.o src/mathfunc.cpp
In file included from src/mathfunc.cpp:40:0:
src/mathfunc.cpp:43:32: note: #pragma message: GSL version 1.16
 #pragma message "GSL version " GSL_VERSION
                                ^
src/mathfunc.cpp: In function ‘bool isMatrixIllConditioned(const gsl_vector*, double)’:
src/mathfunc.cpp:390:8: warning: unused variable ‘absmin’ [-Wunused-variable]
   auto absmin = get<0>(t);
        ^~~~~~
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/lmm.o src/lmm.cpp
src/lmm.cpp: In function ‘void CalcPab(size_t, size_t, const gsl_vector*, const gsl_matrix*, const gsl_vector*, gsl_matrix*)’:
src/lmm.cpp:281:10: warning: unused variable ‘n_index’ [-Wunused-variable]
   size_t n_index = (n_cvt + 2 + 1) * (n_cvt + 2) / 2; // result size
          ^~~~~~~
src/lmm.cpp:282:8: warning: unused variable ‘ni_test’ [-Wunused-variable]
   auto ni_test = Uab->size1; // inds
        ^~~~~~~
src/lmm.cpp: In function ‘double LogL_dev1(double, void*)’:
src/lmm.cpp:596:8: warning: unused variable ‘Uab’ [-Wunused-variable]
   auto Uab = p->Uab;
        ^~~
src/lmm.cpp:597:8: warning: unused variable ‘ab’ [-Wunused-variable]
   auto ab = p->ab;
        ^~
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/bslmm.o src/bslmm.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/bslmmdap.o src/bslmmdap.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/eigenlib.o src/eigenlib.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/lm.o src/lm.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/main.o src/main.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/mvlmm.o src/mvlmm.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/gemma_io.o src/gemma_io.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/gzstream.o src/gzstream.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/debug.o src/debug.cpp
/cluster/apps/gcc/6.3.0/bin/g++  -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc  -c -o src/ldr.o src/ldr.cpp
/cluster/apps/gcc/6.3.0/bin/g++ -DOPENBLAS -isystem/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/include -Wall -DNDEBUG -O3 -DHAVE_INLINE -pthread -Wall -std=gnu++11  -isystem/cluster/apps/gdc/gsl/1.16_gcc630/include -isystem/cluster/apps/gdc/eigen/3.2.10/include/eigen3 -Icontrib/catch-1.9.7 -Isrc src/param.o src/fastblas.o src/gemma.o src/varcov.o src/vc.o src/logistic.o src/lapack.o src/prdt.o src/mathfunc.o src/lmm.o src/bslmm.o src/bslmmdap.o src/eigenlib.o src/lm.o src/main.o src/mvlmm.o src/gemma_io.o src/gzstream.o src/debug.o src/ldr.o -L/cluster/apps/gdc/gsl/1.16_gcc630/lib -lgsl -lz -L/cluster/apps/openblas/0.2.13_seq/x86_64/gcc_6.3.0/lib -lopenblas  -o ./bin/gemma
src/gemma.o: In function `GEMMA::WriteLog(int, char**, PARAM&)':
gemma.cpp:(.text+0x3abd): undefined reference to `openblas_get_num_threads'
collect2: error: ld returned 1 exit status
make: *** [bin/gemma] Error 1
[sfux@eu-c7-041-01 GEMMA-0.98.1]$

What do I need to change to avoid this error ?

pjotrp commented 5 years ago

Try a more recent openblas.

samfux84 commented 5 years ago

@pjotrp: Thank you for the hint. After switching from OpenBLAS 0.2.13 to 0.2.19, the issue disappeared.