[QGIS-Developer] Help fixing code for gcc 4.8

Henrik K hege at hege.li
Thu May 23 04:05:07 PDT 2019


Ok I caved in and installed devtoolset-8-gcc-c++ (8.2.1) from SCL
repository.

I recompiled our whole mapserver/gdal/proj/geos/etc stack with it. Works fine.

Compiled QGis 3.4.8, no problems! (aside from some python-specific stuff)

Also the feature of devtoolset is automatically linking non-system stuff
statically, so resulting binaries have no dependencies to devtoolset and can
be shipped to other servers.

I suggest documenting somewhere that atleast gcc 4.8 is not supported
anymore.

Cheers,
Henrik


On Thu, May 23, 2019 at 11:13:07AM +0300, Henrik K wrote:
> 
> I've no problem fixing minor brace stuff here locally..
> 
> Do you have any ideas for the QString/QStringList stuff in
> qgswmsrenderer.cpp?
> 
> It seems I may need to install redhat developer repository to access gcc
> 8.2, or perhaps even compile my own gcc.  But it would be shame, since
> pretty much all software I've ever needed compiles fine with the defaut
> toolset with perhaps minor fixes.  I'm hoping qgis can still be done.
> 
> Cheers,
> Henrik
> 
> 
> On Thu, May 23, 2019 at 09:46:54AM +0200, Alessandro Pasotti wrote:
> > 
> > Henrik,
> > 
> > I'm afraid you will have an hard time: we are using more and more C++11 list
> > initialization (aka brace initialization)  in the code,
> > if your compiler do not support it well, you will get a lot of errors.
> > 
> > That said if it's just that single line that blocks your porting feel free to
> > make a pull request to change it.
> > 
> > You may also try to remove "auto":
> > const QgsLayerTreeLayer* treeLayer { static_cast<const QgsLayerTreeLayer *>(
> > childNode ) };
> > 
> > 
> > for some background:
> > 
> > [1]https://stackoverflow.com/questions/18222926/
> > why-is-list-initialization-using-curly-braces-better-than-the-alternatives
> > [2]http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-list
> > 
> > an "amusing" read:
> > [3]http://mikelui.io/2019/01/03/seriously-bonkers.html
> > 
> > 
> > 
> > On Thu, May 23, 2019 at 9:01 AM Henrik K <[4]hege at hege.li> wrote:
> > 
> > 
> >     I'm almost near finishing, but qgswmsrenderer.cpp is throwing a lot of
> >     errors (for bot 3.4.8 and 3.6.3).  Could someone have a look at this:
> > 
> >     [5]https://pastebin.com/JS7uKAZ7
> > 
> >     The two expression errors there I fixed per previous advice..
> >     const auto { } -> ( )
> > 
> >     Cheers,
> >     Henrik
> > 
> > 
> >     On Wed, May 22, 2019 at 10:50:47AM -0700, Elias Carter wrote:
> >     > > But if I manage to get this running I'll post all my patches somewhere.
> >     >
> >     > Hi Henrik,
> >     > I would be interested in collaborating with you to get QGIS 3 running on
> >     RHEL/
> >     > CentOS 7.
> >     > Would you be willing to share your current patchset and maybe I can help
> >     out
> >     > with getting this working?
> >     >
> >     > Thanks,
> >     > Elias
> >     >
> >     >
> >     > On Wed, May 22, 2019 at 10:40 AM Henrik Krohns <[1][6]hege at hege.li>
> >     wrote:
> >     >
> >     >
> >     >     Thanks, it worked, so simple..
> >     >
> >     >     Are fixes like this good canditate to actually raise an issue? I have
> >     no
> >     >     clue
> >     >     on all the C++ versions etc and what stuff is legacy not intended to
> >     use
> >     >     these days..
> >     >
> >     >     But if I manage to get this running I'll post all my patches
> >     somewhere.
> >     >
> >     >     On Wed, May 22, 2019 at 05:40:45PM +0200, Alessandro Pasotti wrote:
> >     >     >
> >     >     > Hi Henrik,
> >     >     >
> >     >     > Try to replace {} with (), such as:
> >     >     >
> >     >     > const auto treeLayer ( static_cast<const QgsLayerTreeLayer *>(
> >     childNode
> >     >     ) );
> >     >     >
> >     >     >
> >     >     >
> >     >     > On Wed, May 22, 2019 at 4:42 PM Henrik Krohns <[1][2][7]
> >     hege at hege.li> wrote:
> >     >     >
> >     >     >
> >     >     >     Hello,
> >     >     >
> >     >     >     I've been trying to compile QGis on RHEL7 / GCC 4.8.5 all day. 
> >     It
> >     >     seems
> >     >     >     lots of code assume newer compiler.  I've fixed many cases
> >     already,
> >     >     but
> >     >     >     here's something I can't manage..  not really proficient in
> >     C++..
> >     >     >
> >     >     >     src/server/services/wms/qgswmsgetcapabilities.cpp: In function
> >     'bool
> >     >     >     QgsWms::hasQueryableChildren(const QgsLayerTreeNode*, const
> >     >     QStringList&)':
> >     >     >     src/server/services/wms/qgswmsgetcapabilities.cpp:1893:31:
> >     error:
> >     >     base
> >     >     >     operand of '->' has non-pointer type 'const
> >     std::initializer_list
> >     >     <const
> >     >     >     QgsLayerTreeLayer* const>'
> >     >     >            const auto l { treeLayer->layer() };
> >     >     >                                    ^
> >     >     >     src/server/services/wms/qgswmsgetcapabilities.cpp:1893:41:
> >     error:
> >     >     unable to
> >     >     >     deduce 'const std::initializer_list<const auto>' from '
> >     {<expression
> >     >     error>}
> >     >     >     '
> >     >     >            const auto l { treeLayer->layer() };
> >     >     >
> >     >     >     The code..
> >     >     >
> >     >     >         else if ( childNode->nodeType() ==
> >     QgsLayerTreeNode::NodeLayer )
> >     >     >         {
> >     >     >           const auto treeLayer { static_cast<const
> >     QgsLayerTreeLayer *>(
> >     >     >     childNode ) };
> >     >     >           const auto l { treeLayer->layer() };
> >     >     >           return ! wmsRestrictedLayers.contains( l->name() ) && l->
> >     flags
> >     >     >     ().testFlag( QgsMapLayer::Identifiable );
> >     >     >
> >     >     >     Any ideas how to rewrite?
> >     >     >
> >     >     >     Cheers,
> >     >     >     Henrik
> >     >     >
> >     >     >     _______________________________________________
> >     >     >     QGIS-Developer mailing list
> >     >     >     [2][3][8]QGIS-Developer at lists.osgeo.org
> >     >     >     List info: [3][4][9]https://lists.osgeo.org/mailman/listinfo/
> >     >     qgis-developer
> >     >     >     Unsubscribe: [4][5][10]https://lists.osgeo.org/mailman/listinfo
> >     /
> >     >     qgis-developer
> >     >     >
> >     >     >
> >     >     >
> >     >     > --
> >     >     > Alessandro Pasotti
> >     >     > w3:   [5][6][11]www.itopen.it
> >     >     >
> >     >     > References:
> >     >     >
> >     >     > [1] mailto:[7][12]hege at hege.li
> >     >     > [2] mailto:[8][13]QGIS-Developer at lists.osgeo.org
> >     >     > [3] [9][14]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     >     > [4] [10][15]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     >     > [5] [11][16]http://www.itopen.it/
> >     >     _______________________________________________
> >     >     QGIS-Developer mailing list
> >     >     [12][17]QGIS-Developer at lists.osgeo.org
> >     >     List info: [13][18]https://lists.osgeo.org/mailman/listinfo/
> >     qgis-developer
> >     >     Unsubscribe: [14][19]https://lists.osgeo.org/mailman/listinfo/
> >     qgis-developer
> >     >
> >     >
> >     > References:
> >     >
> >     > [1] mailto:[20]hege at hege.li
> >     > [2] mailto:[21]hege at hege.li
> >     > [3] mailto:[22]QGIS-Developer at lists.osgeo.org
> >     > [4] [23]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     > [5] [24]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     > [6] [25]http://www.itopen.it/
> >     > [7] mailto:[26]hege at hege.li
> >     > [8] mailto:[27]QGIS-Developer at lists.osgeo.org
> >     > [9] [28]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     > [10] [29]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     > [11] [30]http://www.itopen.it/
> >     > [12] mailto:[31]QGIS-Developer at lists.osgeo.org
> >     > [13] [32]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     > [14] [33]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     _______________________________________________
> >     QGIS-Developer mailing list
> >     [34]QGIS-Developer at lists.osgeo.org
> >     List info: [35]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >     Unsubscribe: [36]https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > 
> > 
> > 
> > --
> > Alessandro Pasotti
> > w3:   [37]www.itopen.it
> > 
> > References:
> > 
> > [1] https://stackoverflow.com/questions/18222926/why-is-list-initialization-using-curly-braces-better-than-the-alternatives
> > [2] http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-list
> > [3] http://mikelui.io/2019/01/03/seriously-bonkers.html
> > [4] mailto:hege at hege.li
> > [5] https://pastebin.com/JS7uKAZ7
> > [6] mailto:hege at hege.li
> > [7] mailto:hege at hege.li
> > [8] mailto:QGIS-Developer at lists.osgeo.org
> > [9] https://lists.osgeo.org/mailman/listinfo/
> > [10] https://lists.osgeo.org/mailman/listinfo/
> > [11] http://www.itopen.it/
> > [12] mailto:hege at hege.li
> > [13] mailto:QGIS-Developer at lists.osgeo.org
> > [14] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [15] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [16] http://www.itopen.it/
> > [17] mailto:QGIS-Developer at lists.osgeo.org
> > [18] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [19] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [20] mailto:hege at hege.li
> > [21] mailto:hege at hege.li
> > [22] mailto:QGIS-Developer at lists.osgeo.org
> > [23] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [24] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [25] http://www.itopen.it/
> > [26] mailto:hege at hege.li
> > [27] mailto:QGIS-Developer at lists.osgeo.org
> > [28] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [29] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [30] http://www.itopen.it/
> > [31] mailto:QGIS-Developer at lists.osgeo.org
> > [32] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [33] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [34] mailto:QGIS-Developer at lists.osgeo.org
> > [35] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [36] https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > [37] http://www.itopen.it/
> 
> > _______________________________________________
> > QGIS-Developer mailing list
> > QGIS-Developer at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list