<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On Jun 20, 2023, at 10:28 AM, Paul Ramsey <pramsey@cleverelephant.ca> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">On Jun 20, 2023, at 9:29 AM, Greg Troxel <gdt@lexort.com> wrote:<br><br>Sebastiaan Couwenberg <sebastic@xs4all.nl> writes:<br><br><blockquote type="cite">Warning message:<br>In fun(libname, pkgname) :<br>rgeos: versions of GEOS runtime 3.12.0beta2-CAPI-1.18.0<br>and GEOS at installation 3.11.1-CAPI-1.17.1differ<br></blockquote><br>Also, I found that geoe does not use the just-built library when running<br>tests, due to inadequate RPATH/LD_LIBRARY_PATH, so if you are testing<br>3.12 on a system with 3.11 installed, the tests may be running 3.11<br>code.<br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">It would be helpful if this finding were qualified with the particular platform it was found on, and the steps to reproduce, since I’ve never managed to make it happen myself, and my computer is chock full of different versions of GEOS in different places.</span><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"></div></blockquote><div><br></div><div>So what I have found in MacOS and just now trying out ArchLinux is that we are getting the default cmake behaviour, which is to set the rpath to the absolute path to the build library directory. So for example, here’s the output for ArchLinux</div><div><div><br></div><div>readelf -d ./bin/geosop | head -20</div><div><br></div></div><div><div>  Tag        Type                         Name/Value</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libgeos_c.so.1]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libgeos.so.3.12.0]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]</div><div> 0x000000000000001d (RUNPATH)            Library runpath: [/home/arch/geos/_build/lib]</div><div><br></div><div>And for MacOS</div><div><br></div><div><div>Load command 18</div><div>          cmd LC_RPATH</div><div>      cmdsize 56</div><div>         path /Users/pramsey/Code/geos-git/_build/lib (offset 12)</div></div><div><br></div><div>The internet concurs that this is the normal behaviour for cmake builds. </div><div><br></div><div>With that runpath in place, I’ve never had a problem with builds getting confused when running testing. </div><div><br></div><div>It is worth noting that on INSTALL, cmake will re-write the rpath for the installed binaries, so for example, after doing ‘make install’ on ArchLinux, the library info now has a path relative to ORIGIN.</div><div><br></div><div><div>readelf -d /usr/local/bin/geosop | head -20</div><div><br></div><div>Dynamic section at offset 0x75d50 contains 32 entries:</div><div>  Tag        Type                         Name/Value</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libgeos_c.so.1]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libgeos.so.3.12.0]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]</div><div> 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]</div><div> 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib]</div></div><div><br></div><div>I can make the linker unhappy by doing a manual move of the build directory…</div><div><br></div><div>cd ..</div><div>mv _build _build2</div><div>cd _build2</div><div>./bin/geosop</div><div><br></div><div>Since the build rpath is absolute, the rpath no longer resolves, and yes, the binaries will resolve to linking any other geos it can find on linker path. Which if you have installed some other version or have an LD_LIBRARY_PATH set pointing to some other place, will result in you “testing” something other than the contents of your ./lib directory.</div><div><br></div><div>So, the build directory is “special”, and the library in the builddir/lib is not the same as one in installdir/lib</div><div>So, use an actual install to get an installed copy to test against, don’t manually move the build directory around and treat it as equivalent to an install, it is not.</div><div><br></div><div>P.</div><div><br></div></div><br><blockquote type="cite"><div><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">P</span><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">_______________________________________________<br>geos-devel mailing list<br><a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/geos-devel">https://lists.osgeo.org/mailman/listinfo/geos-devel</a></blockquote></div></blockquote></div><br></body></html>