Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing build issues on clean RedHat 7 with openblas and lapack installed. #2

Closed
wants to merge 1 commit into from

Conversation

pdworzynski
Copy link

Fixes two issues when compiling the source on standard RedHat 7 with gcc 4.8.3 with openblas and lapack installed from repo.

GCC would complain that "lapacke_mangling.h" file, referenced by "lapacke.h" could not be found. This could be solved by either removing "lapacke.h" from include directory and relying on system wide header or by adding "lapacke_mangling.h" to include, which i did for the sake of compliance.

In file included from ksrc/kjg_gsl.c:10:0:
../include/lapacke.h:143:30: fatal error: lapacke_mangling.h: No such file or directory
 #include "lapacke_mangling.h"
                              ^
compilation terminated.

Also, GCC linker would not find lapack functions without "-llapacke" flag passed to linker cmd.

gcc -L/opt/openblas/lib -D_GNU_SOURCE  eigensrc/smartpca.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  -Wl,-Bdynamic -lgsl -Wl,-Bstatic -lopenblas -Wl,-Bdynamic -lgfortran -pthread -lm  -o eigensrc/smartpca
ksrc/kjg_gsl.o: In function `kjg_gsl_dlange':
kjg_gsl.c:(.text+0x4c5): undefined reference to `LAPACKE_dlange'
ksrc/kjg_gsl.o: In function `kjg_gsl_dgeqrf':
kjg_gsl.c:(.text+0x526): undefined reference to `LAPACKE_dgeqrf'
ksrc/kjg_gsl.o: In function `kjg_gsl_dorgqr':
kjg_gsl.c:(.text+0x585): undefined reference to `LAPACKE_dorgqr'
ksrc/kjg_gsl.o: In function `kjg_gsl_SVD':
kjg_gsl.c:(.text+0x88d): undefined reference to `LAPACKE_dgesvd'
collect2: error: ld returned 1 exit status

…packe.h to include dir, added -llapacke flag to linker cmd.
@kgalinsky
Copy link
Contributor

I agree that lapacke.h does not belong in the include folder. Is lapacke_mangling.h needed there though?

@MatthewMah
Copy link
Contributor

This has been resolved by removing the unnecessary lapacke.h files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants