WIZARD
April 20, 2023, 1:47am
45
Haha seems like its definitely the simplest way to go. Thanks anyways!
scrptr9:
client.h
Just got an M2 Mac yesterday. Getting it to compile a native arm binary didn’t require much work. I would open a PR but I’m too lazy to create a ‘sideoflamp’ GitHub account. Below is the diff to get it to compile. Otherwise follow the guide(brew install libpng and libmpv)
diff --git a/OFS-lib/OFS_Util.h b/OFS-lib/OFS_Util.h
index ed04881..821ff31 100644
--- a/OFS-lib/OFS_Util.h
+++ b/OFS-lib/OFS_Util.h
@@ -20,9 +20,14 @@
#include "OFS_Profiling.h"
#include "OFS_FileLogging.h"
+#ifdef __x86_64__
#include "emmintrin.h" // for _mm_pause
-
#define OFS_PAUSE_INTRIN _mm_pause
+#elif __aarch64__
+#include <thread>
+#define OFS_PAUSE_INTRIN std::this_thread::yield
+#endif
+
Not sure why he wanted to use mm_pause over yield but I left that in place.
1 Like
Thanks for the guide. I am running macOS Catalina version 10.15.7. It is an intel. I downloaded the compatible XCode. I made it to : For Intel Macs only: brew install mpv, then I get the following error "Error: mpv: Failed to download resource “libvorbis”
Download failed: Homebrew-installed curl
is not installed for: https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz " anyone else had this error?
Okay I lied, opened a PR. Didn’t want to have to do this each time the repo updated.
1 Like
RPVE
June 17, 2023, 12:15pm
49
Thanks for the tutorial I made it! Can’t believe it works on M1 mac! Something I want to add to the tutorial is that you should use root user to copy OpenFunscripter.app to /Applications/.
Just a heads, the app will run slower/use more cpu to virturalize it as an x86 app instead of arm, which is why I posted the above.
1 Like
Hi, would it work whit the Parallels. I was thinking about both the OFS and the auto script generator??
Thanks!
Hello, mates…
I remember giving a try compiling OFS once and after much fighting… Nothing !
So first, thank you people for I have been able to compile a (somewhat) working 3.2.0 OFS, following guides and notes from the (obviously) real developers in this thread.
Compiled app is x86_64 3.2.0 on a M1 MacBookAir (2020 I believe).
I followed Mongoose’s instructions, applied sideoflamp’s diff file and removed some flags for sdl to compile. So far I can tell everything works except for the “VR” display, but selecting any other projection works (eg. left pane). I can open v2 project files, scripts, videos, create projects and export scripts…
To get SDL to compile I had to remove the “-Wdeclaration-after-statement” and " -Werror=declaration-after-statement" in the flags.make file located in "whereYouCloned/OpenFunscripter/build/lib/SDL2/CMakeFiles/SDL2-static.dir.
I also removed them from “compile-commands.json” from the root of the build folder but I don’t think it’s necessary. You’ll know better than I do.
Now I should go on to fight with Motion tracking but from reading you all, I’m not sure I should dive into that…
Anyway, thank you all, @Mongoose , @sideoflamp , @559lawndart for the functional OFS and of course @gagax123
Out of curiosity, should I / can I get rid of the x86 brew ? As I now use zsh, I put all the export variables in my .bash_profile, so if I use zsh daily with the “correct” arm brew paths and x86 bash on occasion with its correct paths, is it secure or will things eventually turn to shit anyway ?..
Update:
Got an old i7 MacBookPro on Catalina and got it to compile v3.2.0. Versions 1.4.4 and 2.0.0 didn’t compile, giving the same error (don’t remember, I’ll leave a note).
I’m pretty sure I once used MTFG (not the extension) on x86 mac with native Python. So far on my m1 I am able to launch main.py, load a video, use mpv and launch the settings window of the tracker but as soon as I click OK, Python crashes with “Exception 4”. I got the extension to load in ofs but all the same. Seems like MTFG calls something in the wrong architecture and then crashes ?..
Update again:
Did build @sideoflamp patched fork (git clone https://github.com/sideoflamp/OFS.git --branch patch-1), had to remove the same flags for SDL to compile, and then it indeed builds a native arm .app without errors but I can’t get the app to launch, will investigate… For starters it seems to be unable to find libmpv.
1 Like
k00gar
July 25, 2023, 1:22pm
54
Hi there,
I managed to compile OFS 3.2.0 on my M1 Mac thanks to all your guidelines and tips, but am definitely looking forward to being able to use any motion tracking option to optimize my scripting time and lessen the suffering
Did my first script by hand, and ended up quite exhausted.
If there is any way to make that work on an M1 chip, I can’t wait to hear more from you if you ever end up making that miracle happen !
1 Like
Maybe you know already but the Handy simple scripter web app has got some motion tracking. I usually use it for motion tracking only and do the rest in OFS.
k00gar
July 25, 2023, 7:03pm
56
Thank you @kinetics , somehow I did not manage to have it work on my side. Is there a resolution limit constraint to make it work as expected ?
Not sure. You need Chrome and I’m not sure it works with VR - only tried 2D.
1 Like
k00gar
August 7, 2023, 12:19pm
58
Same behavior here, compiled the patched fork as an ARM native app, but crashes instantly upon launching. Please let us know if you manage to get any further on
1 Like
system
(system)
Closed
November 5, 2023, 12:19pm
59
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
Tried following all the tips in this thread, but I still can complete a make without errors.
error: address of overloaded function 'call' does not match required type 'int (lua_State *)'
and
11 warnings and 1 error generated.
make[2]: *** [src/CMakeFiles/OpenFunscripter.dir/lua/api/OFS_LuaScriptAPI.cpp.o] Error 1
anyone seen these type of errors before? I’m on an M1 running Sequoia
Thanks
terlet
March 14, 2025, 11:22pm
62
i have not had success with making a working arm64 build. here are my steps so far:
deps:
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install mpv cmake
OFS (using @sideoflamp 's patched version):
git clone https://github.com/sideoflamp/OFS.git ~/OpenFunscripter
cd ~/OpenFunscripter
git checkout patch-1
git submodule update --init
oops, a SDL2
build error:
lib/SDL2/src/hidapi/mac/hid.c:1091:6: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
opened 12:57PM - 23 Apr 24 UTC
closed 07:57PM - 23 Apr 24 UTC
When trying to build SDL2 as a dependency of my Ylikuutio game engine (https://g… ithub.com/nrz/ylikuutio), on GitHub Actions' MacOS runner the build fails as follows:
```
[ 32%] Building C object external/SDL/CMakeFiles/SDL2-static.dir/src/hidapi/SDL_hidapi.c.o
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/SDL_hidapi.c:252:72: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
^~~~~~~~~~~~~~~~~~~~
kIOMainPortDefault
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
^
In file included from /Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/SDL_hidapi.c:578:
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:163:23: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
struct input_report *rpt = dev->input_reports;
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:265:11: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
CFIndex str_len = CFStringGetLength(str);
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:304:11: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
CFIndex str_len = CFStringGetLength(str);
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:530:11: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
CFSetRef device_set = IOHIDManagerCopyDevices(hid_mgr);
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:742:25: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
CFRunLoopSourceContext ctx;
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:848:34: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
struct hid_device_list_node *node = (struct hid_device_list_node *)calloc(1, sizeof(struct hid_device_list_node));
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:812:11: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
CFSetRef device_set = IOHIDManagerCopyDevices(hid_mgr);
^
/Users/runner/work/ylikuutio/ylikuutio/external/SDL/src/hidapi/mac/hid.c:1091:6: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
int skipped_report_id = 0;
^
1 warning and 8 errors generated.
make[2]: *** [external/SDL/CMakeFiles/SDL2-static.dir/src/hidapi/SDL_hidapi.c.o] Error 1
make[1]: *** [external/SDL/CMakeFiles/SDL2-static.dir/all] Error 2
make: *** [all] Error 2
Error: Process completed with exit code 2.
```
I'm building SDL2 as a dependency of my Ylikuutio engine using CMake and `add_subdirectory` command of CMake (so I expect that SDL's own `CMakeLists.txt` should set proper C version for SDL):
https://github.com/nrz/ylikuutio/blob/master/external/CMakeLists.txt#L86-L88
```
if(COMPILE_SDL_FROM_SOURCE)
add_subdirectory(SDL)
endif()
```
Version info from the GitHub Actions Apple Clang build:
```
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```
More information from the build run:
```
-- The C compiler identification is AppleClang 15.0.0.15000040
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/OpenGL.framework
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
CMake Deprecation Warning at external/pugixml/CMakeLists.txt:1 (cmake_minimum_required):
-- Found Threads: TRUE
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at external/zlib/CMakeLists.txt:1 (cmake_minimum_required):
-- Looking for sys/types.h
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at external/zlib/CMakeLists.txt:4 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH
This warning is for project developers. Use -Wno-dev to suppress it.
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Renaming
CMake Deprecation Warning at external/libpng-1.6.37/CMakeLists.txt:21 (cmake_minimum_required):
-- /Users/runner/work/ylikuutio/ylikuutio/external/zlib/zconf.h
Compatibility with CMake < 3.5 will be removed from a future version of
-- to 'zconf.h.included' because this file is included with zlib
CMake.
-- but CMake generates it automatically in the build directory.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at external/libpng-1.6.37/CMakeLists.txt:22 (cmake_policy):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The ASM compiler identification is AppleClang
-- Found assembler: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Found ZLIB: /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libz.tbd (found version "1.2.12")
-- Symbol prefix:
CMake Deprecation Warning at external/SDL/CMakeLists.txt:5 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- The OBJC compiler identification is AppleClang 15.0.0.15000040
-- Detecting OBJC compiler ABI info
-- Detecting OBJC compiler ABI info - done
-- Check for working OBJC compiler: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
```
Please let me know if you need any additional information for this :)
let’s update release-2.0.22 → release-2.32.2 to fix it:
cd lib/SDL2
git checkout release-2.32.2
ok, and now a sol2
build error:
lib/sol2/include/sol/function_types_stateless.hpp:323:14: note: candidate template ignored: substitution failure [with is_yielding = false, no_trampoline = false]
try updating v3.3.0 → v3.5.0:
cd ../sol2
git checkout v3.5.0
shit, that didn’t work. let’s try this guy’s workaround:
opened 11:24AM - 16 Feb 24 UTC
On the latest major release (candidate) of Clang, sol2 flat out doesn't compile … with a fatal error and spits out a bunch of warnings.
https://github.com/jpxs-intl/RosaServer/actions/runs/7929791195/job/21650728959 for the run logs, or here:
```
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/function_types.hpp:110:31: fatal error: address of overloaded function 'call' does not match required type 'int (lua_State *)'
110 | lua_CFunction freefunc = &function_detail::upvalue_this_member_variable<C, Fx>::template call<is_yielding, no_trampoline>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/function_types.hpp:268:5: note: in instantiation of function template specialization 'sol::function_detail::select_member_variable<false, false, float Vector::*>' requested here
268 | select_member_variable<is_yielding, no_trampoline>(L, std::forward<Fx>(fx), std::forward<Args>(args)...);
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/function_types.hpp:392:22: note: in instantiation of function template specialization 'sol::function_detail::select<false, false, float Vector::*>' requested here
392 | function_detail::select<false, false>(L, std::forward<Args>(args)...);
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/stack_core.hpp:878:14: note: in instantiation of function template specialization 'sol::stack::unqualified_pusher<float Vector::*>::push<float Vector::*>' requested here
878 | return p.push(L, std::forward<T>(t), std::forward<Args>(args)...);
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/stack_field.hpp:222:7: note: in instantiation of function template specialization 'sol::stack::push<float Vector::*>' requested here
222 | push(L, std::forward<Value>(value));
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/stack_core.hpp:1250:59: note: in instantiation of function template specialization 'sol::stack::field_setter<const char *>::set<const char *, float Vector::*>' requested here
1250 | field_setter<meta::unqualified_t<Key>, global, raw> {}.set(L, std::forward<Key>(key), std::forward<Value>(value), tableindex);
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/table_core.hpp:264:14: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
264 | stack::set_field<global, raw>(L, std::forward<Key>(key), std::forward<Keys>(keys)..., table_index);
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/usertype.hpp:100:20: note: in instantiation of function template specialization 'sol::basic_table_core<false, sol::basic_reference<false>>::set<const char *, float Vector::*>' requested here
100 | table_base_t::set(std::forward<Key>(key), std::forward<Value>(value));
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/usertype_proxy.hpp:64:9: note: in instantiation of function template specialization 'sol::basic_usertype<Vector, sol::basic_reference<false>>::set<const char *, float Vector::*>' requested here
64 | tbl.set(std::get<I>(std::move(key))..., std::forward<T>(value));
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/usertype_proxy.hpp:86:21: note: in instantiation of function template specialization 'sol::usertype_proxy<sol::basic_usertype<Vector, sol::basic_reference<false>> &, const char *>::tuple_set<0UL, float Vector::*>' requested here
86 | std::move(*this).tuple_set(idx_seq(), std::forward<T>(item));
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/usertype_proxy.hpp:97:28: note: in instantiation of function template specialization 'sol::usertype_proxy<sol::basic_usertype<Vector, sol::basic_reference<false>> &, const char *>::set<float Vector::*>' requested here
97 | return std::move(*this).set(std::forward<T>(other));
| ^
/home/runner/work/RosaServer/RosaServer/RosaServer/rosaserver.cpp:87:13: note: in instantiation of function template specialization 'sol::usertype_proxy<sol::basic_usertype<Vector, sol::basic_reference<false>> &, const char *>::operator=<float Vector::*>' requested here
87 | meta["x"] = &Vector::x;
| ^
/home/runner/work/RosaServer/RosaServer/sol2/include/sol/function_types_stateless.hpp:323:14: note: candidate template ignored: substitution failure [with is_yielding = false, no_trampoline = false]
323 | static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v<T>) {
| ^
```
i basically tried removing noexcept(std::is_nothrow_copy_assignable_v<T>)
from lib/sol2/include/sol/function_types_stateless.hpp
at the line that generated the error message during build.
so the line looks like this now: static int call(lua_State* L) {
ok, it finally builds:
cd ~/OpenFunscripter && rm -rf build bin && cmake -B build && cd build && make
however, it crashes instantly when i open the .app
terlet
March 15, 2025, 2:50am
63
perhaps someone with an arm64-native bin can actually just host it somewhere so we don’t have to do this rosetta 2 business? i’m slightly allergic to the idea of installing homebrew twice
1 Like
Falafel
Closed
May 14, 2025, 2:51am
64
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.