Closed zach-morris closed 4 years ago
Strange, you should definitely have nproc
on macOS.
I just built it successfully on Mojave and got a lot further.
Ah, i didn't even realize it didn't find nproc at the top. I tried just make, make -j2, and make -j$(sysctl -n hw.physicalcpu). All fail in a similar manner and dont complete the build.
I believe it fails because this code uses modern C++ features
So, changing: https://github.com/Jakz/retro8/blob/96e26e7b7052e23e04682661b6ad7760e72966dc/Makefile#L140-L141
To:
CFLAGS += -Wall -D__LIBRETRO__ $(fpic) $(INCFLAGS) -stdlib=libc++ -std=gnu++11
CXXFLAGS += -Wall -D__LIBRETRO__ $(fpic) $(INCFLAGS) -stdlib=libc++ -std=gnu++11
...gets us down to only 3 errors:
src/vm/lua_bridge.cpp:677:36: error: unexpected type name 'data_t': expected expression
lua_pushnumber(L, std::bit_not<data_t>()(a));
^
src/vm/lua_bridge.cpp:677:28: error: no member named 'bit_not' in namespace 'std'
lua_pushnumber(L, std::bit_not<data_t>()(a));
~~~~~^
src/vm/lua_bridge.cpp:677:44: error: expected expression
lua_pushnumber(L, std::bit_not<data_t>()(a));
^
Almost there!
So, changing: https://github.com/Jakz/retro8/blob/96e26e7b7052e23e04682661b6ad7760e72966dc/Makefile#L140-L141
To:
CFLAGS += -Wall -D__LIBRETRO__ $(fpic) $(INCFLAGS) -stdlib=libc++ -std=c++17
CXXFLAGS += -Wall -D__LIBRETRO__ $(fpic) $(INCFLAGS) -stdlib=libc++ -std=c++17
And it compiles!
Though there appear to be some issues, compare these to this repo readme:
I added a Xcode project that you can try with SDL back-end standalone to check if it's an issue with RetroArch core or with emulation in general.
I do not have libSDL2.a
but rather SDL2.framework
and building against that I cannot get it to launch:
$ ./retro8 api.p8
Using renderer pixel format: SDL_PIXELFORMAT_ARGB8888
Error on lua_pcall on init
attempt to get length of a nil value
and no screen appears.
yes I'm using the brew supplied SDL2 to use standard paths instead of shipping the repository with the framework.
I have brew SDL2 installed but Xcode couldn't find libSDL2.a
@Jakz I've create a pull request that fixes linking to SDL2. It was pointing to a specific relative path on your machine before.
I was able to build and run it using my fork.
👍 I close the issue then, thanks for fixes!
Perhaps it's too early to create an issue for this, so if so feel free to close/delete this.
Attempting to compile on OSX fails as follows:
Anything specific to configure for compiling?