<div dir="ltr">Thanks Greg,<div><br></div><div>I'm attempting to update the gdal PKGBUILD from Arch Linux at <a href="https://github.com/archlinux/svntogit-community/blob/packages/gdal/trunk/PKGBUILD">https://github.com/archlinux/svntogit-community/blob/packages/gdal/trunk/PKGBUILD</a> and making revisions as I go along.</div><div><br></div><div>It's a split package that breaks python-gdal apart from gdal so not sure how to compile the python bindings separately at this moment.</div><div><br></div><div>I managed to patch the setup.cfg file:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">--- a/gdal/swig/python/setup.cfg        2022-06-02 16:08:22.113109320 -0700<br>
</span></span><span style="font-family:monospace">+++ b/gdal/swig/python/setup.cfg        2022-06-02 16:10:26.913826620 -0700<br>
</span><span style="font-family:monospace">@@ -3,8 +3,7 @@<br>
</span><span style="font-family:monospace"> max-line-length=100<br>
</span><span style="font-family:monospace">  <br></span><span style="font-family:monospace"> [build_ext]<br>
</span><span style="font-family:monospace">-#include_dirs = ../../port:../../gcore:../../alg:../../ogr/<br>
</span><span style="font-family:monospace">-#library_dirs = ../../.libs:../../<br>
</span><span style="font-family:monospace">+include_dirs = ../../../build/port:../../../build/gcore:../../../build/alg:../../../build/ogr/<br>
</span><span style="font-family:monospace">+library_dirs = ../../.libs:../../build<br>
</span><span style="font-family:monospace"> #libraries = gdal<br>
</span><span style="font-family:monospace">-gdal_config=../../apps/gdal-config<br>
</span><span style="font-family:monospace">-<br>
</span><span style="font-family:monospace">+gdal_config=../../../build/apps/gdal-config</span></blockquote><div><span style="font-family:monospace"><br></span></div><div><font face="arial, sans-serif">If there's a preferred packaging way to build out the python bindings separately then I'm all ears cause this says it can't find the header files which are there in the paths patched:</font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">running build<br>
</span></span><span style="font-family:monospace">running build_py<br>
</span><span style="font-family:monospace">running build_ext<br>
</span><span style="font-family:monospace">building 'osgeo._gdal' extension<br>
</span><span style="font-family:monospace">building 'osgeo._gdalconst' extension<br>
</span><span style="font-family:monospace">building 'osgeo._osr' extension<br>
</span><span style="font-family:monospace">building 'osgeo._gnm' extension<br>
</span><span style="font-family:monospace">building 'osgeo._ogr' extension<br>
</span><span style="font-family:monospace">building 'osgeo._gdal_array' extension<br>
</span><span style="font-family:monospace">extensions/ogr_wrap.cpp:2838:10: fatal error: gdal.h: No such file or directory<br>
</span><span style="font-family:monospace"> 2838 | #include "gdal.h"<br>
</span><span style="font-family:monospace">      |          ^~~~~~~~<br>
</span><span style="font-family:monospace">compilation terminated.<br>
</span><span style="font-family:monospace">extensions/osr_wrap.cpp:2879:10: fatal error: cpl_string.h: No such file or directory<br>
</span><span style="font-family:monospace"> 2879 | #include "cpl_string.h"<br>
</span><span style="font-family:monospace">      |          ^~~~~~~~~~~~~~<br>
</span><span style="font-family:monospace">compilation terminated.<br>
</span><span style="font-family:monospace">extensions/gdal_array_wrap.cpp:2829:10: fatal error: gdal.h: No such file or directory<br>
</span><span style="font-family:monospace"> 2829 | #include "gdal.h"<br>
</span><span style="font-family:monospace">      |          ^~~~~~~~<br>
</span><span style="font-family:monospace">compilation terminated.<br>
</span><span style="font-family:monospace">extensions/gdalconst_wrap.c:2703:10: fatal error: gdal.h: No such file or directory<br>
</span><span style="font-family:monospace"> 2703 | #include "gdal.h"<br>
</span><span style="font-family:monospace">      |          ^~~~~~~~<br>
</span><span style="font-family:monospace">compilation terminated.<br>
</span><span style="font-family:monospace">extensions/gdal_wrap.cpp:2883:10: fatal error: cpl_port.h: No such file or directory<br>
</span><span style="font-family:monospace"> 2883 | #include "cpl_port.h"<br>
</span><span style="font-family:monospace">      |          ^~~~~~~~~~~~<br>
</span><span style="font-family:monospace">compilation terminated.<br>
</span><span style="font-family:monospace">extensions/gnm_wrap.cpp:2820:10: fatal error: gdal.h: No such file or directory<br>
</span><span style="font-family:monospace"> 2820 | #include "gdal.h"<br>
</span><span style="font-family:monospace">      |          ^~~~~~~~<br>
</span><span style="font-family:monospace">compilation terminated.<br>
</span><span style="font-family:monospace">error: command '/usr/bin/gcc' failed with exit code 1</span></blockquote><div><br></div><div>saultdon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 2, 2022 at 4:03 PM Greg Troxel <<a href="mailto:gdt@lexort.com">gdt@lexort.com</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"><br>
Saulteau Don <<a href="mailto:sault.don@gmail.com" target="_blank">sault.don@gmail.com</a>> writes:<br>
<br>
> I have gdal 3.5.0 built using the new cmake system.<br>
> /chroot/src/build <- cmake build directory<br>
> /chroot/src/gdal <- src directory<br>
> /chroot/src/gdal/swig/python<br>
><br>
> My cmake is ran from the /chroot directory:<br>
><br>
>> cmake -B build -S gdal \<br>
>>       -DCMAKE_BUILD_TYPE='None' \<br>
>>       -DCMAKE_INSTALL_PREFIX='/usr' \<br>
>>       -DBUILD_PYTHON_BINDINGS='OFF' \<br>
>>       -Wno-dev<br>
>> cmake --build build<br>
><br>
><br>
> Then to make the python bindings via swig:<br>
><br>
>> cd gdal/swig/python<br>
>> python setup.py build<br>
><br>
><br>
> When the `python setup.py build` is running it can't find gdal-config with<br>
> the following errors:<br>
<br>
This may not be how you want to do this, but if you install the lib and<br>
then build python as a separate step, it will probably go better.    I<br>
am unclear on how this is supposed to work; pkgsrc builds non-python<br>
libs and then python as separate packages.<br>
</blockquote></div>