-
Notifications
You must be signed in to change notification settings - Fork 7
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
undefined symbol: sgesdd_ and dgebal_ #15
Comments
Thanks for the report! I'd really like to crack this properly. This really doesn't look like it got added recently to LAPACK (no mention in release notes going back to 3.7.0 in Dec 2016), but - would you know which version of LAPACK you have on your various systems? Would you also be able to use
Also, what ExtUtils::F77 returns for I'm seeing the library find all relevant symbols and pass tests on Ubuntu, MacOS, and Strawberry Perl. |
It seems that the problem happens if liblapack-dev is not installed. In the end the *.so files were built without lapack linked in. I installed now liblapack-dev on my debian:11 smoker (but only there), and at least one perl there has a passing test suite. Builds for other perls are running right now. |
Aha! Yes, one interesting artifact of the current setup is that P:LA does all its own declarations of (the C-ish analogue of the Fortran functions), so the lack of a Line 39 in 33a30c6
In any case, do the builds work now? I'd like to avoid what seems to me a false positive before (of the presence of LAPACK), so any insights you can offer will be incredibly helpful for the near-future Alien::LAPACK :-) |
Not sure if this helps or not, but here's what I did to troubleshoot on CentOS 7 for this case: # find files in packages that contain the missing function:
rpm -ql `rpm -qa |grep openblas` `rpm -qa |grep atlas` | xargs grep sgesdd_ | grep matches | cut -f3 -d' ' | sort -u > /tmp/libs
# grep the missing functions from the matching libs:
for a in `cat /tmp/libs`; do readelf -Ws --dyn-syms $a | while read b ; do echo "$a: $b"; done;done | grep -P '[^_](dgebal|sgesdd)_$' You could do something similar on Ubuntu/Debian with The rpm out looks like this:
so depending on your build then (maybe) you need to add I'm guessing you want one of these:
I've collected a bunch of LAPACKE/CLAPACK library names by distribution with comments and names in the |
Thank you for this research! Are you able to repro @eserte's results of failing to find the function, then change that to success? I'd like to get the most idiomatic way to fix this in our Makefile.PL (and in a future Alien::LAPACK), since obviously setting LD_FLAGS and hacking makefiles is not a viable option. |
ok so this fixes it for me at build time: LD_PRELOAD='/usr/lib64/atlas/libtatlas.so.3' make test |
@eserte, do you get these errors at
In This fallback is probably the problem since it is unlikely to be valid when I'm still working on a final solution that builds here, so more to come... |
Ok, so here are several solutions that build for me on Oracle Linux 8 (RHEL 8, etc). Here is what I found:
So this is where my MakeMaker knowledge breaks down. Really what you want is to search for libraries in performance order and only choose one. I'm mocking up a PR for comment. |
./findlibs.pl was added to search for libraries. The `{Real,Trans,Complex}/Makefile.PL` files do not define libraries in `%ldloadlibs`, but they need to. I tried each of these and _they work for me_ but unfortunately they are distro specific: - %ldloadlibs = (LIBS => \`pkg-config atlas --libs\`); # distro default, probly serial - %ldloadlibs = (LIBS => -lsatlas); # serial atlas - %ldloadlibs = (LIBS => -ltatlas); # threaded atlas - %ldloadlibs = (LIBS => '-lopenblaso'); # OpenMP - %ldloadlibs = (LIBS => '-lopenblasp'); # pthreads - %ldloadlibs = (LIBS => '-lopenblas'); # serial - %ldloadlibs = (LIBS => '-llapack'); # old slow blas see PDLPorters#15
|
We're discussing this on IRC, but I wanted to correct a misapprehension here for future generations.
They do not need to, as that is not how subdirs' |
Added find_libs() to the root Makefile.PL to find libraries in Debian, Ubuntu, CentOS 7/8, SUSE. See PDLPorters#15 Signed-off-by: Eric Wheeler <[email protected]>
Thanks for the correction. Commit message and branch have been updated: KJ7LNW@6f0742d |
Added find_libs() to the root Makefile.PL to find libraries in Debian, Ubuntu, CentOS 7/8, SUSE. See PDLPorters#15 Signed-off-by: Eric Wheeler <[email protected]>
Added find_libs() to the root Makefile.PL to find libraries in Debian, Ubuntu, CentOS 7/8, SUSE. See PDLPorters#15 Signed-off-by: Eric Wheeler <[email protected]>
Added find_libs() to the root Makefile.PL to find libraries in Debian, Ubuntu, CentOS 7/8, SUSE. See #15 Signed-off-by: Eric Wheeler <[email protected]>
The Debian package build for 0.34 failed due to test failures:
The 0.34 build used |
Replacing libatlas-base-dev with libblas-dev & liblapack-dev resolves the issue for the Debian package. Replacing both with libopenblas-dev or libopenblas-serial-dev also works. Only the atlas implementation isn't supported by |
69fcefd seems like a reasonable fix. I've been working on a smarter find_libs() today but not yet ready for a PR. More when I am given time to look at it. |
@KJ7LNW sounds good, but let's see how this current shape "plays" on CPAN testers. We may not need any further action. |
Ok, @eserte 's systems are still failing on 0.35, e.g. https://www.cpantesters.org/cpan/report/da4cbd12-060a-11ed-a158-8ddd2cbfd570 (a Debian system) - I think I also think we'll need the config system to write its LAPACK findings to a file that can be dumped by a standalone test so we can see what the system being tried is if a failure happens (and also when it succeeds). |
@mohawk2 yep thats what I'm working on. |
Yes it can, and you can add it. See
|
For other people ending up here with the same symptoms: you might not have this problem. It might be sufficient, after installing the relevant BLAS/LAPACK/ATLAS packages, to reinstall PDL::LinearAlgebra. Not to diminish the great work and investigation that's been going on so far, but to prevent other people from retracing my false steps! |
@kqr Thank you for the feedback! A real problem is that PDL::LinearAlgebra is supposed to detect that situation, and is currently failing to do so. |
I'm having similar problems. I'm on OpenSUSE Leap 15.5, both
There are no
Interestingly, setting |
FYI: That will load Does echo /usr/lib64/lapack/ > /etc/ld.so.conf.d/atlas-x86_64.conf
ldconfig -a |
Unfortunately, it doesn't. |
#5 does not seem to be fixed in later PDL-LinearAlgebra versions (seen the error in 0.32):
or
Still Fedora is the only system amongst my smokers which has pass reports.
The text was updated successfully, but these errors were encountered: