TensorWorks / UnrealGDAL

Provides access to the GDAL/OGR API inside the Unreal Engine
MIT License
75 stars 28 forks source link

Unable to build on macOS 12.2 Monterey and XCode 13. #6

Open falcon4ever opened 2 years ago

falcon4ever commented 2 years ago

Hello,

I tried to pick up last years project but unfortunately it looks like things are broken for the latest macOS/XCode version.

Initially I tried to retrace my steps I had posted here https://github.com/TensorWorks/UnrealGDAL/issues/1#issuecomment-758929405

I'm still on an Intel Macbook Pro, but there are a few things that have changed:

On a fresh setup I started out by installing homebrew and installing the same basic dependencies via homebrew:

And then I used pyenv to install Python 3.9.9 as well as the ue4cli tools pip3 install ue4cli conan-ue4cli

The steps described here https://docs.adamrehn.com/conan-ue4cli/workflow/installation still work well for UE4 (version 4.26.2)

This part works fine: ue4 conan build "mergetiff-ue4==0.0.6"

This does not: ue4 conan build "gdal-ue4==2.4.0"

The initial failure:

...
gdal-ue4/2.4.0@adamrehn/4.26: Copying sources to build folder
gdal-ue4/2.4.0@adamrehn/4.26: Building your package in /Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4
gdal-ue4/2.4.0@adamrehn/4.26: Generator cmake created conanbuildinfo.cmake
gdal-ue4/2.4.0@adamrehn/4.26: Aggregating env generators
gdal-ue4/2.4.0@adamrehn/4.26: Calling build()
Warning: the libcxx package has been deprecated and will be removed in a future version of conan-ue4cli.
+ aclocal -I ./m4
+ autoconf
configure.ac:48: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:48: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_cflags_warn_all.m4:26: AX_CFLAGS_WARN_ALL is expanded from...
configure.ac:48: the top level
configure.ac:49: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:49: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_cflags_warn_all.m4:71: AX_CXXFLAGS_WARN_ALL is expanded from...
configure.ac:49: the top level
configure.ac:222: warning: The macro `AC_LIBTOOL_WIN32_DLL' is obsolete.
configure.ac:222: You should run autoupdate.
m4/ltoptions.m4:148: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:222: the top level
configure.ac:222: warning: AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
configure.ac:222: put the 'win32-dll' option into LT_INIT's first parameter.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
m4/ltoptions.m4:148: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:222: the top level
configure.ac:223: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:223: You should run autoupdate.
m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:223: the top level
configure.ac:293: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:293: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:293: the top level
configure.ac:369: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:369: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:369: the top level
configure.ac:498: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:498: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:498: the top level
configure.ac:973: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:973: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:973: the top level
configure.ac:992: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:992: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:992: the top level
configure.ac:1009: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1009: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:1009: the top level
configure.ac:1030: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:1030: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:1030: the top level
configure.ac:1034: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:1034: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:1034: the top level
configure.ac:1051: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1051: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:1051: the top level
configure.ac:1072: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1072: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:1072: the top level
configure.ac:2659: warning: AC_CHECK_HEADERS($NETCDF_INCLUDEDIR/netcdf_mem.h): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
configure.ac:2659: the top level
configure.ac:3285: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3285: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_oracle_oci.m4:41: AX_LIB_ORACLE_OCI is expanded from...
configure.ac:3285: the top level
configure.ac:3421: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3421: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_xerces.m4:37: AX_LIB_XERCES is expanded from...
configure.ac:3421: the top level
configure.ac:3447: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3447: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_expat.m4:37: AX_LIB_EXPAT is expanded from...
configure.ac:3447: the top level
configure.ac:3461: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3461: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_libkml.m4:48: AX_LIB_LIBKML is expanded from...
configure.ac:3461: the top level
configure.ac:3540: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3540: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_oracle_oci.m4:41: AX_LIB_ORACLE_OCI is expanded from...
configure.ac:3540: the top level
configure.ac:3801: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3801: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_sqlite3.m4:32: AX_LIB_SQLITE3 is expanded from...
configure.ac:3801: the top level
configure.ac:3836: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3836: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_sqlite3.m4:32: AX_LIB_SQLITE3 is expanded from...
configure.ac:3836: the top level
configure.ac:4026: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:4026: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:4026: the top level
configure.ac:5483: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:5483: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:5483: the top level
configure.ac:5829: warning: AC_OUTPUT should be used without arguments.
configure.ac:5829: You should run autoupdate.
Warning: the libcxx package has been deprecated and will be removed in a future version of conan-ue4cli.
gdal-ue4/2.4.0@adamrehn/4.26: Calling:
 > ./configure '--prefix=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4' '--datarootdir=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4/data' '--enable-static' '--disable-shared' '--without-libtool' '--enable-pdf-plugin=no' '--without-ld-shared' '--with-threads=yes' '--with-libz=/Users/falcon4ever/.conan/data/zlib/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-liblzma' '--without-libiconv-prefix' '--without-pg' '--without-grass' '--without-libgrass' '--without-cfitsio' '--without-pcraster' '--with-png=/Users/falcon4ever/.conan/data/UElibPNG/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-mrf' '--without-dds' '--without-gta' '--with-libtiff=internal' '--with-geotiff=internal' '--with-jpeg=internal' '--with-rename_internal_libtiff_symbols' '--with-rename_internal_libgeotiff_symbols' '--without-jpeg12' '--without-gif' '--without-ogdi' '--without-fme' '--without-sosi' '--without-mongocxx' '--without-hdf4' '--without-hdf5' '--without-kea' '--without-netcdf' '--without-jasper' '--without-openjpeg' '--without-fgdb' '--without-ecw' '--without-kakadu' '--without-mrsid' '--without-jp2mrsid' '--without-mrsid_lidar' '--without-msg' '--without-bsb' '--without-oci' '--without-oci-include' '--without-oci-lib' '--without-grib' '--without-mysql' '--without-ingres' '--without-xerces' '--without-expat' '--without-libkml' '--without-odbc' '--with-dods-root=no' '--without-curl' '--without-xml2' '--without-spatialite' '--without-sqlite3' '--without-pcre' '--without-idb' '--without-sde' '--without-epsilon' '--without-webp' '--without-qhull' '--with-freexl=no' '--with-libjson-c=internal' '--without-pam' '--without-poppler' '--without-podofo' '--without-pdfium' '--without-perl' '--without-python' '--without-java' '--without-mdb' '--without-rasdaman' '--without-armadillo' '--without-cryptopp' '--with-zstd=no' '--with-proj=/Users/falcon4ever/.conan/data/proj-ue4/4.9.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8' '--with-geos=/Users/falcon4ever/.conan/data/geos-ue4/3.6.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8/bin/geos-config' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
configure: error: cannot find required auxiliary files: config.rpath
gdal-ue4/2.4.0@adamrehn/4.26: 
gdal-ue4/2.4.0@adamrehn/4.26: ERROR: Package '1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4' build failed
gdal-ue4/2.4.0@adamrehn/4.26: WARN: Build folder /Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4
ERROR: gdal-ue4/2.4.0@adamrehn/4.26: Error in build() method, line 132
    self.build_unix()
while calling 'build_unix', line 250
    autotools.configure(args=self.configure_flags())
    ConanException: Error 1 while executing ./configure '--prefix=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4' '--datarootdir=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4/data' '--enable-static' '--disable-shared' '--without-libtool' '--enable-pdf-plugin=no' '--without-ld-shared' '--with-threads=yes' '--with-libz=/Users/falcon4ever/.conan/data/zlib/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-liblzma' '--without-libiconv-prefix' '--without-pg' '--without-grass' '--without-libgrass' '--without-cfitsio' '--without-pcraster' '--with-png=/Users/falcon4ever/.conan/data/UElibPNG/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-mrf' '--without-dds' '--without-gta' '--with-libtiff=internal' '--with-geotiff=internal' '--with-jpeg=internal' '--with-rename_internal_libtiff_symbols' '--with-rename_internal_libgeotiff_symbols' '--without-jpeg12' '--without-gif' '--without-ogdi' '--without-fme' '--without-sosi' '--without-mongocxx' '--without-hdf4' '--without-hdf5' '--without-kea' '--without-netcdf' '--without-jasper' '--without-openjpeg' '--without-fgdb' '--without-ecw' '--without-kakadu' '--without-mrsid' '--without-jp2mrsid' '--without-mrsid_lidar' '--without-msg' '--without-bsb' '--without-oci' '--without-oci-include' '--without-oci-lib' '--without-grib' '--without-mysql' '--without-ingres' '--without-xerces' '--without-expat' '--without-libkml' '--without-odbc' '--with-dods-root=no' '--without-curl' '--without-xml2' '--without-spatialite' '--without-sqlite3' '--without-pcre' '--without-idb' '--without-sde' '--without-epsilon' '--without-webp' '--without-qhull' '--with-freexl=no' '--with-libjson-c=internal' '--without-pam' '--without-poppler' '--without-podofo' '--without-pdfium' '--without-perl' '--without-python' '--without-java' '--without-mdb' '--without-rasdaman' '--without-armadillo' '--without-cryptopp' '--with-zstd=no' '--with-proj=/Users/falcon4ever/.conan/data/proj-ue4/4.9.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8' '--with-geos=/Users/falcon4ever/.conan/data/geos-ue4/3.6.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8/bin/geos-config' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
Traceback (most recent call last):
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/bin/ue4", line 8, in <module>
    sys.exit(main())
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/ue4cli/cli.py", line 222, in main
    SUPPORTED_COMMANDS[command]['action'](manager, args)
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/main.py", line 48, in main
    SUBCOMMANDS[subcommand]['function'](manager, args[1:])
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/commands/build.py", line 130, in build
    builder.build(name, version, args.options if args.options is not None else [])
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/common/PackageBuilder.py", line 45, in build
    self._executor.execute(command, cwd=tempDir, check=True)
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/common/CommandExecutor.py", line 19, in execute
    return subprocess.run(command, **kwargs).returncode == 0
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['conan', 'install', 'gdal-ue4/2.4.0@adamrehn/4.26', '--profile=ue4.26-Mac', '--build=missing']' returned non-zero exit status 1.

The first error you'll get is: configure: error: cannot find required auxiliary files: config.rpath. I used this https://github.com/OSGeo/gdal/issues/4341#issuecomment-906294159 to get around it. Opening /Users/{Username}/.config/conan-ue4cli/recipes/gdal-ue4/2.4.0/conanfile.py and patching it like this:

# Patch out iconv support under Mac OS X and patch GDAL v2.4.0 for XCode 12.x
if self.settings.os == "Macos":
    self.run("sed -i '' 's/-D_XOPEN_SOURCE=500 //g' ogr/ogrsf_frmts/geojson/libjson/GNUmakefile")
    self.run("touch config.rpath") # Add this line
    tools.replace_in_file("./configure", "iconv.h", "iconv_h")

The second error

When running ue4 conan build "gdal-ue4==2.4.0" again, you'll now get this error:

...
Exporting recipe for package "cares-ue4/1.13.0@adamrehn/4.26"...
['conan', 'export', '/Users/falcon4ever/.config/conan-ue4cli/recipes/cares-ue4/1.13.0/conanfile.py', 'cares-ue4/1.13.0@adamrehn/4.26']
Exporting package recipe
cares-ue4/1.13.0@adamrehn/4.26: The stored package has not changed
cares-ue4/1.13.0@adamrehn/4.26: Exported revision: e88d6c749d3f4398eb0e18d16d3fe155
The following packages will be built:
- gdal-ue4/2.4.0

Building package "gdal-ue4/2.4.0@adamrehn/4.26"...
['conan', 'install', 'gdal-ue4/2.4.0@adamrehn/4.26', '--profile=ue4.26-Mac', '--build=missing']
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
UNREAL_ENGINE_VERSION=4.26
gdal-ue4/2.4.0@adamrehn/4.26: WARN: Package binary is corrupted, removing: 1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4
Installing package: gdal-ue4/2.4.0@adamrehn/4.26
Requirements
    UElibPNG/ue4@adamrehn/4.26 from local cache - Cache
    gdal-ue4/2.4.0@adamrehn/4.26 from local cache - Cache
    geos-ue4/3.6.3@adamrehn/4.26 from local cache - Cache
    libcurl/ue4@adamrehn/4.26 from local cache - Cache
    libcxx/ue4@adamrehn/profile from local cache - Cache
    proj-ue4/4.9.3@adamrehn/4.26 from local cache - Cache
    ue4lib/ue4@adamrehn/profile from local cache - Cache
    ue4util/ue4@adamrehn/profile from local cache - Cache
    zlib/ue4@adamrehn/4.26 from local cache - Cache
Packages
    UElibPNG/ue4@adamrehn/4.26:87bb46ca79cf1a884ec5876fd7a11d6383ff831e - Cache
    gdal-ue4/2.4.0@adamrehn/4.26:1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4 - Build
    geos-ue4/3.6.3@adamrehn/4.26:e7d97686abf5b5085c7dd4dbc2d3a864492899b8 - Cache
    libcurl/ue4@adamrehn/4.26:87bb46ca79cf1a884ec5876fd7a11d6383ff831e - Cache
    libcxx/ue4@adamrehn/profile:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    proj-ue4/4.9.3@adamrehn/4.26:e7d97686abf5b5085c7dd4dbc2d3a864492899b8 - Cache
    ue4lib/ue4@adamrehn/profile:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    ue4util/ue4@adamrehn/profile:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    zlib/ue4@adamrehn/4.26:87bb46ca79cf1a884ec5876fd7a11d6383ff831e - Cache

Installing (downloading, building) binaries...
libcxx/ue4@adamrehn/profile: Already installed!
ue4lib/ue4@adamrehn/profile: Already installed!
ue4util/ue4@adamrehn/profile: Already installed!
UElibPNG/ue4@adamrehn/4.26: Already installed!
geos-ue4/3.6.3@adamrehn/4.26: Already installed!
libcurl/ue4@adamrehn/4.26: Already installed!
libcurl/ue4@adamrehn/4.26: WARN: Lib folder doesn't exist, can't collect libraries: /Users/falcon4ever/.conan/data/libcurl/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e/lib
proj-ue4/4.9.3@adamrehn/4.26: Already installed!
zlib/ue4@adamrehn/4.26: Already installed!
gdal-ue4/2.4.0@adamrehn/4.26: WARN: Build folder is dirty, removing it: /Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4
gdal-ue4/2.4.0@adamrehn/4.26: Copying sources to build folder
gdal-ue4/2.4.0@adamrehn/4.26: Building your package in /Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4
gdal-ue4/2.4.0@adamrehn/4.26: Generator cmake created conanbuildinfo.cmake
gdal-ue4/2.4.0@adamrehn/4.26: Aggregating env generators
gdal-ue4/2.4.0@adamrehn/4.26: Calling build()
Warning: the libcxx package has been deprecated and will be removed in a future version of conan-ue4cli.
+ aclocal -I ./m4
+ autoconf
configure.ac:48: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:48: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_cflags_warn_all.m4:26: AX_CFLAGS_WARN_ALL is expanded from...
configure.ac:48: the top level
configure.ac:49: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:49: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_cflags_warn_all.m4:71: AX_CXXFLAGS_WARN_ALL is expanded from...
configure.ac:49: the top level
configure.ac:222: warning: The macro `AC_LIBTOOL_WIN32_DLL' is obsolete.
configure.ac:222: You should run autoupdate.
m4/ltoptions.m4:148: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:222: the top level
configure.ac:222: warning: AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
configure.ac:222: put the 'win32-dll' option into LT_INIT's first parameter.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
m4/ltoptions.m4:148: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:222: the top level
configure.ac:223: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:223: You should run autoupdate.
m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:223: the top level
configure.ac:293: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:293: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:293: the top level
configure.ac:369: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:369: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:369: the top level
configure.ac:498: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:498: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:498: the top level
configure.ac:973: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:973: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:973: the top level
configure.ac:992: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:992: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:992: the top level
configure.ac:1009: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1009: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:1009: the top level
configure.ac:1030: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:1030: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:1030: the top level
configure.ac:1034: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:1034: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:1034: the top level
configure.ac:1051: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1051: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:1051: the top level
configure.ac:1072: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1072: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:1072: the top level
configure.ac:2659: warning: AC_CHECK_HEADERS($NETCDF_INCLUDEDIR/netcdf_mem.h): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
configure.ac:2659: the top level
configure.ac:3285: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3285: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_oracle_oci.m4:41: AX_LIB_ORACLE_OCI is expanded from...
configure.ac:3285: the top level
configure.ac:3421: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3421: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_xerces.m4:37: AX_LIB_XERCES is expanded from...
configure.ac:3421: the top level
configure.ac:3447: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3447: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_expat.m4:37: AX_LIB_EXPAT is expanded from...
configure.ac:3447: the top level
configure.ac:3461: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3461: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_libkml.m4:48: AX_LIB_LIBKML is expanded from...
configure.ac:3461: the top level
configure.ac:3540: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3540: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_oracle_oci.m4:41: AX_LIB_ORACLE_OCI is expanded from...
configure.ac:3540: the top level
configure.ac:3801: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3801: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_sqlite3.m4:32: AX_LIB_SQLITE3 is expanded from...
configure.ac:3801: the top level
configure.ac:3836: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:3836: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/ax_lib_sqlite3.m4:32: AX_LIB_SQLITE3 is expanded from...
configure.ac:3836: the top level
configure.ac:4026: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:4026: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:4026: the top level
configure.ac:5483: warning: The macro `AC_CHECKING' is obsolete.
configure.ac:5483: You should run autoupdate.
./lib/autoconf/general.m4:2499: AC_CHECKING is expanded from...
configure.ac:5483: the top level
configure.ac:5829: warning: AC_OUTPUT should be used without arguments.
configure.ac:5829: You should run autoupdate.
Warning: the libcxx package has been deprecated and will be removed in a future version of conan-ue4cli.
gdal-ue4/2.4.0@adamrehn/4.26: Calling:
 > ./configure '--prefix=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4' '--datarootdir=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4/data' '--enable-static' '--disable-shared' '--without-libtool' '--enable-pdf-plugin=no' '--without-ld-shared' '--with-threads=yes' '--with-libz=/Users/falcon4ever/.conan/data/zlib/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-liblzma' '--without-libiconv-prefix' '--without-pg' '--without-grass' '--without-libgrass' '--without-cfitsio' '--without-pcraster' '--with-png=/Users/falcon4ever/.conan/data/UElibPNG/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-mrf' '--without-dds' '--without-gta' '--with-libtiff=internal' '--with-geotiff=internal' '--with-jpeg=internal' '--with-rename_internal_libtiff_symbols' '--with-rename_internal_libgeotiff_symbols' '--without-jpeg12' '--without-gif' '--without-ogdi' '--without-fme' '--without-sosi' '--without-mongocxx' '--without-hdf4' '--without-hdf5' '--without-kea' '--without-netcdf' '--without-jasper' '--without-openjpeg' '--without-fgdb' '--without-ecw' '--without-kakadu' '--without-mrsid' '--without-jp2mrsid' '--without-mrsid_lidar' '--without-msg' '--without-bsb' '--without-oci' '--without-oci-include' '--without-oci-lib' '--without-grib' '--without-mysql' '--without-ingres' '--without-xerces' '--without-expat' '--without-libkml' '--without-odbc' '--with-dods-root=no' '--without-curl' '--without-xml2' '--without-spatialite' '--without-sqlite3' '--without-pcre' '--without-idb' '--without-sde' '--without-epsilon' '--without-webp' '--without-qhull' '--with-freexl=no' '--with-libjson-c=internal' '--without-pam' '--without-poppler' '--without-podofo' '--without-pdfium' '--without-perl' '--without-python' '--without-java' '--without-mdb' '--without-rasdaman' '--without-armadillo' '--without-cryptopp' '--with-zstd=no' '--with-proj=/Users/falcon4ever/.conan/data/proj-ue4/4.9.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8' '--with-geos=/Users/falcon4ever/.conan/data/geos-ue4/3.6.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8/bin/geos-config' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
checking build system type... x86_64-apple-darwin21.3.0
checking host system type... x86_64-apple-darwin21.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4/gdal/gdal':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
gdal-ue4/2.4.0@adamrehn/4.26: 
gdal-ue4/2.4.0@adamrehn/4.26: ERROR: Package '1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4' build failed
gdal-ue4/2.4.0@adamrehn/4.26: WARN: Build folder /Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4
ERROR: gdal-ue4/2.4.0@adamrehn/4.26: Error in build() method, line 132
    self.build_unix()
while calling 'build_unix', line 250
    autotools.configure(args=self.configure_flags())
    ConanException: Error 77 while executing ./configure '--prefix=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4' '--datarootdir=/Users/falcon4ever/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/1ff33548b8c8590f9b7b99605ae8759b3b6bc4d4/data' '--enable-static' '--disable-shared' '--without-libtool' '--enable-pdf-plugin=no' '--without-ld-shared' '--with-threads=yes' '--with-libz=/Users/falcon4ever/.conan/data/zlib/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-liblzma' '--without-libiconv-prefix' '--without-pg' '--without-grass' '--without-libgrass' '--without-cfitsio' '--without-pcraster' '--with-png=/Users/falcon4ever/.conan/data/UElibPNG/ue4/adamrehn/4.26/package/87bb46ca79cf1a884ec5876fd7a11d6383ff831e' '--without-mrf' '--without-dds' '--without-gta' '--with-libtiff=internal' '--with-geotiff=internal' '--with-jpeg=internal' '--with-rename_internal_libtiff_symbols' '--with-rename_internal_libgeotiff_symbols' '--without-jpeg12' '--without-gif' '--without-ogdi' '--without-fme' '--without-sosi' '--without-mongocxx' '--without-hdf4' '--without-hdf5' '--without-kea' '--without-netcdf' '--without-jasper' '--without-openjpeg' '--without-fgdb' '--without-ecw' '--without-kakadu' '--without-mrsid' '--without-jp2mrsid' '--without-mrsid_lidar' '--without-msg' '--without-bsb' '--without-oci' '--without-oci-include' '--without-oci-lib' '--without-grib' '--without-mysql' '--without-ingres' '--without-xerces' '--without-expat' '--without-libkml' '--without-odbc' '--with-dods-root=no' '--without-curl' '--without-xml2' '--without-spatialite' '--without-sqlite3' '--without-pcre' '--without-idb' '--without-sde' '--without-epsilon' '--without-webp' '--without-qhull' '--with-freexl=no' '--with-libjson-c=internal' '--without-pam' '--without-poppler' '--without-podofo' '--without-pdfium' '--without-perl' '--without-python' '--without-java' '--without-mdb' '--without-rasdaman' '--without-armadillo' '--without-cryptopp' '--with-zstd=no' '--with-proj=/Users/falcon4ever/.conan/data/proj-ue4/4.9.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8' '--with-geos=/Users/falcon4ever/.conan/data/geos-ue4/3.6.3/adamrehn/4.26/package/e7d97686abf5b5085c7dd4dbc2d3a864492899b8/bin/geos-config' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
Traceback (most recent call last):
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/bin/ue4", line 8, in <module>
    sys.exit(main())
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/ue4cli/cli.py", line 222, in main
    SUPPORTED_COMMANDS[command]['action'](manager, args)
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/main.py", line 48, in main
    SUBCOMMANDS[subcommand]['function'](manager, args[1:])
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/commands/build.py", line 130, in build
    builder.build(name, version, args.options if args.options is not None else [])
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/common/PackageBuilder.py", line 45, in build
    self._executor.execute(command, cwd=tempDir, check=True)
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/site-packages/conan_ue4cli/common/CommandExecutor.py", line 19, in execute
    return subprocess.run(command, **kwargs).returncode == 0
  File "/Users/falcon4ever/.pyenv/versions/3.9.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['conan', 'install', 'gdal-ue4/2.4.0@adamrehn/4.26', '--profile=ue4.26-Mac', '--build=missing']' returned non-zero exit status 1.

The error is configure: error: cannot run C compiled programs..

Unfortunately, I am not quite sure what to try next. I tried updating the command line tools and looked at some tips posted in here https://stackoverflow.com/questions/53038856/macos-configure-error-cannot-run-c-compiled-programs but those seem to apply to older macOS/XCode versions.

Have others attempt to build UnrealGDAL for macOS Monterey / XCode 13 recently?

falcon4ever commented 2 years ago

To follow up, I don't think it's a macOS Monterey or XCode 13 thing, it has something to do with the c/c++ tooling. Below are my findings with a workaround.

I downgraded my intel mbp and used this environment:

Setting things up The same as what the online instructions tell you to do.

pip3 install ue4cli conan-ue4cli
cd /Users/Shared/Epic\ Games
git clone --depth=1 -b 4.26.2-release git@github.com:EpicGames/UnrealEngine.git 
cd /Users/Shared/Epic\ Games/UnrealEngine
./Setup.sh 
./GenerateProjectFiles.sh
ue4 setroot /Users/Shared/Epic\ Games/UnrealEngine 
ue4 conan generate
ue4 setroot /Users/Shared/Epic\ Games/UE_4.26

Installing basic build tools brew install cmake (this will install v3.22.2) brew install autoconf (this will install 2.71) brew install automake (this will install 1.16.5) brew install libtool (this will install 2.4.6_4)

When you try to build unreal gdal: ue4 conan build "gdal-ue4==2.4.0" "mergetiff-ue4==0.0.6" You will get the first error as reported in the previous post about the configure: error: cannot find required auxiliary files: config.rpath issue.

Looks like autoconf (v2.71) is the problem here. To fix it, you can do the following:

brew uninstall --ignore-dependencies autoconf
brew install autoconf@2.69
brew link autoconf@2.69
echo 'export PATH="/usr/local/opt/autoconf@2.69/bin:$PATH"' >> ~/.zshrc

Open up a new terminal and try: ue4 conan build "gdal-ue4==2.4.0" "mergetiff-ue4==0.0.6"

You will now run into the same configure: error: cannot run C compiled programs. problem.

  1. I'm unsure why this happens, but the first thing you should do is open up the file /Users/xxx/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/31e5be5d8de691493e5c836dc5677702c9c6dacb/gdal/gdal/config.log
  2. There should be a line like It was created by configure, which was generated by GNU Autoconf 2.69. Invocation command line was at the top.
  3. Copy that ./configure ... thing to you text editor.
  4. If you open up a new terminal and go to /Users/xxx/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/31e5be5d8de691493e5c836dc5677702c9c6dacb/gdal/gdal/ (modify the username and hash), and run that exact ./configure command, you'll see it succeed just fine.
  5. When you try to do make && make install, it will build fine but it will fail to install (it's trying to install it in /lib).
  6. With this knowledge you should be able to apply a workaround in the /Users/xxx/.config/conan-ue4cli/recipes/gdal-ue4/2.4.0/conanfile.py recipe.
  7. Open up the conanfile.py
  8. Replace autotools.configure(args=self.configure_flags()) with self.run("xxx") and replace the xxx with the entire ./configure command that you found in config.log
  9. Replace autotools.make(target="install") with self.run("make DESTDIR=/Users/xxx/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/package/31e5be5d8de691493e5c836dc5677702c9c6dacb install") (again replace the username and the hash here)
  10. Run ue4 conan build "gdal-ue4==2.4.0" "mergetiff-ue4==0.0.6" and it will build gdal fine, cache/package the lib and it should now be usable for UnrealGDAL.

I'm not entirely sure why configure via the recipe acts differently than running it directly from the terminal (it seems to add additional PATHs as well) but at least the above will allow you to generate working macOS binaries.

falcon4ever commented 2 years ago

After doing the above, you should probably do the following:

On the mac you might have issues with UE4 launching and building the project giving you this error: Creating makefile for xxxEditor (no existing makefile) ERROR: Unable to instantiate module 'GDAL': System.ComponentModel.Win32Exception (0x80004005): ApplicationName='conan', CommandLine='install . -g=json --profile=ue4.26-Mac-x86_64'

That's because this: https://github.com/TensorWorks/UnrealGDAL/blob/master/Source/GDAL/GDAL.Build.cs#L21

I'm not sure if this is a macOS specific issue but you can patch it as follows:

String.Format("{0}-{1}", target.Platform.ToString(), target.Architecture) :
            target.Platform.ToString();

to

String.Format("{0}", target.Platform.ToString()) :
            target.Platform.ToString();

which will turn ue4.26-Mac-x86_64 into ue4.26-Mac and keep UE4 happy.