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

ubuntu 20.04 unable to install using cpan or cpanm #46

Closed
yelnats opened this issue May 24, 2022 · 10 comments
Closed

ubuntu 20.04 unable to install using cpan or cpanm #46

yelnats opened this issue May 24, 2022 · 10 comments

Comments

@yelnats
Copy link

yelnats commented May 24, 2022

'''root@aler:/sg# cpanm Geo::GDAL::FFI
--> Working on Geo::GDAL::FFI
Fetching http://www.cpan.org/authors/id/A/AJ/AJOLMA/Geo-GDAL-FFI-0.09.tar.gz ... OK
==> Found dependencies: Alien::gdal
--> Working on Alien::gdal
Fetching http://www.cpan.org/authors/id/S/SL/SLAFFAN/Alien-gdal-1.30.tar.gz ... OK
Configuring Alien-gdal-1.30 ... OK
Building and testing Alien-gdal-1.30 ... OK
Successfully installed Alien-gdal-1.30
Configuring Geo-GDAL-FFI-0.09 ... OK
Building and testing Geo-GDAL-FFI-0.09 ... FAIL
'''! Installing Geo::GDAL::FFI failed. See /root/.cpanm/work/1653404421.416310/build.log for details. Retry with --force to force install it.
1 distribution installed
root@aler:/sg# vi /root/.cpanm/work/1653404421.416310/build.log'''

'''# Failed test 'use Geo::GDAL::FFI;'''
'''# at t/00.t line 11.
'''# Tried to use 'Geo::GDAL::FFI'.'''
'''# Error: Can't attach to GDAL methods. Does Alien::gdal provide GDAL dynamic libs? at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.'''
'''# BEGIN failed--compilation aborted at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.'''
'''# Compilation failed in require at t/00.t line 11.'''
'''# BEGIN failed--compilation aborted at t/00.t line 11.'''
Bareword "PopFinderLocation" not allowed while "strict subs" in use at t/00.t line 116.
Bareword "GetVersionInfo" not allowed while "strict subs" in use at t/00.t line 129.
Execution of t/00.t aborted due to compilation errors.
'''# Tests were run but no plan was declared and done_testing() was not seen.'''
'''# Looks like your test exited with 255 just after 1.'''
t/00.t .........
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests
Can't attach to GDAL methods. Does Alien::gdal provide GDAL dynamic libs? at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
BEGIN failed--compilation aborted at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
Compilation failed in require at t/geometry.t line 6.
BEGIN failed--compilation aborted at t/geometry.t line 6.
t/geometry.t ...
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
Can't attach to GDAL methods. Does Alien::gdal provide GDAL dynamic libs? at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
BEGIN failed--compilation aborted at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
Compilation failed in require at t/pdl.t line 6.
BEGIN failed--compilation aborted at t/pdl.t line 6.
t/pdl.t ........
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
Can't attach to GDAL methods. Does Alien::gdal provide GDAL dynamic libs? at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
BEGIN failed--compilation aborted at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
Compilation failed in require at t/sr.t line 6.
BEGIN failed--compilation aborted at t/sr.t line 6.
t/sr.t .........
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
Can't attach to GDAL methods. Does Alien::gdal provide GDAL dynamic libs? at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
BEGIN failed--compilation aborted at /root/.cpanm/work/1653404421.416310/Geo-GDAL-FFI-0.09/blib/lib/Geo/GDAL/FFI.pm line 1659.
Compilation failed in require at t/vsistdout.t line 6.
BEGIN failed--compilation aborted at t/vsistdout.t line 6.
t/vsistdout.t ..
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run

Test Summary Report

