<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div dir="ltr"><div>Dear Regina</div><div><br></div><div>Regarding the way we detect PostgreSQL, according to my understanding we are doing similar things as done in PostGIS. In the configure file of PostGIS 3.1.2 it is stated<br></div><div><br></div><div>  PGSQL_FULL_VERSION=`"$PG_CONFIG" --version`<br>  PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[^0-9]*\([0-9]*\).*/\1/'`<br>  PGSQL_MINOR_VERSION=`$PG_CONFIG --version | sed 's/[^0-9]*\([0-9]\)\.\([0-9]\).*/\2/'`<br></div><div><br></div><div>In our CMakeLists.txt we do</div><div><br></div><div>  execute_process(COMMAND ${PGCONFIG} --version OUTPUT_VARIABLE PG_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)<br><br></div><div>and continue stripping the major and minor versions in a less efficient way than you do. There is no problem in reusing your recipe for doing that.</div><div><br></div><div>Regarding the PostGIS issue, as I commented in your PR over github</div><div>---- (copied from github) ---</div><div><p style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px;margin-top:0px">Actually, we use <a href="http://postgis-2.5.so/" target="_blank">postgis-2.5.so</a> just to ensure the version, we don't do anything with it. I commented the following lines in the CMakeLists.txt and everything works, the tests pass without any problem.</p><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px;margin-bottom:0px">find_library(HAS_LWGEOM lwgeom)<br style="box-sizing:border-box">if (HAS_LWGEOM)<br style="box-sizing:border-box">MESSAGE(STATUS "Found LWGEOM at ${HAS_LWGEOM} - compiling with PostGIS support")<br style="box-sizing:border-box">--> if(NOT EXISTS "${PostgreSQL_EXTLIB_DIR}/<a href="http://postgis-2.5.so/" target="_blank">postgis-2.5.so</a>")<br style="box-sizing:border-box">--> message(FATAL_ERROR "Could not find <a href="http://postgis-2.5.so/" target="_blank">postgis-2.5.so</a>; only PostGIS 2.5 is currently supported")<br style="box-sizing:border-box">--> endif()<br style="box-sizing:border-box">else()<br style="box-sizing:border-box">message(FATAL_ERROR "Could not find lwgeom; ")<br style="box-sizing:border-box">endif ()</p></div><div><div>---- (copied from github) ---</div><div>we did that to avoid the use of PostGIS 3 with MobilityDB until we solve this issue (as we are discussing in the current thread). As soon as you tell us how to solve this we will change this immediately.<br></div></div><div><br></div><div>Many many thanks for your continuous support !</div><font color="#888888"><div><br></div><div>Esteban</div></font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 9, 2021 at 8:27 AM Regina Obe <<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_3693163150304469229WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">A side note, I think you need to change the way you are detecting PostgreSQL.  It just doesn’t work for me and suspect it will be an issue for anyone with multiple PostgreSQL installs or non-standard paths  – as I had mentioned here - <a href="https://github.com/MobilityDB/MobilityDB/pull/20" target="_blank">https://github.com/MobilityDB/MobilityDB/pull/20</a> .  You should be using the <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">CMAKE PostgreSQL package to detect PostgreSQL.  I always end up having to copy pgRouting code in so the PostgreSQL detection works right.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">As I recall compiling MobilityDB a while ago it has both a dependency to liblwgeom as well as the PostGIS lib.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The dependency of PostGIS lib is a little troubling as I mentioned here<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><a href="https://github.com/MobilityDB/MobilityDB/issues/16" target="_blank">https://github.com/MobilityDB/MobilityDB/issues/16</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> </span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> Even the extensions packaged with PostGIS don’t have a direct dependency to PostGIS lib just to liblwgeom.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">So not even a parallel branch will work here unless you change how you are doing things and what to change is unclear to me.  The issue with depending on PostGIS lib is we only guarantee SQL API compatibility across minor versions, not C-API.  Meaning if the function isn’t exposed via the SQL API, we don’t need to worry about it as PostgreSQL upgrade would not care as it only fails if it tries to call a function that is referenced in an SQL API function.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">That said if you must rely on PostGIS lib all your postgis.h dependencies should only be Datum ones and any others will make your code brittle to PostGIS changes.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I’m thinking for the liblwgeom dependency you should be able to use librtopo for that. Still not clear to me why you can’t, but we can discuss in dev meeting.</span><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt"> </span></p></div></div>
</blockquote></div></div>