[Mobilitydb-dev] FW: First build for both PostGIS 2.5.5 and 3.1.3 !

Esteban Zimanyi estebanzimanyi at gmail.com
Wed Sep 1 04:51:54 PDT 2021


Dear Regina

As promissed I implemented a variable to pass to cmake to select the
PostGIS version

$ cmake ..

[...]
-- Several PostGIS versions found: Selecting /usr/local/pgsql/13/lib/
postgis-2.5.so
-- Found POSTGIS: /usr/local/pgsql/13/lib/postgis-2.5.so (found version
"2.5.5")
-- POSTGIS_LIBRARY: /usr/local/pgsql/13/lib/postgis-2.5.so
-- POSTGIS_CONTROL: /usr/local/pgsql/13/share/extension/postgis.control
-- POSTGIS_VERSION: 2.5.5
-- POSTGIS_VERSION_STR: PostGIS 2.5.5
[...]

$ cmake -DPOSTGIS_REQUIRED_VERSION=2.5 ..

[...]
-- Selecting requested PostGIS version: Selecting postgis-2.5
-- Found POSTGIS: /usr/local/pgsql/13/lib/postgis-2.5.so (found version
"2.5.5")
-- POSTGIS_LIBRARY: /usr/local/pgsql/13/lib/postgis-2.5.so
-- POSTGIS_CONTROL: /usr/local/pgsql/13/share/extension/postgis.control
-- POSTGIS_VERSION: 2.5.5
-- POSTGIS_VERSION_STR: PostGIS 2.5.5
[...]

Thanks for the pointer to QGIS, I was already basing our FindGEOS on
theirs, and I needed to modify it since the first line does apply to us

INCLUDE (${CMAKE_SOURCE_DIR}/cmake/MacPlistMacros.cmake)

I will take again theirs and introduce the minimal required modifications.

Regards

Esteban

------------------------------------------------------------
Prof. Esteban Zimanyi
Department of Computer & Decision Engineering  (CoDE) CP 165/15
Universite Libre de Bruxelles
Avenue F. D. Roosevelt 50
B-1050 Brussels, Belgium
fax: + 32.2.650.47.13
tel: + 32.2.650.31.85
e-mail: esteban.zimanyi at ulb.be
Internet: http://cs.ulb.ac.be/members/esteban/
------------------------------------------------------------


On Tue, Aug 31, 2021 at 9:10 PM Regina Obe <lr at pcorp.us> wrote:

