[gdal-dev] CMAKE poppler c++17

chris english englishchristophera at gmail.com
Thu Mar 3 16:29:14 PST 2022


Thanks Jeff.
Process details matter, I missed that Poppler source was actually at gitlab
rather than my github based clone, so rebuilt poppler, using CMAKE this
time.
[100%] Built target poppler-render
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libpoppler.so.119.0.0
-- Up-to-date: /usr/local/lib/libpoppler.so.119
-- Set runtime path of "/usr/local/lib/libpoppler.so.119.0.0" to
"/usr/local/lib"

which in the context of the patch 089f84b:
if ("${POPPLER_VERSION_MINOR}" MATCHES "0?[0-9]+")
string(REGEX REPLACE "0?([0-9]+)" "\\1" POPPLER_VERSION_MINOR
${POPPLER_VERSION_MINOR})
endif ()
if (POPPLER_VERSION_MAJOR GREATER 21)
target_compile_features(gdal_PDF PRIVATE cxx_std_17)
endif ()
target_compile_definitions(gdal_PDF PRIVATE -DHAVE_POPPLER
-DPOPPLER_MAJOR_VERSION=${POPPLER_VERSION_MAJOR}
-DPOPPLER_MINOR_VERSION=${POPPLER_VERSION_MINOR})
endif ()

and happily, 119 remains > 21, so poppler patch 089f84b worked.
Thereafter, MrSid driver cratered on some 2004 Lizardtech defines in
lt_platform.h that defined possible GCC compilers topping out at <= 5
(rather than a future unimaginable 9 or 12). Removing a desire for MrSid,
in this instance through ccmake,
Re-clone gdal and we get to this, new, somewhat indecipherable, not quite
there, but achingly close:
[ 89%] Building CXX object
gcore/mdreader/CMakeFiles/gcore_mdreader.dir/reader_spot.cpp.o
[ 89%] Built target gcore_mdreader
CMakeFiles/GDAL.dir/build.make:2661: *** target pattern contains no '%'.
Stop.
make[1]: *** [CMakeFiles/Makefile2:4871: CMakeFiles/GDAL.dir/all] Error 2

And from there I guess I will attempt to chug along.

Losing MrSid is a disappointment as the earliest USGS experimental
photogrammetry data available, albeit without sufficient viable GPCs (for
local areas as many were lost through time), was predicated on coastal
overflights related to beach erosion control efforts/federal expenses from
100 years ago. To my view, sufficient GPCs still exist within and across
the dataset, that it could serve as an historic measure, with an
appropriate eye toward the geographic basis that remaining GPCs indicate.
But it will no longer be local area, though that is what a certain client
wants.

Happily, or unhappily, my above error reveals some 8 google responses, with
none censored to show most relevant.

And, as CMAKE is our fate, and gdal is our best tool, we will endeavor to
persevere, so we can also get sf in R to load again.

Chris


On Thu, Mar 3, 2022 at 3:26 PM Jeff McKenna <jmckenna at gatewaygeomatics.com>
wrote:

> Hi Chris,
>
> I'm not sure if this is exactly related to your issue, but here are my
> thoughts:
>
> I do know that the recent poppler release relies on the C++17 standard,
> and there was a recent change in GDAL to accommodate this (see
> https://github.com/OSGeo/gdal/issues/5071 ).
>
> In my case (for the Windows / MS4W community) I had to patch GDAL 3.4.1
> for this, but in your case you might want to grab GDAL-master from git
> as that will be easier to handle the new poppler.
>
>
> -jeff
>
>
>
> --
> Jeff McKenna
> GatewayGeo: Developers of MS4W, MapServer Consulting and Training
> co-founder of FOSS4G
> http://gatewaygeo.com/
>
>
>
>
> On 2022-03-03 4:03 p.m., chris english wrote:
> > Hi,
> > I am a weak link when it comes to CMAKE. Geos-3.10.2 and PROJ-8.2.1 were
> > a breeze nonetheless.  A source build of libpoppler.so.119 via
> > ./configure went smoothly.
> >
> > I have consistently failed at ogrpdflayer (well, only four times so far)
> > on 'optional', that is a C++17 thing. <-  an example of a feeble
> > understanding of build process requirements.
> >
> > Recklessly editing lines in CMakeLists.txt:
> > 41 # check compiler and set preferences.
> > 42 set(CMAKE_CXX_STANDARD 17)
> > [ 44%] Built target gdal_STACIT
> > [ 44%] Building CXX object
> > frmts/pdf/CMakeFiles/gdal_PDF.dir/ogrpdflayer.cpp.o
> >
> > but further along we run across c++17 be contra-indicated as to
> >
> > [ 49%] Built target gdal_PostGISRaster
> > [ 49%] Building CXX object
> > frmts/dods/CMakeFiles/gdal_DODS.dir/dodsdataset2.cpp.o
> >
> > from /home/chris/gdal/frmts/dods/dodsdataset2.cpp:38:
> > /usr/local/include/libdap/RCReader.h:114:16: error: ISO C++17 does not
> > allow dynamic exception specifications
> >    114 |     RCReader() throw(Error);
> >
> > which leads to a set by individual target approach as is said to be
> > available
> >
> > set_property(TARGETtgtPROPERTYCXX_STANDARD17)
> > set_property(TARGETtgtPROPERTYCXX_STANDARD11)
> >
> > and were this the solution, what would it look like and where might it
> > reside in say
> >
> > CMakeCache.txt, or have I just gotten this all wrong, as I expect I have.
> >
> > Ubuntu 20.04, gcc-9.3.0, and happy to have broken through to 49%, but
> > wouldn't
> >
> > that's 99% good news.
> >
> > Chris
> >
> >
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220303/c5ec08f1/attachment-0001.html>


More information about the gdal-dev mailing list