Closed mohawk2 closed 1 year ago
The coordinate definitions have been stored as an sqlite database since Proj version 6, so it does need it.
As for flags and variables, I'm open to a PR. Ideally the code will work across different OSes as there are downstream failures that are probably due to the same issue. See CI runs for https://github.com/shawnlaffan/geo-gdal-ffi-canary
The run_utility code already adds to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, and it would be nice to generalise. https://github.com/shawnlaffan/perl-alien-proj/blob/855c4002e15487cecbf246f8ff961d9ad117e350/lib/Alien/proj.pm#L50
I confess I don't really know. Does FreeBSD have pkg-config
? Does this module on that platform use it?
@plicease Do you have any ideas?
FreeBSD ports has pkgconf (pkg-config implementation), but since it isn't part of the core OS you can't guarantee that it will be there.
FWIW, PkgConfig is a dependency. https://github.com/shawnlaffan/perl-alien-proj/blob/855c4002e15487cecbf246f8ff961d9ad117e350/Makefile.PL#L26-L29
This should be the corresponding install of Alien::proj on that system: http://www.cpantesters.org/cpan/report/2286be24-5b99-11ec-bf39-74791f24ea8f
Some key parts are reproduced below.
A common issue with these modules on CPAN Testers is where the libs and cflags settings for the Alien are their final destination, but the make install
step has not been run yet so the files are still under their respective blib dirs. This might be what is happening in this case.
# Install type is share
# Proj version is 8.2.0
# Aliens:
# Alien::sqlite: version: 3.31.1, install type: share
t/00-load.t ....... ok
# NAME=proj
# VERSION=8.2.0
# CFLAGS: -I/usr/perl5.34.0p/lib/site_perl/5.34.0/amd64-freebsd/auto/share/dist/Alien-sqlite/include -I/usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/include
t/01-config.t ..... ok
# libs: -L/usr/perl5.34.0p/lib/site_perl/5.34.0/amd64-freebsd/auto/share/dist/Alien-sqlite/lib -lsqlite3 -lz -lm -lpthread -L/usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/lib -lproj
# cflags: -I/usr/perl5.34.0p/lib/site_perl/5.34.0/amd64-freebsd/auto/share/dist/Alien-sqlite/include -I/usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/include
# Dynamic libs: /usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/lib/libproj.so:/usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/lib/libproj.so.22:/usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/lib/libproj.so.22.2.0:/usr/perl5.34.0p/lib/site_perl/5.34.0/amd64-freebsd/auto/share/dist/Alien-sqlite/lib/libsqlite3.so:/usr/perl5.34.0p/lib/site_perl/5.34.0/amd64-freebsd/auto/share/dist/Alien-sqlite/lib/libsqlite3.so.0:/usr/perl5.34.0p/lib/site_perl/5.34.0/amd64-freebsd/auto/share/dist/Alien-sqlite/lib/libsqlite3.so.0.8.6
# bin dir: /usr/home/cpansand/.cpan/build/2021121222/Alien-proj-1.16-0/blib/lib/auto/share/dist/Alien-proj/bin
t/02-use.t ........ ok
#
To continue the incomplete (and now deleted) point in the previous comment, it might be worth adding some instrumentation to PDL::GIS::Proj to say where it thinks it is getting things from.
That sounds sensible, and would probably help with https://github.com/PDLPorters/pdl/issues/391. @shawnlaffan What would it be useful to dump out?
I would guess some printing of the common env vars that might be in use.
LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, LDFLAGS, CFLAGS, CXXFLAGS
Note that the first two are currently set in the test file: https://github.com/shawnlaffan/perl-alien-proj/blob/4850586752a5631837ccc3ac1854a3d9f0b1cbd7/t/02-use.t#L10-L12
I wonder if setting those env-vars more globally (and probably joining with join $Config{path_sep}, grep defined, $ENV{LD_LIBRARY_PATH}, $newvalue
) wouldn't be useful.
I would guess some printing of the common env vars that might be in use.
LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, LDFLAGS, CFLAGS, CXXFLAGS
Added (with a couple of bonus ones in case) on git master
.
Alien::proj 1.23 now sets the rpath in the compilation phase. @mohawk2 - Can you give it a try?
Details in 680e259043862a6166b056483983a66ece267c2b
I think this is fixed now but please re-open if not.
http://www.cpantesters.org/cpan/report/5df1fefe-81b1-11ec-b66f-0a451f24ea8f shows:
Does it maybe need an
LD_RUN_PATH
and/or-r
flag? Does PROJ actually need sqlite?