Supermodel
Supermodel copied to clipboard
Build flow and compiling: Improving compilation by utilizing mingw/make – can't find SDL
@BlackPowerade and I are having a discussion over at the Scoop Games repository.
Scoop is a command-line installer – more commonly known as a package manager.
We're trying to figure out how to improve the compiling process of the emulator, particularly by using mingw
or make
in a GitHub Actions flow rather than python
– but so far we're unable to get those methods to find SDL.
We're also trying to figure out how to make regex recognize the addition of a new compiled build, as well as the hash of the corresponding build, at the same time.
That would make us able to create a manifest for the emulator.
The Python script is not intended for users to build the emulator, it’s just something I hacked together to run on a spare home PC as a build bot because SourceForge didn’t have infrastructure to do this and GitHub Actions’ documentation makes my eyes bleed.
The Python script invokes make via MSYS2’s bash. And this assumes that SDL2 is already installed by the user. The build system does not attempt to install any of the required dependencies. That has to be done manually before running make.
Sent from my iPhone
On Sep 12, 2022, at 12:43 AM, RavenMacDaddy @.***> wrote:
@BlackPowerade and I are having a discussion over at the Scoop Games repository.
Scoop is a Command-Line Installer – more commonly known as a package manager.
We're trying to figure out how to improve the compiling of the emulator, particularly by using mingw or make rather than python – but so far we're unable to get those methods to find SDL in the process.
We're also trying to figure out how to make regex recognize both the addition of a new compiled, and the hash of the corresponding build – but being able to do the compilation described above would supersede that.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
Good, that gives us a more informed starting point - cheers.
I already have the supporting libraries installed with mingw, including SDL. It even starts compiling.
The problem I am running into is getting GCC to include SDL. No matter what I set for
SDL_INCLUDE_DIR
and SDL_LIB_DIR
in https://github.com/trzy/Supermodel/blob/master/Makefiles/Makefile.Win32#L52,L53
It fails to find SDL.h
.
It throws this error everytime:
Yet I know gcc can find the includes, it looks in them earlier:
SDL's include folder is properly populated:
And SDL files are present under libs:
It's possible to have supermodel be automatically built, I just need to figure out what the makefile wants. In the meantime, I'll see if I can get linux and MacOS builds going.
Where exactly on your hard drive is SDL and what are you setting SDL_INCLUDE_DIR and SDL_LIB_DIR to?
Sent from my iPhone
On Sep 12, 2022, at 3:40 PM, BlackPowerade @.***> wrote:
I already have the supporting libraries installed with mingw, including SDL. It even starts compiling. The problem I am running into is getting GCC to include SDL. No matter what I set for SDL_INCLUDE_DIR and SDL_LIB_DIR in https://github.com/trzy/Supermodel/blob/master/Makefiles/Makefile.Win32#L52,L53 It fails to find SDL.h. It throws this error everytime:
Yet I know gcc can find the includes, it looks in them earlier:
SDL's include folder is properly populated:
And SDL files are present under libs:
It's possible to have supermodel be automatically built, I just need to figure out what the makefile wants.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
D:\msys64\mingw64\include\SDL2
D:\msys64\mingw64\lib
That looks correct. What if you try stripping d: out and make sure you build somewhere on your d: drive.
Also, can make in verbose mode so we can see exactly what compilation command is being passed? It looks to me like you’re doing things correctly.
Sent from my iPhone
On Sep 12, 2022, at 4:28 PM, BlackPowerade @.***> wrote:
D:\msys64\mingw64\include\SDL2 D:\msys64\mingw64\lib
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
Found the issue. For some reason
https://github.com/trzy/Supermodel/blob/master/Makefiles/Makefile.Win32#L96 $(addprefix -I,$(sort $(PLATFORM_INCLUDE_DIR)))
Wasn't adding the paths to the compiler. I have them hard coded (for now) and now it has an issue with linking, but I think I can fix it. Will update later.
Running into issue with unicode and minGW's lack of some kind of support.
This https://stackoverflow.com/questions/58324230/undefined-reference-to-winmain-c-mingw says you only need to add -municode
to the compiler options, but in doing so it now produces different errors about converting char* to LPCWSTR:
I'll keep going at it.
FWIW, I tried this a while ago and also found the GitHub VM file paths way too funky. There, but not there??? Edit. Just need to change makefiles if using brew install. No big deal after all.
More news.
It took me some time before I finally remembered paths were case sensitive on *nix, but when I did Supermodel pretty much built without any problems. It throws some errors about format overflows, but still compiles and links. I'll take that as a win.
MacOS is a different story, without -Wno-error=implicit-function-declaration
it fails in m68kcpu and m86kopnz.
With it, it fails in linking; complaining about not finding SDL, but that doesn't really make sense when it was able to find SDL.h...
Also thanks @ToBul, I've never used C, I would have never figured out the header stuff.
It throws some errors about format overflows
I had another go at this. What looks like overflow errors is when you build with netboard but forget to amend SDL net #includes. Once you do that it builds Win and Ubuntu cleanly and you can leave the Warning settings alone. Hopefully this will go some way to helping OSX build too. ??
Hey @ToBul, give yourself some credit.
I only know a bit about making manifests and barely see any logic in programming – that's why I wanted to put the right people in contact. :)
Edit. Just need to change makefiles if using brew install. No big deal after all.
It depends how you set the include directory. On Mac it’s SDL2/SDL.h because that’s how the framework directory bundles it. On Windows and Linux you can specify whether to include the SDL2 subfolder or not.
As for the character set errors, this is very strange. The default options should just work. I haven’t updated my version of gcc and MSYS2 for over a year, though. Is MSYS2 being used here?
Sent from my iPhone
On Sep 13, 2022, at 8:59 AM, ToBul @.***> wrote:
FWIW, I tried this a while ago and also found the GitHub VM file paths way too funky. There, but not there??? I did eventually get it to build a windows exe and upload an 'Artifact' though. I ended up making the sdl.h #includes compiler dependent so the paths would be correct. I think it's only MSVC that has 'SDL.h', while MSYS2, Linux and Mac have 'SDL2/SDL.h'. I might be wrong. The source would still build locally on Windows in gcc and MSVC. It also built in an Ubuntu VirtualBox with gcc. Wouldn't know about Mac.
Here's a fresh fork, @.***
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
Yes, MSYS2 is being used. We can get supermodel to build on windows and linux in actions.
I've given up on getting MacOS builds for now though. I don't have a Mac to test it on, and I can't really replicate actions environment with docker.