<html 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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:PMingLiU;
panose-1:2 2 5 0 0 0 0 0 0 0;}
@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;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"\@PMingLiU";
panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-ligatures:none;}
span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thanks a lot for Shawn’s reply. Yes, you pointed out the root cause for it. I added “--soname=legacy” to the sqlite3 configure command line and it created libsqlite3.so with SONAME. I did try to add this soname option earlier but didn’t
delete the .o files and there was nothing changed. Your detailed reply made me realize that this flag also affects the compilation. Thanks again!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I also want to thank other repliers for your help!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">gdal-dev <gdal-dev-bounces@lists.osgeo.org> on behalf of Fox, Shawn D (US) via gdal-dev <gdal-dev@lists.osgeo.org><br>
<b>Date: </b>Wednesday, May 14, 2025 at 8:54</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black"> </span><span style="font-size:12.0pt;color:black">PM<br>
<b>To: </b>gdal-dev <gdal-dev@lists.osgeo.org><br>
<b>Subject: </b>Re: [gdal-dev] [External] : Re: libgdal.so.36 refers to sqlite library with full path<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">I reported the same problem recently, but I determined in my case that the problem was my build of libsqlite3 which for some reason was missing the SONAME attribute from the binary. This had
the effect of the CMAKE build of GDAL containing the absolute path of libsqlite3 in the libgdal.so file.
</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Try this to test whether you are having a similar problem. This was done on my rebuilt libsqlite3 library and the attribute is present. If it is missing in yours then that could cause the
problem. I’m not exactly sure why, but troubleshooting the cmake build is awfully difficult.
</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">objdump -p libsqlite3.so | grep SONAME</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> SONAME libsqlite3.so.0</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">To fix it, I rebuilt my libsqlite3 binary, but you could patch that file to add in the attribute or rebuild it with the correct compiler options to create the attribute. You could also patch
the gdal library after the build.</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">To use patchelf to add a SONAME. ‘patchelf --set-soname libsqlite3.so.3 libsqlite3.so’</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">The line in my Makefile for RHEL8 to build it with the soname looks like this, $(CC) $(CFLAGS) -shared sqlite3.o -Wl,-soname,libsqlite3.so.0 -o $(LIBS)/libsqlite3.so</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">After doing that and rebuilding GDAL the libgdal.so file was as I expected with no absolute path to libsqlite3.so. I preferred to fix the root cause and stored the corrected libsqlite3 binary
in our local repository so that I don’t have to keep patching libgdal after every build.</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">ldd libgdal.so | grep libsqlite3</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x00007fcdab1d7000)</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">I hope that helps you. That is how I solved the same kind of problem in my case while building GDAL 3.7.0.</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Thanks,</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Shawn Fox</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:"Calibri",sans-serif">From:</span></b><span style="font-family:"Calibri",sans-serif"> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Andrew Bell via gdal-dev<br>
<b>Sent:</b> Wednesday, May 14, 2025 3:47 PM<br>
<b>To:</b> Fengting Chen <fengting.chen@oracle.com><br>
<b>Cc:</b> gdal-dev <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [gdal-dev] [External] : Re: libgdal.so.36 refers to sqlite library with full path</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt"> <o:p></o:p></span></p>
<div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="97%" style="width:97.0%;margin-left:5.4pt;border-collapse:collapse">
<tbody>
<tr style="height:21.2pt">
<td width="97%" valign="top" style="width:97.0%;border:solid red 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:21.2pt">
<p class="MsoNormal" align="center" style="margin-bottom:4.0pt;text-align:center;background:white">
<strong><u><span style="font-size:13.5pt;font-family:"Aptos",sans-serif;color:red">External Email Alert</span></u></strong><span style="font-size:12.0pt"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:21.2pt">
<td width="1440" valign="top" style="width:15.0in;border:solid red 1.0pt;border-top:none;padding:0in 5.4pt 0in 5.4pt;height:21.2pt">
<p class="MsoNormal" align="center" style="margin-bottom:4.0pt;text-align:center;background:white">
<strong><span style="font-size:10.0pt;font-family:"Aptos",sans-serif;color:black">This email has been sent from an account outside of the BAE Systems network.</span></strong><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" align="center" style="margin-bottom:4.0pt;text-align:center">
<span style="font-size:7.5pt">Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. For further information on how to spot phishing, access “Cybersecurity OneSpace Page” and report
phishing by clicking the button “Report Phishing” on the Outlook toolbar.</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt"> <o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">You can use patchelf or a similar program to modify dependencies.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">--<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">Andrew Bell<br>
<a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt"> <o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">On Wed, May 14, 2025, 6:10</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> </span><span style="font-size:12.0pt">PM Fengting Chen via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>>
wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">Both GDAL and PROJ refer to my custom build sqlite3 library. The sqlite3 entry in PROJ library looks normal, that is, just the library name without path.
<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">My concern is that libgdal.so has libsqlite3.so with full path. How could this happen? How do I remove this?
<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<div id="m_-1093842869785382841mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>><br>
<b>Date: </b>Wednesday, May 14, 2025 at 5:04</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black"> </span><span style="font-size:12.0pt;color:black">PM<br>
<b>To: </b>Fengting Chen <<a href="mailto:fengting.chen@oracle.com" target="_blank">fengting.chen@oracle.com</a>>, gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<b>Subject: </b>[External] : Re: [gdal-dev] libgdal.so.36 refers to sqlite library with full path</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<p>Maybe another library that GDAL is depending on is linked against the system sqlite3 and not your custom build ? That could be PROJ typically<o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">Le 14/05/2025 à 22:58, Fengting Chen via gdal-dev a écrit :<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi, I am trying to build GDAL 3.10.3 with sqlite 3.49.2. The build was successful on linux. But there are two entries of reference to sqlite3, and one of it has the absolution path.
<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">> ldd libgdal.so.36 | grep sqlite<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">ldd: warning: you do not have execution permission for `./libgdal.so.36'<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="color:red">/scratch/gdal_dir/SDK/sqlite/3.49.2/dist/lib/libsqlite3.so (0x00007f7e08168000</span>)<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> libsqlite3.so => / scratch/gdal_dir/SDK/sqlite/3.49.2/dist/lib/libsqlite3.so (0x00007f7dfb00e000)<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><b>Why is above listing having a full path of libsqlite3.so built in the libgdal.so.36?
</b><span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">The configuration for the cmake for GDAL is: <span style="font-size:12.0pt">
<o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">set (SQLite3_INCLUDE_DIR "$(SQLITE3_DIST_DIR)/ include" CACHE PATH "" FORCE)
<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">set (SQLite3_LIBRARY "$(SQLITE3_DIST_DIR)/lib/ $(LIBSQLITE3)" CACHE PATH "" FORCE)
<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">At the sqlite lib directory, it has: <span style="font-size:12.0pt">
<o:p></o:p></span></p>
<p class="MsoNormal">libsqlite3.a libsqlite3.so.0@ pkgconfig/<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">libsqlite3.so@ libsqlite3.so.3.49.2*<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">Is this sqlite3 build issue or GDAL build issue? <span style="font-size:12.0pt">
<o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal">Thanks. <span style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt"> <o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>gdal-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="https://urldefense.com/v3/__https:/lists.osgeo.org/mailman/listinfo/gdal-dev__;!!ACWV5N9M2RV99hQ!IYTAe90PeRIf_wj9IWwRo5D25Ll_Dqjy6ZUwhS1joyPnRj0waH4uKmjh0GN2-UVNert2VyP1mnq_6fU7q1t4i14PHNK2$" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre><a href="https://urldefense.com/v3/__http:/www.spatialys.com__;!!ACWV5N9M2RV99hQ!IYTAe90PeRIf_wj9IWwRo5D25Ll_Dqjy6ZUwhS1joyPnRj0waH4uKmjh0GN2-UVNert2VyP1mnq_6fU7q1t4i4kI3dZu$" target="_blank">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://urldefense.com/v3/__https:/lists.osgeo.org/mailman/listinfo/gdal-dev__;!!ACWV5N9M2RV99hQ!Lw10Up9tLBGiVtEh_mAlusRrrL5SxKFEqvRvw893tnMezleCo0hUzotNcEJfXaWCa0fIhyL5Qa6vqypT-G4gnI1n$" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>