Script to Compile the latest github for retroarch+cores for iOS

So I just tested it. It freezes up currently. I will debug it a bit more later. I would like to get more feedback on the core though first - and I’d love to know how to generate logs on iOS.

OK. In what place I must

add the lines:

FORCE_GLES=1
CXXFLAGS += -Wc++11-extensions -std=c++11 -stdlib=libc++ -Wc++11-long-long ?

Okay, I updated my chailove instructions. They compiled earlier, but broke in practice.

The ones currently on there compile and run games :smiley:

1 Like

Thanks jet082 for all the findings. Here is a fork of the parallel-n64 repo that compiles for ios-arm64:

I made the same changes that jet082 suggested, but mostly in a way that doesn’t break other platforms.

It also freezes for me when loading content. To debug this, we’d need to add printf statements in the core code (probably in glitchmain.c, after line 106 since that’s where the last logged message was in the console) to see where it’s freezing. When i paused the execution in the debugger, it didn’t look like it was actually doing anything so something is causing it to hang.

2 Likes

@jet082 Ok, 4 more cores compiled thanks to your instructions !

bsnes_cplusplus98
chailove
mame2010
parallel_n64

I still can’t manage to compile easyrpg with your current instructions… The error seems to be because CMake tries to compile “a simple test program” to test the c++ compiler, but targets MacOSX :

clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]

@Weedy_Weed_Smoker

  1. Install brew https://brew.sh/
  2. brew install cmake
  3. brew install pkg-config

Run the following commands in order from the root of libretro-super

rm -rf libretro-easyrpg
./libretro-fetch.sh easyrpg
cd libretro-easyrpg
git submodule update --init
cd ..
./libretro-build-ios-arm64.sh easyrpg

If you get an error, please tell me what it is.

Also, I had an error in the chailove instructions. Please recompile that one and make sure it works (you can get games via retroarch’s own content downloader).

Hi harakari2,

have you seen my post here?:

yoshisuga is in progress I would really help with testing here. My ATV4K is waiting for some retrolove :wink:

Thanks

URBANsUNITED

@jet082 Actually, that’s exactly what I was doing…

macOS 10.14.6, latest Xcode… Just updated cmake (to a minor point revision), and pkg-config was up to date…

