[gdal-dev] installing gdal in CentOS

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] installing gdal in CentOS

Thomas Gertin-2
Hello,

Does anybody know how to install gdal in CentOS?

Thanks,

Tom

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Sebastiaan Couwenberg
On 3/21/19 11:02 PM, Thomas Gertin wrote:
> Does anybody know how to install gdal in CentOS?

From EPEL:

 https://fedoraproject.org/wiki/EPEL

Or use the spec as inspiration for building it yourself:

 https://src.fedoraproject.org/cgit/rpms/gdal.git/tree/

Kind Regards,

Bas

--
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Markus Neteler
In reply to this post by Thomas Gertin-2
Hi,

On Fri, Mar 22, 2019 at 12:02 AM Thomas Gertin <[hidden email]> wrote:
>
> Hello,
>
> Does anybody know how to install gdal in CentOS?

While Fedora EPEL7 only offers a GDAL 1.x package, I am trying to
compile GDAL 2.3 in order to provide it as a RPM package:

https://copr.fedorainfracloud.org/coprs/neteler/GDAL/

However, compilation is still struggling with the pdf/ driver:

https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00875120-gdal/builder-live.log
[...]

make[2]: Entering directory `/builddir/build/BUILD/gdal-2.3.2-fedora/frmts/pdf'
/bin/sh /builddir/build/BUILD/gdal-2.3.2-fedora/libtool --mode=compile
--silent --tag=CXX g++ -std=c++11
-I/builddir/build/BUILD/gdal-2.3.2-fedora/port
-I/builddir/build/BUILD/gdal-2.3.2-fedora/gcore
-I/builddir/build/BUILD/gdal-2.3.2-fedora/alg
-I/builddir/build/BUILD/gdal-2.3.2-fedora/ogr
-I/builddir/build/BUILD/gdal-2.3.2-fedora/ogr/ogrsf_frmts
-I/builddir/build/BUILD/gdal-2.3.2-fedora/gnm
-I/builddir/build/BUILD/gdal-2.3.2-fedora/apps
-DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic
-fpic -I/usr/include/libgeotiff -I/usr/include/tirpc  -Wall -Wextra
-Winit-self -Wunused-parameter -Wformat -Werror=format-security
-Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla
-Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual
-fno-operator-names -Wzero-as-null-pointer-constant  -I../vrt -I../mem
-I../../ogr/ogrsf_frmts/mem -DGNM_ENABLED -I/usr/include/libgeotiff
-I/usr/include/tirpc -I/builddir/build/BUILD/gdal-2.3.2-fedora/port
-I/usr/include/openjpeg-2.3   -I/usr/include -Iexternal/include
-I/usr/include/cfitsio  -DGDAL_COMPILATION -DHAVE_XERCES
-I/usr/include -I/usr/include/xercesc -I/usr/include/libgeotiff
-I/usr/include/tirpc -I/builddir/build/BUILD/gdal-2.3.2-fedora/port
-I/usr/include/openjpeg-2.3   -I/usr/include -Iexternal/include
-I/usr/include/cfitsio  -DGDAL_COMPILATION -DHAVE_POPPLER
-DPOPPLER_HAS_OPTCONTENT -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS
-DPOPPLER_0_20_OR_LATER -DPOPPLER_0_23_OR_LATER -I/usr/include
-I/usr/include/poppler   -DDO_NOT_USE_DEBUG_BOOL -c -o
../o/pdfdataset.lo pdfdataset.cpp
/bin/sh /builddir/build/BUILD/gdal-2.3.2-fedora/libtool --mode=compile
--silent --tag=CXX g++ -std=c++11 -DHAVE_AVX_AT_COMPILE_TIME
-DHAVE_SSSE3_AT_COMPILE_TIME -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic
-fpic -I/usr/include/libgeotiff -I/usr/include/tirpc  -Wall -Wextra
-Winit-self -Wunused-parameter -Wformat -Werror=format-security
-Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla
-Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual
-fno-operator-names -Wzero-as-null-pointer-constant  -I. -I.. -I../..
-DGNM_ENABLED -I/usr/include/libgeotiff -I/usr/include/tirpc
-I/builddir/build/BUILD/gdal-2.3.2-fedora/port
-I/usr/include/openjpeg-2.3   -I/usr/include -Iexternal/include
-I/usr/include/cfitsio  -DGDAL_COMPILATION -DHAVE_XERCES
-I/usr/include -I/usr/include/xercesc -I/usr/include/libgeotiff
-I/usr/include/tirpc -I/builddir/build/BUILD/gdal-2.3.2-fedora/port
-I/usr/include/openjpeg-2.3   -I/usr/include -Iexternal/include
-I/usr/include/cfitsio  -DGDAL_COMPILATION -c -o ../../o/cadobjects.lo
cadobjects.cpp
pdfdataset.cpp: In member function 'void PDFDataset::FindLayersPoppler()':
pdfdataset.cpp:3444:31: error: no matching function for call to
'begin(GooList* const&)'
         for (const auto &oc : ocgList) {
                               ^
pdfdataset.cpp:3444:31: note: candidates are:
In file included from /usr/include/c++/4.8.2/string:51:0,
                 from /usr/include/c++/4.8.2/stdexcept:39,
                 from /usr/include/c++/4.8.2/array:38,
                 from /usr/include/c++/4.8.2/tuple:39,
                 from /usr/include/c++/4.8.2/bits/stl_map.h:63,
                 from /usr/include/c++/4.8.2/map:61,
                 from gdal_pdf.h:46,
                 from pdfdataset.cpp:36:
/usr/include/c++/4.8.2/bits/range_access.h:87:5: note: template<class
_Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^
/usr/include/c++/4.8.2/bits/range_access.h:87:5: note:   template
argument deduction/substitution failed:
pdfdataset.cpp:3444:31: note:   mismatched types '_Tp [_Nm]' and
'GooList* const'
         for (const auto &oc : ocgList) {
                               ^
In file included from /usr/include/c++/4.8.2/string:51:0,
                 from /usr/include/c++/4.8.2/stdexcept:39,
                 from /usr/include/c++/4.8.2/array:38,
                 from /usr/include/c++/4.8.2/tuple:39,
                 from /usr/include/c++/4.8.2/bits/stl_map.h:63,
                 from /usr/include/c++/4.8.2/map:61,
                 from gdal_pdf.h:46,
                 from pdfdataset.cpp:36:
/usr/include/c++/4.8.2/bits/range_access.h:58:5: note: template<class
_Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^
/usr/include/c++/4.8.2/bits/range_access.h:58:5: note:   template
argument deduction/substitution failed:
/usr/include/c++/4.8.2/bits/range_access.h: In substitution of
'template<class _Container> decltype (__cont.begin()) std::begin(const
_Container&) [with _Container = GooList*]':
pdfdataset.cpp:3444:31:   required from here
/usr/include/c++/4.8.2/bits/range_access.h:58:5: error: request for
member 'begin' in '__cont', which is of pointer type 'GooList* const'
(maybe you meant to use '->' ?)
/usr/include/c++/4.8.2/bits/range_access.h:48:5: note: template<class
_Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^
[...]

Any hints for that?

thanks
Markus

--
Markus Neteler, PhD
https://www.mundialis.de - free data with free software
https://grass.osgeo.org
https://courses.neteler.org/blog
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Even Rouault-2
On lundi 1 avril 2019 13:10:37 CEST Markus Neteler wrote:

> Hi,
>
> On Fri, Mar 22, 2019 at 12:02 AM Thomas Gertin <[hidden email]> wrote:
> > Hello,
> >
> > Does anybody know how to install gdal in CentOS?
>
> While Fedora EPEL7 only offers a GDAL 1.x package, I am trying to
> compile GDAL 2.3 in order to provide it as a RPM package:
>
> https://copr.fedorainfracloud.org/coprs/neteler/GDAL/
>
> However, compilation is still struggling with the pdf/ driver:

Hum, your GDAL 2.3.2 is definitely a patched version from the official one
since the official one at line
https://github.com/OSGeo/gdal/blob/v2.3.2/gdal/frmts/pdf/pdfdataset.cpp#L3444
has

for(int i=0;i<ocgList->getLength();i++)

and not

for (const auto &oc : ocgList) {

It looks like your GDAL copy might have some special patch that was designed
to support for a later version of Poppler on recent Fedora than the one you're
using (0.26) on RHEL7, but dropping support for older versions as well.
Perhaps you should just drop that specific patch for the RHEL7 context.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Markus Neteler
On Mon, Apr 1, 2019 at 2:36 PM Even Rouault <[hidden email]> wrote:
> On lundi 1 avril 2019 13:10:37 CEST Markus Neteler wrote:
> > While Fedora EPEL7 only offers a GDAL 1.x package, I am trying to
> > compile GDAL 2.3 in order to provide it as a RPM package:
> >
> > https://copr.fedorainfracloud.org/coprs/neteler/GDAL/
> >
> > However, compilation is still struggling with the pdf/ driver:
>
> Hum, your GDAL 2.3.2 is definitely a patched version from the official one
[...]
> It looks like your GDAL copy might have some special patch that was designed
> to support for a later version of Poppler on recent Fedora than the one you're
> using (0.26) on RHEL7, but dropping support for older versions as well.
> Perhaps you should just drop that specific patch for the RHEL7 context.

Right, this helped. The use of the poppler patch is now
conditionalized (Fedora only).

Now I am stuck at
...

     [exec]   adding: java/org/gdal/gdal/BuildVRTOptions.html (deflated 78%)
     [exec]   adding: java/org/gdal/gdal/Band.html (deflated 90%)
     [copy] Copying 1 file to
/builddir/build/BUILD/gdal-2.3.2-fedora/swig/java/build/maven
     [copy] Copying 1 file to
/builddir/build/BUILD/gdal-2.3.2-fedora/swig/java/build/maven
      [jar] Building jar:
/builddir/build/BUILD/gdal-2.3.2-fedora/swig/java/build/maven/gdal-2.3.2-javadoc.jar
      [jar] Building jar:
/builddir/build/BUILD/gdal-2.3.2-fedora/swig/java/build/maven/gdal-2.3.2-sources.jar

BUILD SUCCESSFUL
Total time: 10 seconds
+ popd
+ %mvn_artifact swig/java/build/maven/gdal-2.3.2.pom
swig/java/build/maven/gdal-2.3.2.jar
~/build/BUILD/gdal-2.3.2-fedora
/var/tmp/rpm-tmp.R4QpDm: line 139: fg: no job control
error: Bad exit status from /var/tmp/rpm-tmp.R4QpDm (%build)
....

Unfortunately I am not familiar with swig/java/ - help would be
appreciated. This is the new log:

https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876255-gdal/builder-live.log

thanks
Markus
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Andrew C Aitchison-2
On Mon, 1 Apr 2019, Markus Neteler wrote:

> Now I am stuck at
> ...
>
> BUILD SUCCESSFUL
> Total time: 10 seconds
> + popd
> + %mvn_artifact swig/java/build/maven/gdal-2.3.2.pom
> swig/java/build/maven/gdal-2.3.2.jar
> ~/build/BUILD/gdal-2.3.2-fedora
> /var/tmp/rpm-tmp.R4QpDm: line 139: fg: no job control
> error: Bad exit status from /var/tmp/rpm-tmp.R4QpDm (%build)
> ....

That is probably a bug in the rpm .spec file
     https://www.redhat.com/archives/rpm-list/2002-October/msg00271.html
suggests that it is a % character being passed to the shell.

--
Andrew C. Aitchison Cambridge, UK
  [hidden email]
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Markus Neteler
On Mon, Apr 1, 2019 at 11:17 PM Andrew C Aitchison
<[hidden email]> wrote:

> On Mon, 1 Apr 2019, Markus Neteler wrote:
> > Now I am stuck at
> > ...
> >
> > BUILD SUCCESSFUL
> > Total time: 10 seconds
> > + popd
> > + %mvn_artifact swig/java/build/maven/gdal-2.3.2.pom
> > swig/java/build/maven/gdal-2.3.2.jar
> > ~/build/BUILD/gdal-2.3.2-fedora
> > /var/tmp/rpm-tmp.R4QpDm: line 139: fg: no job control
> > error: Bad exit status from /var/tmp/rpm-tmp.R4QpDm (%build)
> > ....
>
> That is probably a bug in the rpm .spec file
>      https://www.redhat.com/archives/rpm-list/2002-October/msg00271.html
> suggests that it is a % character being passed to the shell.

Thanks Andrew,

I made further attempts but I am stuck.
Maybe the Python-3 support needs to be kicked out as well?

The current state is here
https://copr.fedorainfracloud.org/coprs/neteler/GDAL/build/876548/
- SPEC file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/gdal.spec
- Log file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/builder-live.log

I'll continue with low priority, happily accepting support by
more-than-me SPEC file experts.

Best,
Markus
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Markus Metz-3


On Fri, Apr 5, 2019 at 3:38 PM Markus Neteler <[hidden email]> wrote:

>
> On Mon, Apr 1, 2019 at 11:17 PM Andrew C Aitchison
> <[hidden email]> wrote:
> > On Mon, 1 Apr 2019, Markus Neteler wrote:
> > > Now I am stuck at
> > > ...
> > >
> > > BUILD SUCCESSFUL
> > > Total time: 10 seconds
> > > + popd
> > > + %mvn_artifact swig/java/build/maven/gdal-2.3.2.pom
> > > swig/java/build/maven/gdal-2.3.2.jar
> > > ~/build/BUILD/gdal-2.3.2-fedora
> > > /var/tmp/rpm-tmp.R4QpDm: line 139: fg: no job control
> > > error: Bad exit status from /var/tmp/rpm-tmp.R4QpDm (%build)
> > > ....
> >
> > That is probably a bug in the rpm .spec file
> >      https://www.redhat.com/archives/rpm-list/2002-October/msg00271.html
> > suggests that it is a % character being passed to the shell.
>
> Thanks Andrew,
>
> I made further attempts but I am stuck.
> Maybe the Python-3 support needs to be kicked out as well?
>
> The current state is here
> https://copr.fedorainfracloud.org/coprs/neteler/GDAL/build/876548/
> - SPEC file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/gdal.spec
> - Log file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/builder-live.log

In the log, there is

  File "/usr/lib/python3.6/site-packages/copr_rpmbuild/builders/mock.py", line 40, in run

where is python 3.6 with /usr/lib/python3.6/site-packages/ coming from in your build environment? Centos 7 comes with python 3.4 and gdal uses on Centos 7 python -> python2. Maybe you need to drop this custom python3.6 installation. I never had any problems compiling gdal 2.x on derivates of RHEL 7.

Markus M

>
> I'll continue with low priority, happily accepting support by
> more-than-me SPEC file experts.
>
> Best,
> Markus
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Markus Neteler
On Sun, Apr 7, 2019 at 9:57 PM Markus Metz
<[hidden email]> wrote:
> On Fri, Apr 5, 2019 at 3:38 PM Markus Neteler <[hidden email]> wrote:
...

> > The current state is here
> > https://copr.fedorainfracloud.org/coprs/neteler/GDAL/build/876548/
> > - SPEC file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/gdal.spec
> > - Log file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/builder-live.log
>
> In the log, there is
>
>   File "/usr/lib/python3.6/site-packages/copr_rpmbuild/builders/mock.py", line 40, in run
>
> where is python 3.6 with /usr/lib/python3.6/site-packages/ coming from in your build environment?

That is the Fedora COPR system....

> Centos 7 comes with python 3.4 and gdal uses on Centos 7 python -> python2. Maybe you need to drop this custom python3.6 installation. I never had any problems compiling gdal 2.x on derivates of RHEL 7.

AFAIK I have no possibilities to change COPR itself but can only
modify the SPEC file and build it there.

Best,
markusN
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: installing gdal in CentOS

Andrew C Aitchison-2
In reply to this post by Markus Neteler
On Fri, 5 Apr 2019, Markus Neteler wrote:

> On Mon, Apr 1, 2019 at 11:17 PM Andrew C Aitchison
> <[hidden email]> wrote:
>> On Mon, 1 Apr 2019, Markus Neteler wrote:
>>> Now I am stuck at
>>> ...
>>>
>>> BUILD SUCCESSFUL
>>> Total time: 10 seconds
>>> + popd
>>> + %mvn_artifact swig/java/build/maven/gdal-2.3.2.pom
>>> swig/java/build/maven/gdal-2.3.2.jar
>>> ~/build/BUILD/gdal-2.3.2-fedora
>>> /var/tmp/rpm-tmp.R4QpDm: line 139: fg: no job control
>>> error: Bad exit status from /var/tmp/rpm-tmp.R4QpDm (%build)
>>> ....
>>
>> That is probably a bug in the rpm .spec file
>>      https://www.redhat.com/archives/rpm-list/2002-October/msg00271.html
>> suggests that it is a % character being passed to the shell.
>
> Thanks Andrew,
>
> I made further attempts but I am stuck.
> Maybe the Python-3 support needs to be kicked out as well?
>
> The current state is here
> https://copr.fedorainfracloud.org/coprs/neteler/GDAL/build/876548/
> - SPEC file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/gdal.spec
> - Log file: https://copr-be.cloud.fedoraproject.org/results/neteler/GDAL/epel-7-x86_64/00876548-gdal/builder-live.log

Towards the end your log file has
  + pushd swig/python
  ~/build/BUILD/gdal-2.3.2-fedora
  ~/build/BUILD/gdal-2.3.2-fedora/swig/python
  ~/build/BUILD/gdal-2.3.2-fedora
  + %py3_build
  /var/tmp/rpm-tmp.mcNaiW: line 136: fg: no job control

First, it might be useful to have /var/tmp/rpm-tmp.mcNaiW (or whatever
name this gets next time you build) as well as the log file.

Second, this means that your .spec calls
  %py3_build
without first defining it:
  552-# Make Python modules
  553-pushd swig/python
  554-  %{?with_python2:%py2_build}
  555:  %{?with_python3:%py3_build}
  556-popd

I only have RedHat/CentOS/SL 6, not 7 and
  grep -r py3_build /usr/lib/rpm
shows nothing. Does py3_build exist in your rpm tree,
or is it part of COPR ?

--
Andrew C. Aitchison Cambridge, UK
  [hidden email]
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev