In preparation of the upcoming Proj 5.0.0 release, the pdl Debian package was rebuilt with Proj 5.0.0-rc2. Unfortunately it failed to build:
x86_64-linux-gnu-gcc -c "-I/build/pdl-2.018/Basic/Core" "-I/usr/include" -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fdebug-prefix-map=/build/pdl-2.018=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DVERSION=\"1.32\" -DXS_VERSION=\"1.32\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.26/CORE" Proj.c
In file included from Proj.xs:37:0:
/usr/include/projects.h:161:40: error: conflicting types for 'UV'
typedef struct { double u, v; } UV;
^~
In file included from Proj.xs:22:0:
/usr/lib/x86_64-linux-gnu/perl/5.26/CORE/perl.h:1655:16: note: previous declaration of 'UV' was here
typedef UVTYPE UV;
^~
projects.h is an internal API that PDL shouldn't use, this along with the other old APIs will be removed from the upcoming releases. See the NEWS file details.
For background, we have wrestled with the deprecation of projects.h before in #299, which was triggered by Proj 4.8.0. I am open to suggestions from people that actually use Proj on whether we should shift all support to Proj 5.0 or whether we need to include legacy support for Proj 4. Bas' referenced NEWS file says that projects.h will be removed in PROJ 6.0.0, and proj_api.h will be removed in PROJ 7.0.0.
I would add support for the new API and use it when building with Proj >= 5.0.0, leave the current code for users building with older Proj 4.x releases.
5.0.0 is not final yet, and the developers are very receptive to feedback. If there is something you need in the new API I'm sure they'll help get it implemented.
Note that Geo::Proj4 has exactly the same issue, so there is quite a bit of demand to make Proj 5.0.0 also work for Perl projects.
With the renamed typedef in proj (Avoid XY, LP and UV datatype clashes with other libraries. ) PDL not longer fails to build.
That resolves this issue for the most part. PDL still needs to be updated to use the new API.
This matter will now be tracked at https://github.com/PDLPorters/pdl/issues/230