[gdal-dev] Cannot build for iOS due to GUInt64 error

Dmitry Baryshnikov bishop.dev at gmail.com
Mon Nov 13 13:30:21 PST 2017


Hi Nik,

You may try alternative build scenario using CMake.

1.  Install XCode command line tools if already not done this 
(https://www.embarcadero.com/starthere/xe5/mobdevsetup/ios/en/installing_the_commandline_tools.html) 
and CMake (https://cmake.org/download/)


2. In terminal execute commands:

 > git clone --depth 1 https://github.com/nextgis-borsch/lib_gdal.git
 > cd lib_gdal
 > mkdir build
 > cd build
 > cmake -G"Unix Makefiles" -DBUILD_TARGET_PLATFORM=IOS 
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release 
-DENABLE_BITCODE=OFF -DIOS_ARCH=arm64 -DIOS_PLATFORM=OS -DENABLE_NEON=ON 
-DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DWITH_JSONC=ON 
-DWITH_JSONC_EXTERNAL=ON -DWITH_TIFF=ON -DWITH_TIFF_EXTERNAL=ON 
-DWITH_GeoTIFF=ON -DWITH_GeoTIFF_EXTERNAL=ON -DOSX_FRAMEWORK=ON 
-DENABLE_GIF=OFF -DENABLE_CAD=OFF -DENABLE_PNG=OFF -DGDAL_BUILD_APPS=OFF 
-DGDAL_BUILD_DOCS=OFF -DWITH_PYTHON=OFF ..

Some flags description:
-DIOS_ARCH maybe armv7, armv7s, arm64, i386 or x86_64
-DIOS_PLATFORM maybe IOS or SIMULATOR

After configuring you will see summary about GDAL build or error 
message. I expect everything will be fine.

Run this command to build GDAL:

 > cmake --build . -- -j 4

May be this need to rerun twice as dependency may not build on first run.

You may build GDAL for several architectures and create fat library 
using lipo -create command (I rewrite OpenCV py script to automate 
creating my own fat iOS library which use GDAL - 
https://github.com/nextgis/nextgis_datastore/blob/master/opt/ios/build_framework.py)


This is minimal build of GDAL. If you need some drivers which not build 
by listed command let me know - I'll help to modify command line options.

Best regards,
     Dmitry

13.11.2017 23:30, Nik Sands пишет:
> Hi Even,
>
> If I include the -Wall option, then I do get just the one warning.  Here’s the command line I’m using, which is based on similar command lines from the make output…
>
> ------------------------------------
> $ /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -o conftest -arch arm64 -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -Wno-implicit-function-declaration -fembed-bitcode -mno-thumb -Wall  -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk conftest.c -ldl
> conftest.c:1:24: warning: unused variable 'off' [-Wunused-variable]
> int main() { long long off=0; }
>                         ^
> 1 warning generated.
> $
> ——————————————————
>
> I made the change you suggested to acinclude.m4 and then ran autoconf.  Then I attempted to build GDAL again, but got the same error:
>
> --------------------------------------------------
> geotiff.cpp:7653:13: error: unknown type name 'GUInt64'
>      typedef GUInt64 WordType;
>              ^
> 1 error generated.
> make[2]: *** [../o/geotiff.lo] Error 1
> make[1]: *** [gtiff-install-obj] Error 2
> make: *** [frmts-target] Error 2
> --------------------------------------------------
>
> I have to admit that I’m a very small-time developer and I’m somewhat out of my depth here, so forgive me if I sound like I don’t understand some of this stuff.
>
> Cheers,
> Nik.
>
>> On 12 Nov 2017, at 11:22 pm, Even Rouault <even.rouault at spatialys.com> wrote:
>>
>> On dimanche 12 novembre 2017 19:50:47 CET Nik Sands wrote:
>>> Hi Even,
>>>
>>> Thanks for your reply.  You are correct as usual.  Your ‘cc’ test produced
>>> no errors,
>>   
>> And no warnings as well ?
>> Weird, since this is the test that is used to dected long long presence
>> See m4/acinclude.m4
>>   
>> Do you run configure with CCFLAGS defined ? For example, if CCFLAGS="-Wall", then the test will throw a warning that will make it fail.
>> I'm not sure why we use CCFLAGS in that file, whereas CFLAGS is used everywhere else.
>>   
>> What if you change in m4/acinclude.m4
>>    echo 'int main() { long long off=0; }' >> conftest.c
>> to
>>    echo 'int main() { long long off=0; (void)off; return 0; }' > conftest.c
>>   
>> and run autoconf to regenerate configure ?
>>   
>> Even
>>   
>> -- 
>> Spatialys - Geospatial professional services
>> http://www.spatialys.com <http://www.spatialys.com/>
> ========================================================
> NIK SANDS
> Line Tamer | Time Traveller | Space Cadet
>
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171114/e3e87c3c/attachment-0001.html>


More information about the gdal-dev mailing list