<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Having built GDAL 3.7.0, I’m observing the following output.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"># output of ldd shows the issue<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">ldd libgdal.so<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> linux-vdso.so.1 (0x00007ffe0e3f7000)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> libdl.so.2 => /lib64/libdl.so.2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">(0x00007feaca6a6000)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> libcurl.so.4 => /lib64/libcurl.so.4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">(0x00007feaca417000)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> libproj.so.22 => not found<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> libexpat.so.1 =><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">/lib64/libexpat.so.1 (0x00007feaca1db000)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> libxerces-c-3.1.so => not found<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> /data/third_party_unzip/exp/SQLite/SQLite-3.23.1/lib/libsqlite3.so<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">=> not found<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Notice that the only absolute path is for sqlite3. I had to specify the full path to all dependencies but only the full path to sqlite is embedded into the .so file. This is a major problem
since now GDAL will not load at run-time unless libsqlite exists on the system at that exact location. I’m supplying absolute paths to the location of all dependencies in the cmake command to generate the build directory. Does anyone know why sqlite would
be linked differently? So far I’m searching through the build directory for references but I haven’t found a reason or the behavior yet. The build instructions at gdal.org seem straightforward so I don’t see anything on that site that explains the behavior.
I’m guessing it relates to how the build files are generated by the gdal build system. I don’t want the absolute path to anything baked into libgdal.so.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">My Cmake command to generate the build looks like this, and I’m also putting path to all dependencies into LD_LIBRARY_PATH first. I didn’t think it would help to show all of the paths since
they’d be different on other Linux systems. Bases on this I’m failing to understand why the dependencies are not linked in consistently. I’m building GDAL using powershell commands.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">$Env:LD_LIBRARY_PATH="${CURL_LIB_DIR}:${SQLITE_LIB_DIR}:${EXPAT_LIB_DIR}:${PROJ_LIB_DIR}:${XERCES_LIB_DIR}:${OPENSSL_LIB_DIR}:${Env:LD_LIBRARY_PATH}"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">cmake -S . -B ../build/$CONFIGL -DCMAKE_INSTALL_PREFIX="../install/$CONFIGL" -DCMAKE_BUILD_TYPE="$CONFIG" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DGDAL_USE_OPENSSL=OFF -DGDAL_USE_EXTERNAL_LIBS:BOOL=OFF `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DPROJ_INCLUDE_DIR="$PROJ_INCLUDE" -DPROJ_LIBRARY_RELEASE="$PROJ_LIB" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DGDAL_USE_CURL=ON -DCURL_INCLUDE_DIR="$CURL_INCLUDE" -DCURL_LIBRARY_RELEASE="$CURL_LIB" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DGDAL_USE_XERCESC=ON -DXercesC_INCLUDE_DIR="$XERCES_INCLUDE" -DXercesC_LIBRARY="$XERCES_LIB" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DGDAL_USE_EXPAT=ON -DEXPAT_INCLUDE_DIR="$EXPAT_INCLUDE" -DEXPAT_LIBRARY="$EXPAT_LIB" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DGDAL_USE_SQLITE3=ON -DSQLite3_INCLUDE_DIR="$SQLITE_INCLUDE" -DSQLite3_LIBRARY="$SQLITE_LIB" `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> -DACCEPT_MISSING_SQLITE3_MUTEX_ALLOC:BOOL=ON -DACCEPT_MISSING_SQLITE3_RTREE:BOOL=ON `<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> 2>&1 | tee cmake_configure_${PLATFORM}_${TOOLSET}_${CONFIGL}.txt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;mso-ligatures:none">Shawn Fox<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;mso-ligatures:none">Sr Principal SW Engineer<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;mso-ligatures:none">BAE Systems, Inc.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;mso-ligatures:none">Geospatial eXploitation Products<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt;mso-ligatures:none">T: </span>
</b><span style="font-size:8.0pt;mso-ligatures:none">858-592-5310<b> </b></span><span style="font-size:8.0pt;mso-ligatures:none">office phone number |
<b>M: </b>858-337-2380 | <b>E: </b>shawn.fox@baesystems.com <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;mso-ligatures:none">10920 Technology Pl, San Diego, CA
</span><span style="mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>