Open falcon4ever opened 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:
xcode-select --install
)/Users/Shared/Epic Games/UE_4.26
)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.
/Users/xxx/.conan/data/gdal-ue4/2.4.0/adamrehn/4.26/build/31e5be5d8de691493e5c836dc5677702c9c6dacb/gdal/gdal/config.log
It was created by configure, which was generated by GNU Autoconf 2.69. Invocation command line was
at the top../configure ...
thing to you text editor./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./lib
)./Users/xxx/.config/conan-ue4cli/recipes/gdal-ue4/2.4.0/conanfile.py
recipe.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
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)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.
After doing the above, you should probably do the following:
ue4 conan precompute ue4.26-Mac
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.
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 toolspip3 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:
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:The second error
When running
ue4 conan build "gdal-ue4==2.4.0"
again, you'll now get this error: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?