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

needs to link with -llapack #8

Open
rekado opened this issue Jun 27, 2016 · 3 comments
Open

needs to link with -llapack #8

rekado opened this issue Jun 27, 2016 · 3 comments

Comments

@rekado
Copy link

rekado commented Jun 27, 2016

The linker complains about undefined references:

eigensrc/eigx.o: In function `eigx_':
eigx.c:(.text+0x14b): undefined reference to `dspev_'
eigensrc/eigx.o: In function `eigxv_':
eigx.c:(.text+0x220): undefined reference to `dspev_'
eigensrc/eigx.o: In function `cdc_':
eigx.c:(.text+0x29b): undefined reference to `dpotrf_'
eigensrc/eigx.o: In function `inverse_':
eigx.c:(.text+0x396): undefined reference to `dgetrf_'
eigx.c:(.text+0x3f7): undefined reference to `dgetri_'
eigensrc/eigx.o: In function `solve_':
eigx.c:(.text+0x4d7): undefined reference to `dgetrf_'
eigx.c:(.text+0x536): undefined reference to `dgetrs_'
eigensrc/eigx.o: In function `geneigsolve_':
eigx.c:(.text+0x602): undefined reference to `dsygv_'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'eigensrc/pcatoy' failed
make: *** [eigensrc/pcatoy] Error 1
eigx.o: In function `eigx_':
eigx.c:(.text+0x14b): undefined reference to `dspev_'
eigx.o: In function `eigxv_':
eigx.c:(.text+0x220): undefined reference to `dspev_'
eigx.o: In function `cdc_':
eigx.c:(.text+0x29b): undefined reference to `dpotrf_'
eigx.o: In function `inverse_':
eigx.c:(.text+0x396): undefined reference to `dgetrf_'
eigx.c:(.text+0x3f7): undefined reference to `dgetri_'
eigx.o: In function `solve_':
eigx.c:(.text+0x4d7): undefined reference to `dgetrf_'
eigx.c:(.text+0x536): undefined reference to `dgetrs_'
eigx.o: In function `geneigsolve_':
eigx.c:(.text+0x602): undefined reference to `dsygv_'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'pca' failed
make: *** [pca] Error 1

These references come from the lapack library. By adding -llapack the linker flags this error disappears and all references are found. This is required especially when the available OpenBLAS was built without LAPACK and a separate LAPACK library is used.

@rekado
Copy link
Author

rekado commented Jul 12, 2016

It also needs to link with -llapacke.

@MatthewMah
Copy link
Contributor

Are you building on Ubuntu? On our primary platforms, adding -llapack breaks the build because there is no separate lapack library. I think our best path going forward is to document necessary modifications to the make variables in the readme file.

You should be able to build by adding command line options to make:
make LDLIBS="-llapack -llapcke"

We may try to migrate to autotools in the future to help get around these kinds of build issues, but autotools are not installed by default on Mac.

@rekado
Copy link
Author

rekado commented May 18, 2017

Are you building on Ubuntu?

No, I was going to package it for GNU Guix (making it available on any distribution of the GNU system). It's possible to build it by overriding the linker flags, but I thought I should report it upstream rather than only patching it locally. I didn't go ahead with it, though, because the license does not grant any rights to distribute or modify the sources or binaries for any purpose, making it non-free software :(

but autotools are not installed by default on Mac.

This is only a problem for would-be developers, not for users or packagers. Autotools produces a portable configure shell script when creating release tarballs with make dist, so people who download the tarball and build from it do not need to have a copy of the autotools. Only people who need to change configure.ac and make releases need to have autotools installed.

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

No branches or pull requests

2 participants