DReichLab / EIG

Eigen tools by Nick Patterson and Alkes Price lab
Other
182 stars 59 forks source link

"cd src; make" problem while installing #62

Closed treccanimirko closed 3 years ago

treccanimirko commented 3 years ago

Dear all,

I'm having some trouble in installing EIG-7.2.1. I've installed all the dependencies software and, as reported in the README.md file, I've run the following command.

cd src
make

After these commands and some compilation, some errors occur. I report them above:

cc   smshrink.o eigensrc/eigsubs.o eigensrc/exclude.o eigensrc/smartsubs.o eigensrc/eigx.o twsubs.o mcio.o qpsubs.o admutils.o egsubs.o regsubs.o gval.o nicksrc/libnick.a ksrc/kjg_fpca.o ksrc/kjg_gsl.o  -lgsl -lopenblas -lm -lpthread -o smshrink
/usr/bin/ld: ksrc/kjg_gsl.o: in function `kjg_gsl_dlange':
kjg_gsl.c:(.text+0x4df): undefined reference to `LAPACKE_dlange'
/usr/bin/ld: ksrc/kjg_gsl.o: in function `kjg_gsl_dgeqrf':
kjg_gsl.c:(.text+0x535): undefined reference to `LAPACKE_dgeqrf'
/usr/bin/ld: ksrc/kjg_gsl.o: in function `kjg_gsl_dorgqr':
kjg_gsl.c:(.text+0x59f): undefined reference to `LAPACKE_dorgqr'
/usr/bin/ld: ksrc/kjg_gsl.o: in function `kjg_gsl_SVD':
kjg_gsl.c:(.text+0x895): undefined reference to `LAPACKE_dgesvd'
collect2: error: ld returned 1 exit status
make: *** [<incorporato>: smshrink] Errore 1

Does anyone know any solution or have encountered the same problem? Thank you in advance,

Mirko

MatthewMah commented 3 years ago

The issue is the linker cannot find lapack functions.

  1. You need to have packages containing the lapack functions installed. What these are called and how many there are depend on your operating system distribution.

  2. Also from the README: If you have issues with missing lapacke symbols, for example "undefined reference to `LAPACKE_dlange'", run make with the corresponding additional libraries linked: make LDLIBS="-llapacke" This has been encountered on Linux Mint 18. The Makefile is currently setup for Linux distributions where lapack is in one library, but other distributions split this into lapack and lapacke libraries.

  3. It may also be possible that the lapack libraries are in paths outside those searched by default by the linker, in which case you need to manually specify the path: make CFLAGS="-I/n/app/openblas/0.2.19/include -I/n/app/gsl/2.3/include" LDFLAGS="-L/n/app/openblas/0.2.19/lib -L/n/app/gsl/2.3/lib/"

treccanimirko commented 3 years ago

Hi,

thank you for your answer.

Currently, my OS is Ubuntu Linux 20.04 LTS. Thanks to your indication, I manage in fixing the problem: the second solution, followed by the "make install" command, worked!

Have a nice day,

Mirko