> Sorry forgot to add to mailing list.
>
>
>
> *From:* Regina Obe [mailto:lr at pcorp.us]
> *Sent:* Tuesday, August 31, 2021 3:09 PM
> *To:* 'Esteban Zimanyi' <estebanzimanyi at gmail.com>
> *Subject:* RE: [Mobilitydb-dev] First build for both PostGIS 2.5.5 and
> 3.1.3 !
>
>
>
> It looks for the geos-config file
>
>
>
>
> https://git.osgeo.org/gitea/postgis/postgis/src/branch/master/configure.ac#L672
>
>
>
>
> https://git.osgeo.org/gitea/postgis/postgis/src/branch/master/configure.ac#L704
>
>
>
> I wouldn’t suggest doing it that way.
>
>
>
>
>
> Might make more sense to follow how QGIS does it if you aren’t already
> since they have logic for a lot of platforms.
>
>
>
> https://github.com/qgis/QGIS/blob/master/cmake/FindGEOS.cmake
>
>
>
> I personally haven’t tried to compile QGIS but given the number of people
> that do, I’m sure it’s very well tested across many platforms.
>
>
>
> Anyway don’t worry about it too much.  It looks like I should be able to
> pass in the GEOS_LIBRARY path the way you have it.  I’ll give that a try
> next.
>
>
>
> Thanks.
>
> Regina
>
>
>
>
>
> *From:* Esteban Zimanyi [mailto:estebanzimanyi at gmail.com
> <estebanzimanyi at gmail.com>]
> *Sent:* Tuesday, August 31, 2021 2:37 PM
> *To:* Regina Obe <lr at pcorp.us>
> *Subject:* Re: [Mobilitydb-dev] First build for both PostGIS 2.5.5 and
> 3.1.3 !
>
>
>
> Thanks Regina for taking over so quickly !
>
>
>
> I can work tomorrow on this, I will try to add a parameter to include the
> version and will remove the extra check I have tentatively put to ensure a
> single version of PostGIS.
>
>
>
> Regarding the second issue, maybe you could look at how PostGIS looks for
> GEOS. Alas I do not yet understand the configuration language used in
> PostGIS for doing that.
>
>
>
> Regards
>
>
>
> Esteban
>
>
>
>
> ------------------------------------------------------------
> Prof. Esteban Zimanyi
> Department of Computer & Decision Engineering  (CoDE) CP 165/15
> Universite Libre de Bruxelles
> Avenue F. D. Roosevelt 50
> B-1050 Brussels, Belgium
> fax: + 32.2.650.47.13
> tel: + 32.2.650.31.85
> e-mail: esteban.zimanyi at ulb.be
> Internet: http://cs.ulb.ac.be/members/esteban/
> ------------------------------------------------------------
>
>
>
>
>
> On Tue, Aug 31, 2021 at 8:27 PM Regina Obe <lr at pcorp.us> wrote:
>
> I’m still having trouble compiling against this branch.
>
>
>
> The first issue is:
> https://github.com/MobilityDB/MobilityDB/blob/towards-postgis3/cmake/FindPOSTGIS.cmake#L25
>
>
> Is looking for a .so file.  On windows that would be .dll  and on Mac I
> forget the extension
>
>
>
> file(GLOB POSTGIS_LIBRARY "${POSTGRESQL_DYNLIB_DIR}/postgis-*.so")
>
>
>
> If I change to
>
>
>
> file(GLOB POSTGIS_LIBRARY "${POSTGRESQL_DYNLIB_DIR}/postgis-*.*")
>
>
>
>
>
> It detects but then gives a message:
>
>
>
> CMake Error at cmake/FindPOSTGIS.cmake:31 (message):
>
>   Several versions of the PostGIS library have been found
>
>
>
>
>
> Yes I do have several versions of PostGIS installed in the same instance.
> So this might be more of an issue for me than anyone else.
>
> Is there a way to pass via CMake specify the version of PostGIS to use?
>
>
>
> After hard-coding the path of postgis lib and changing my postgis.control
> (to match the one I hard-coded)
>
>
>
> I got to this point:
>
>
>
> -- LITTLE_ENDIAN
>
> GEOS_INCLUDE_DIR=C:/ming64gcc81/projects/geos/rel-3.9w64gcc81/include
>
> GEOS_LIBRARY=
>
> CMake Error at cmake/FindGEOS.cmake:115 (MESSAGE):
>
>   Could not find GEOS.  Perhaps try:
>
>
>
>   $ sudo apt-get install libgeos++-dev
>
>
>
>
>
> I’m checking to see what I missed here.  Might be a missing lib path I
> didn’t pass in.
>
>
>
> Thanks,
>
> Regina
>
>
>
> *From:* Mobilitydb-dev [mailto:mobilitydb-dev-bounces at lists.osgeo.org] *On
> Behalf Of *Esteban Zimanyi
> *Sent:* Friday, August 27, 2021 9:29 AM
> *To:* mobilitydb-dev at lists.osgeo.org
> *Subject:* [Mobilitydb-dev] First build for both PostGIS 2.5.5 and 3.1.3 !
>
>
>
> I was able to produce a first build that works for both PostGIS 2.5.5 and
> 3.1.3. This is great news since we have been waiting for almost two years
> to be able to make MobilityDB work with PostGIS 3 !
>
>
>
> The build is in the branch
>
> https://github.com/MobilityDB/MobilityDB/tree/towards-postgis3
>
> There is still one test (51_tpoint.test.sql) that gives different results
> in version 3.1.3. The reason may be that the lwgeom_hash function was
> changed in version 3.1.3. I will look at this in the forthcoming days.
>
>
>
> The source files of the PostGIS directories liblwgeom, libpgcommon, and
> ryu were copied into the directory MobilityDB/postgis, in addition to the
> two files postgis_config.h and postgis_revision.h. Minimal changes were
> done to these files, basically removing static keywords for the
> functions getSRSbySRID, getSRIDbySRS and circ_tree_distance_tree_internal
> so that they can be called by MobilityDB.
>
>
>
> The basic idea of the build is that if a PostGIS version less than 3.0 is
> found, then library liblwgeom.so is loaded. Otherwise, the directory
> MobilityDB/postgis is added to the build.
>
>
>
> Please notice that this is still a proof-of-concept build. Indeed, I first
> built PostGIS 3.1.3 in my machine and therefore this build generated the
> right parameters for the files postgis_config.h and postgis_revision.h that
> are embedded in MobilityDB/postgis. This concerns in particular the setting
> of the machine endian constant. Therefore, we need to replicate in
> MobilityDB some of the configuration PostGIS makes in order to produce the
> right postgis_config.h and postgis_revision.h according to the machine
> characteristics at hand. I will work on that in the forthcoming days.
>
>
>
> Esteban
>
>
>
> _______________________________________________
> Mobilitydb-dev mailing list
> Mobilitydb-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mobilitydb-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mobilitydb-dev/attachments/20210901/f35fb715/attachment-0001.html>


More information about the Mobilitydb-dev mailing list