<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I'm working on the trunk OpenCL build on my Mac now.</div><div><br></div><div>****** First, on my mac I get an error at the end of make:</div><div>[...]&nbsp;./ogr/.libs/ogr_srs_xml.o ./ogr/.libs/ograssemblepolygon.o ./ogr/.libs/ogr2gmlgeometry.o ./ogr/.libs/gml2ogrgeometry.o ./ogr/.libs/ogr_expat.o &nbsp; /opt/local/lib/libsqlite3.dylib -L/opt/local/lib -L/usr/local/lib /usr/local/lib/libexpat.dylib /usr/local/lib/libjpeg.dylib /usr/local/lib/libtiff.dylib /usr/local/lib/libpng12.dylib -lpthread -ldl /opt/local/lib/libcurl.dylib /opt/local/lib/libidn.dylib -lssl -lcrypto -lz -lOpenCL &nbsp; &nbsp;-install_name &nbsp;/usr/local/lib/libgdal.1.dylib -compatibility_version 16 -current_version 16.0 -Wl,-single_module</div><div><div>ld: library not found for -lOpenCL</div><div>collect2: ld returned 1 exit status</div><div>make[1]: *** [libgdal.la] Error 1</div><div>make: *** [check-lib] Error 2</div><div>seth:gdal-svn-trunk-2010.12.17 sprice$</div></div><div><br></div><div>To fix this, I changed "OPENCL_LIB &nbsp; &nbsp; &nbsp;= &nbsp; &nbsp; &nbsp; -lOpenCL" to "OPENCL_LIB &nbsp; &nbsp; &nbsp;= &nbsp; &nbsp; &nbsp; -framework OpenCL" in GDALMmake.opt.</div><div><br></div><div>***** &nbsp;Why is&nbsp;<span class="Apple-style-span" style="color: rgb(196, 26, 22); font-family: Monaco; font-size: 10px; ">USE_CLAMP_TO_DST_FLOAT</span>&nbsp;in there? I would think that is required even if it isn't on ATI. I'm not sure who inserted its use, but I'm just wondering if the reasoning is documented somewhere.</div><div><br></div><div>***** I had to make this change to&nbsp;alg/gdalwarpkernel_opencl.c to get it to build without a build option error.</div><div><br></div><div><div>@@ -1168,7 +1168,7 @@</div><div>&nbsp;&nbsp; &nbsp;&nbsp;</div><div>&nbsp;&nbsp; &nbsp; //Assemble the compiler arg string for speed. All invariants should be defined here.</div><div>&nbsp;&nbsp; &nbsp; sprintf(buffer, "-cl-fast-relaxed-math -Werror -D FALSE=0 -D TRUE=1 "</div><div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"%s "</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"%s"</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "-D iSrcWidth=%d -D iSrcHeight=%d -D iDstWidth=%d -D iDstHeight=%d "</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "-D useUnifiedSrcDensity=%d -D useUnifiedSrcValid=%d "</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "-D useDstDensity=%d -D useDstValid=%d -D useImag=%d "</div><div>@@ -1176,9 +1176,9 @@</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "-D nXRadius=%d -D nYRadius=%d -D nFiltInitX=%d -D nFiltInitY=%d "</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "-D PI=%015.15lff -D outType=%s -D dstMinVal=%015.15lff -D dstMaxVal=%015.15lff "</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "-D useDstNoDataReal=%d -D vecf=%s %s -D doCubicSpline=%d "</div><div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"-D useUseBandSrcValid=%d -D iCoordMult=%d",</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"-D useUseBandSrcValid=%d -D iCoordMult=%d ",</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* FIXME: Is it really a ATI specific thing ? */</div><div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(warper-&gt;imageFormat == CL_FLOAT &amp;&amp; warper-&gt;bIsATI) ? "-D USE_CLAMP_TO_DST_FLOAT=1" : "",</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(warper-&gt;imageFormat == CL_FLOAT &amp;&amp; warper-&gt;bIsATI) ? "-D USE_CLAMP_TO_DST_FLOAT=1 " : "",</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; warper-&gt;srcWidth, warper-&gt;srcHeight, warper-&gt;dstWidth, warper-&gt;dstHeight,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; warper-&gt;useUnifiedSrcDensity, warper-&gt;useUnifiedSrcValid,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; warper-&gt;useDstDensity, warper-&gt;useDstValid, warper-&gt;imagWorkCL != NULL,</div></div><div><br></div><div>**** After doing all of the above to make things compile, I don't get the bug described below. I'm working off of the latest trunk daily.</div><div><br></div><div>~Seth</div><div><br></div><br><div><div>On Dec 8, 2010, at 1:12 PM, Even Rouault wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Seth,<br><br>Thanks for your help.<br><br><blockquote type="cite">It's more than a little strange that none of those image sizes work.<br></blockquote><blockquote type="cite">Perhaps it's a problem with the image format? Can you verify that the<br></blockquote><blockquote type="cite">given format should work?<br></blockquote><br>The image format was CL_UNORM_INT8 (for GDT_Byte)<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">Looking at the spec, it might also be a problem with the 'sz'<br></blockquote><blockquote type="cite">argument. What value is that passing?<br></blockquote><br>It's 1.<br><br>I managed to found the following workaround that enables gdalwarp to complete <br>(see <a href="http://trac.osgeo.org/gdal/changeset/21220">http://trac.osgeo.org/gdal/changeset/21220</a> &nbsp;that basically passes a dummy <br>buffer instead of a NULL pointer).<br><br>However the visual result of the warping is really poor. I see 4 "ghost" <br>images shifted.<br><br>For better understanding I've attached the source image (small_world_b1.tif) <br>and the result of bilinear resampling (but I get similar weird visual effects <br>with cubic, cubic spline or lanczos)<br><br>gdalwarp &nbsp;-rb small_world_b1.tif out_bilinear.tif<br><br>Best regards,<br><br>Even<br><span>&lt;small_world_b1.tif&gt;</span><span>&lt;out_bilinear.tif&gt;</span></div></blockquote></div><br></body></html>