t/00.t (Wstat: 65280 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/geometry.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/pdl.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/sr.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/vsistdout.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
Files=5, Tests=1, 3 wallclock secs ( 0.05 usr 0.01 sys + 2.19 cusr 0.43 csys = 2.68 CPU)
Result: FAIL
Failed 5/5 test programs. 1/1 subtests failed.
make: *** [Makefile:932: test_dynamic] Error 2
-> FAIL Installing Geo::GDAL::FFI failed. See /root/.cpanm/work/1653404421.416310/build.log for details. Retry with --force to force install it.
1 distribution installed'''

@shawnlaffan
Copy link
Collaborator

This is probably libgdal.so under Alien::gdal not finding its dependent dynamic lib files.

Can you please run this command and report its results?

perl -MAlien::gdal -E'say system ("ldd", Alien::gdal->dist_dir . "/lib/libgdal.so")'

@shawnlaffan
Copy link
Collaborator

See also: shawnlaffan/perl-alien-gdal#22

@yelnats
Copy link
Author

yelnats commented May 25, 2022

Sure.perl -MAlien::gdal -E'say system ("ldd", Alien::gdal->dist_dir . "/lib/libgdal.so")'
linux-vdso.so.1 (0x00007ffee2f36000)
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f5091358000)
libgeos_c.so.1 => /lib/x86_64-linux-gnu/libgeos_c.so.1 (0x00007f509131d000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f50912ef000)
libnetcdf.so.15 => /lib/x86_64-linux-gnu/libnetcdf.so.15 (0x00007f50911ca000)
libhdf5_serial.so.103 => /lib/x86_64-linux-gnu/libhdf5_serial.so.103 (0x00007f5090e4d000)
libproj.so.25 => not found
libsqlite3.so.0 => /usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-sqlite/lib/libsqlite3.so.0 (0x00007f5090d2b000)
libtiff.so.5 => /usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-libtiff/lib/libtiff.so.5 (0x00007f5090cab000)
libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f5090c26000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5090c0a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5090be7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5090be1000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f5090b4f000)
libcurl-gnutls.so.4 => /lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f5090ac0000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f50908de000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f509078f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f509059d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5092a24000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5090582000)
libgeos-3.9.1.so => /lib/x86_64-linux-gnu/libgeos-3.9.1.so (0x00007f509038b000)
libhdf5_serial_hl.so.100 => /lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100 (0x00007f5090364000)
libsz.so.2 => /lib/x86_64-linux-gnu/libsz.so.2 (0x00007f509035f000)
libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f5090336000)
libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f5090315000)
librtmp.so.1 => /lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f50902f3000)
libssh.so.4 => /lib/x86_64-linux-gnu/libssh.so.4 (0x00007f5090285000)
libpsl.so.5 => /lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f5090272000)
libnettle.so.7 => /lib/x86_64-linux-gnu/libnettle.so.7 (0x00007f5090238000)
libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f5090062000)
libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f5090015000)
libldap_r-2.4.so.2 => /lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f508ffbd000)
liblber-2.4.so.2 => /lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f508ffac000)
libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f508ff9e000)
libaec.so.0 => /lib/x86_64-linux-gnu/libaec.so.0 (0x00007f508ff95000)
libunistring.so.2 => /lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f508fe13000)
libhogweed.so.5 => /lib/x86_64-linux-gnu/libhogweed.so.5 (0x00007f508fdda000)
libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f508fd56000)
libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f508fc20000)
libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f508fc0a000)
libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f508fb2d000)
libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f508fafa000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f508faf3000)
libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f508fae4000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f508fac8000)
libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f508faab000)
libgssapi.so.3 => /lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f508fa66000)
libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f508fa41000)
libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7 (0x00007f508fa35000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f508fa2e000)
libheimntlm.so.0 => /lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f508fa22000)
libkrb5.so.26 => /lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f508f98f000)
libasn1.so.8 => /lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f508f8e6000)
libhcrypto.so.4 => /lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f508f8ae000)
libroken.so.18 => /lib/x86_64-linux-gnu/libroken.so.18 (0x00007f508f895000)
libwind.so.0 => /lib/x86_64-linux-gnu/libwind.so.0 (0x00007f508f86b000)
libheimbase.so.1 => /lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f508f859000)
libhx509.so.5 => /lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f508f80b000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f508f7ce000)
0

I see, Alien::gdal can not locate libproj.so.25

locate libproj.so.25
/usr/local/lib/x86_64-linux-gnu/perl/5.26.1/auto/share/dist/Alien-proj/lib/libproj.so.25

This worked:
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/lib/x86_64-linux-gnu/perl/5.26.1/auto/share/dist/Alien-proj/lib;sudo ldconfig

So I did this:
ln -s /usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-proj/lib/libproj.so.25 /lib/x86_64-linux-gnu/libproj.so.25

Then I reinstalled Geo::GDAL::FFI and everything is good!
Thanks.

@shawnlaffan
Copy link
Collaborator

That works around the issue, but linking a perl alien into your /lib dir is pretty risky and not future proof.

Alien::gdal should be finding this file. Can you run this command?

perl -MAlien::gdal -MAlien::patchelf -E'say Alien::patchelf->patchelf("--print-rpath", Alien::gdal->dist_dir . "/lib/libgdal.so")'

If Alien::patchelf is not installed then it can be installed using cpanm, and its absence might be the reason for the original issue.

@yelnats
Copy link
Author

yelnats commented May 25, 2022

Sure...
perl -MAlien::gdal -MAlien::patchelf -E'say Alien::patchelf->patchelf("--print-rpath", Alien::gdal->dist_dir . "/lib/libgdal.so")'
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-sqlite/lib:/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-libtiff/lib
0

locate Alien/patchelf
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/Alien/patchelf.pm
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/Alien/patchelf
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/Alien/patchelf/.packlist
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/Alien/patchelf/patchelf.txt

Also installed Alien::gdal on another system I have (Ubuntu 18.04.6 LTS) and it also was not able to find libproj.so.25. It was in the same location and adding the path to LD_LIBRARY_PATH also worked on that system.

@shawnlaffan
Copy link
Collaborator

It looks like you have multiple perls on your system, or the vestiges of an older perl (5.26). It's important not to mix perls as you can get weird interaction effects that are hard to diagnose.

What do you get for these calls?

perl -v
perl -MAlien::gdal -E'say Alien::gdal->dist_dir'
perl -MAlien::proj -E'say Alien::proj->dist_dir'
perl -MAlien::proj -E'say Alien::proj->install_type'
ls `perl -MAlien::proj -E'say Alien::proj->dist_dir'`/lib

WRT the patchelf call, Alien::gdal should be using Alien::patchelf to adjust the rpath of the libgdal.so file so it can find the libproj.so file. The fact that it only includes paths for tiff and sqlite suggests it has not been done.

What does the build log look like for Alien::gdal?

cpanm --look Alien::gdal
perl -v
perl Makefile.PL
make test

(Please make sure to embed the logs in the triple-backtick quotes so they are not treated as markdown. It would also help to put the build log inside a collapsible section - see https://codex.so/collapsed-block-for-github-markdown ).

@yelnats
Copy link
Author

yelnats commented May 25, 2022

Sorry, there is only one version of perl. I just pasted the path from my Ubuntu 18.04 system (I mentioned that it also has the same issue). Ubuntu 18.04 has perl version 5.26.1. Ubuntu 20.04 has perl version 5.30.0.

I should have posted this before:
locate libproj.so.25
/usr/lib/x86_64-linux-gnu/libproj.so.25
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-proj/lib/libproj.so.25
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/auto/share/dist/Alien-proj/lib/libproj.so.25.9.0.0

So false alarm there. I will post the logs you mentioned next.

@shawnlaffan
Copy link
Collaborator

...actually, attaching the build log as a file will avoid all the formatting issues.

@shawnlaffan
Copy link
Collaborator

@yelnats - have you had a chance to generate the logs?

@shawnlaffan
Copy link
Collaborator

@yelnats - It looks like this was an issue with Alien::gdal where the rpath updates were overridden before installation.

shawnlaffan/perl-alien-gdal@1d040bc

That is now hopefully fixed in version 1.31 which has been released to CPAN.

@ajolma ajolma closed this as completed Jan 5, 2023
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

3 participants