Cogmind > Support

How to build Cogmind open source libraries

(1/2) > >>

Luigi:
What
Recently I have come upon modern understanding (as of this post) of how to satisfy the Lesser GNU Public License clause of Cogmind's associated SDL 1.2.14 binary that was built against an old toolchain many years ago. You should be able to generally apply this to other SDL helper libraries if necessary.
Why
This post is intended for archival in the distant future when historians seeking to plug Cogmind into their latest hyperreality gamestation's graphics layer run into problems because of how Cogmind manages its memory across heaps, at least as of Cogmind b11 X9 (a patreon pre-release build). I believe this is included in Cogmind only due to its use of REX, but I don't really get how it all works in the end.
How
Without further ado, this works on a modern Debian machine, and I was able to apply this on an M1 Macbook Air running the latest macOS and mingw-w64 toolchain. Huge thanks to user Daid of the Roguelikes Discord for putting this together! What a cute cat they have in their profile picture :D


--- Code: ---$ git clone git@github.com:libsdl-org/SDL-1.2.git
$ cd SDL-1.2/
$ git checkout release-1.2.14
$ ./autogen.sh
$ ./configure --host=i686-w64-mingw32 --disable-directx --disable-assembly --build=x86_64-w64-mingw32
$ make -j 12
$ file ./build/.libs/SDL.dll
./build/.libs/SDL.dll: PE32 executable (DLL) (console) Intel 80386, for MS Windows
$ daid@MSI:~/SDL-1.2$ i686-w64-mingw32-objdump -x ./build/.libs/SDL.dll | grep DLL
        DLL
 vma:            Hint    Time      Forward  DLL       First
        DLL Name: ADVAPI32.dll
        DLL Name: GDI32.dll
        DLL Name: KERNEL32.dll
        DLL Name: msvcrt.dll
        DLL Name: USER32.dll
        DLL Name: WINMM.DLL
        DLL Name: libgcc_s_dw2-1.dll

--- End code ---

The last command is demonstrative of the need for this assembly configuration workaround.

Further information
If you are a developer interested and aware of the implications of SDL hooking, I welcome you to join the Roguelikes discord community where I am working on a Cogmind AI/TAS. A later post in this forum somewhere appropriate will link to the sources for this project if and when it is in a state I deem interesting.

Binary Archival
Attached to this post would be a copy of SDL source code that can also be used in the event the git remote specified above goes out of service. But the forum limits me to 1MB. It's a 5MB archive. I'll see what I can do.

Kyzrati:
Hey Luigi, thanks for sharing this, very awesome work figuring it out xD

This might be easier one day once Cogmind uses a more modern architecture, but porting it over (along with all the other things dependent on my engine) would take some doing and no doubt introduce all kinds of new issues to resolve, so I'm definitely not in any kind of hurry to do it :P

(I do look forward to the resultant AI, and offering some support for it, but that's for another thread...)

To help contribute to this thread, I've collected the SDL sources for projects used by Cogmind in an archive that can be downloaded here (20 MB). Within you'll find projects for:
  SDL-1.2.14
  SDL_image-1.2.10
  SDL_mixer-1.2.11
  SDL_net-1.2.8

Luigi:
Hey Kyzrati, thanks for dropping those sources! I've noticed that SDL builds made like this have an issue after about 20 seconds of gameplay where the SDL mixer buffer throws an exception trying to free the audio resource.

Would it be possible for us to get a pointer to the sources for libvorbis-*.dll and the like? I have a feeling all the FOSS libraries need to be built with the same toolchain for SDL to be pluggable.

Kyzrati:
Yes these are available on GitHub from Xiph, though I don't think they'd need to be built alongside SDL for it to work. My guess is that issues with your mod would be coming from somewhere else, but yeah, you never know for sure with all this library stuff--a real pain in the neck xD

Luigi:
I figured it out, you just have to use mingw32 in highly specific ways listed here: https://how-to.fandom.com/wiki/How_to_setup_a_Simple_Direct_Media_Layer(SDL)_build_environment#Windows:_MinGW

Navigation

[0] Message Index

[#] Next page

Go to full version