cd /Users/johan/Downloads/libretro-super/libretro-easyrpg/builds/libretro/../../builds/libretro;\
	CC="cc -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk" CXX="c++ -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk" CFLAGS="-miphoneos-version-min=8.0 -D__LIBRETRO__ -fPIC   -DGIT_VERSION=580d933d -DWANT_FASTWAV" CXXFLAGS="-DUSE_POSIX_MEMALIGN -D__RETRO_ARM__ -miphoneos-version-min=8.0 -DNDEBUG -O3 -D__LIBRETRO__ -fpermissive -fPIC   -DGIT_VERSION=580d933d -DWANT_FASTWAV -std=c++11" LDFLAGS="" \
		cmake /Users/johan/Downloads/libretro-super/libretro-easyrpg/builds/libretro/../.. -DPLAYER_TARGET_PLATFORM=libretro \
		-DBUILD_SHARED_LIBS=ON -DCMAKE_FIND_ROOT_PATH=/Users/johan/Downloads/libretro-super/libretro-easyrpg/builds/libretro/../../builds/libretro/deps/libretro \
		-DPLAYER_ENABLE_TESTS=OFF -DPLAYER_WITH_XMP=OFF \
		-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY 
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- broken
CMake Error at /usr/local/Cellar/cmake/3.15.3/share/cmake/Modules/CMakeTestCXXCompiler.cmake:53 (message):
  The C++ compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/johan/Downloads/libretro-super/libretro-easyrpg/builds/libretro/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_76c31/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_76c31.dir/build.make CMakeFiles/cmTC_76c31.dir/build
    Building CXX object CMakeFiles/cmTC_76c31.dir/testCXXCompiler.cxx.o
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk    -DUSE_POSIX_MEMALIGN -D__RETRO_ARM__ -miphoneos-version-min=8.0 -DNDEBUG -O3 -D__LIBRETRO__ -fpermissive -fPIC   -DGIT_VERSION=580d933d -DWANT_FASTWAV -std=c++11  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -o CMakeFiles/cmTC_76c31.dir/testCXXCompiler.cxx.o -c /Users/johan/Downloads/libretro-super/libretro-easyrpg/builds/libretro/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
    clang: warning: argument unused during compilation: '-mno-thumb' [-Wunused-command-line-argument]
    Linking CXX executable cmTC_76c31
    /usr/local/Cellar/cmake/3.15.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_76c31.dir/link.txt --verbose=1
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk  -DUSE_POSIX_MEMALIGN -D__RETRO_ARM__ -miphoneos-version-min=8.0 -DNDEBUG -O3 -D__LIBRETRO__ -fpermissive -fPIC   -DGIT_VERSION=580d933d -DWANT_FASTWAV -std=c++11  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTC_76c31.dir/testCXXCompiler.cxx.o  -o cmTC_76c31 
    clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libc++.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libc++.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [cmTC_76c31] Error 1
    make[1]: *** [cmTC_76c31/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!

May be related to this :

https://forums.developer.apple.com/thread/100545

Coming soon bsnes HD with HD Mode 7!

Just got it to compile with some brute force but I’ll have a PR for it soon!

1 Like

@harakari2 OMG at last a RetroArch core for this wonderful project! :wink: Thanks! (I have a feeling it will not play nice with shaders, though… But this will be the core of choice for Mode 7 SNES games for me!)

Any thought on how to implement (with a setting, or another core variant ?) its widescreen support ?


Things are finally moving forward (as Apple intended :smile:)… RetroArch on iOS 64-bit doesn’t seem like it’s missing too much now — apart from JIT, anyway!

Yeah it’s pretty exciting :slight_smile:

I have 4x scale running with different crt shaders (lotte-fast and easymode) working gloriously :smiley:

I made the PR for the bsnes HD core for iOS and tvOS.

1 Like

@Weedy_Weed_Smoker I can’t really tell you what to do as it seems like an issue with your Xcode version. I am currently building off of the recent beta for iOS 13. Perhaps try upgrading to that and see if it works.

1 Like

@jet082 Still no luck on the latest Xcode beta (and setting to the Xcode 11 Command Line Tools…), failing to compile chailove with the exact same error with current instructions…

easyrpg too, BTW…


Maybe you can share those 2 cores with me (or at least, chailove, as @harakari2 already shared his compiled version of easyrpg…)

If you just use the command “./libretro-build-ios-arm64.sh chailove”, the core will NOT be signed, therefore no identifying information could be traced back to you (and I WILL remove any traces of previous signing before uploading, anyway…)

tvOS buildbot recipes are available!!!

@jet082 Please add these to your script…

As PRs get merged, I will remove them from my list of fixes above.

I will also, I think, modify my script to allow more easy building of various versions of iOS, including tvOS. I need to update it anyway as I’ve expanded it to cover more random things.

Give it a day or two. Maybe the weekend.

Special for you https://yadi.sk/d/f7koEyQdptMxxw ipa with desmume fceumm beetle_psx beetle_saturn snes_(accuracy, balance, performance) and picodrive )))

1 Like

FANTASTIC!!! Does it also include a SNES emu? That would be perfect… Will give it a try this evening.

Many thanks for doing this!! :star_struck::star_struck::star_struck:

now include snes too

1 Like

FABULOUS! Tried the SNES, NES and PSX emu all 3 are doing great! The NDS ones is playable, but no full speed. We check later if I missed some options to set to gain speed. Will play with the shaders to get a nice optic on my TV. Selfsigned the app and see no problems on tvOS 13

Thanks again @xdccrlz

Okay, I updated the script. It is now in Python and is MUCH easier to modify to build things like tvOS (where you can get over 100 cores easily), other versions of iOS, and potentially even OSX and other builds.

You can now also list an arbitrary number of fallback architectures (for example, “if iOS10 building fails, try iOS9 and use those cores in the finished IPA”). It can be 0 or it can be 1000. Just edit listOfFallbacks. The fallback priority is in the order listed in descending order.

Likewise, if you just want to do one thing or another (say, just build cores or just build the IPA), you can do that very easily by commenting out a line or two at the very bottom of the file.

To compile tvOS automatically @URBANsUNITED

  1. Open RetroArch_iOS11.xcodeproj with xcode and set your team, etc. in the RetroArchTV target. You should only need to do this once - future running of the script can ignore it.
  2. Then set manualSigning to False in the script.
  3. Set finalPackage to tvos-arm64
  4. I’d recommend either listing “ios-arm64” in the fallbacks or no fallbacks at all
2 Likes