-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you post the CMake file for glktermw? #1
Comments
I'm using http://www.eblong.com/zarf/glk/glktermw-104.tar.gz, but it does appear that zarf's widechar branch of glkterm is the same thing. I'll add some CMake files for the various Glk implementations that zarf provides. |
OK, I've pushed changes which include CMakeLists.txt files for cheapglk, glkterm, glktermw, remglk, and xglk. |
Thank you! Working good. Some of the version information from Gargoyle isn't actually correct, for example this line says Git is 1.3.3 when actually it's 1.3.5: https://github.com/cspiegel/terps/blob/master/CMakeLists.txt#L169 I'm pretty terrible with Makefiles - and I'd like to also get nanoglk into the fold. Source: https://github.com/BroadcastGames/nanoglk My first stab at a CMakeList.txt isn't working yet, but posting here in case you have time to take a stab at it ;)
|
I just added a CMakeLists.txt for nanoglk. A little setup needs to be done, which is documented in that file. |
Thanks a lot Chris, this is great! nanoglk execution crashed for me on first run as it seems to also depend on TrueType font dejavu being installed. On Ubuntu I had to install package ttf-dejavu - we could add a comment to the Makefile or another find_package dependency (although technically it's runtime and not compile). My hope is it gets some more attention and someone can properly update nanoglk to SDL 2.0. Have a great week. |
Chris, feel free to ignore me on this, as it's kind of a laundry list of terp issues ;) If someone out there has time, can they build this with glkterm and try out advsys terp? from build directory, try the story data file The Key to Time: $ ./advsys key.dat On my Ubuntu 17.04 x64 desktop, this fails with "bad data file", and sometimes Gargoyle itself was giving me this error, but I can't figure out the circumstances. I closed an issue on it as I thought it was my mistake: garglk/garglk#282 |
Advsys as modified for Gargoyle was calling I added a quick hack to advsys to open the file in the startup code. |
Thanks for the AdvSys fix. In Gargoyle it almost seems like a race condition, as sometimes it works and sometimes it fails. But now it's solid. Your series of CMake files is much better than the mess I was creating. I've had good success adapting it to the Android NDK cross-compiler to produce executable binaries for all the CPU variations. A key trick so far was to modify the terp function:
This got Android Studio compiling everything except WITH_BOCFEL and WITH_FROTZ - I need to track down some compile errors with those two. I'll have more time to track those down later today. Thank you again! |
There is a bit of weirdness in Gargoyle interpreters in that the directory is changed before the interpreters have a chance to open game files. I'm not sure of the motivation for this behavior—it was added explicitly for OS X and then for all platforms, meaning there was probably a reason for it. I've wanted to change it, but without knowing why it's there, I'm a bit wary... but the upshot is that if you use a relative path to a game file it may not work. e.g.:
results in “bad story file”, but:
results in the game working as intended. It's possible you were bitten by this bug (I have to think it's a bug; I'll take some time to see if I can figure out whether removing the
Feel free to paste the errors here. I wrote Bocfel so I would probably be able to have some insight into what's going on there; and if it's an issue in Bocfel I'd like to fix it upstream. And we can always patch our Frotz code as well, if it's a bug there. |
I posted over on Fizmo an invite to get it into this project. It already has all the code to interface with Glk in it's RemGlk branch. It's been actively developed this year, and I think it has a a healthy SDL2 layer that could be the inspiration for a general-purpose SDL2GLK / nanoglk upgrade. chrender/fizmo#23 |
re: @cspiegel "Feel free to paste the errors here." Here is what I've changed to run in Android Studio 2.3.3 integrated CMake system: WakeRealityDev@4437c5e Both WITH_BOCFEL and WITH_FROTZ cause the compile/link to fail, all the others seem to run through all the CPU architectures. Here is WITH_BOCFEL and no Frotz:
|
I know that last post log isn't much, so here is a full log of the compile/build. Note that stderror is appended at the end: https://gist.github.com/WakeRealityDev/d3efcbc1cd335636f8b49e689bd72929 |
I've never used the Android NDK before so I may be doing something wrong, but I tried something like this on the terpsTemp repository:
I was able to get Frotz to fail to build, but Bocfel built just fine for me. Glulxe didn't build, and a cursory glance looks like remglk claims to support On the Bocfel side, for some reason an object file is being produced for you that is not valid. Just for reference, can you run As for Frotz, its Glk implementation looks to be done by simply redefining many of the functions/types in |
re : "As for Frotz, its Glk implementation looks to be done by simply redefining many of the functions/types in stdio.h, which fails spectacularly with the Android C library. This probably isn't easily fixable: all the calls to standard I/O functions would have to manually be replaced with the equivalent Glk calls. This would mean even more divergence from upstream than already exists, since upstream does not support Glk." Android NDK has a ton of options on the stdio, so if that's the issue, I can tweak those. it offers static vs. dynamic, gnu vs. others, etc - here is the relvant doc page: https://developer.android.com/ndk/guides/cpp-support.html The question is - should I change this at the root project level or should we change it only for Frotz? Where should I insert CMake lines and which lines? |
re: "can you run file on the blorb.c.o file, and then also on one of the other object files created for Bocfel? "
I'm honestly not that worried about this issue on the short term. As I think I can build two working Z interpreters for Android using the legacy gcc cross-compiler system that Android NDK used to offer https://github.com/WakeRealityDev/IFTerpCrossCompileAndroid . I'm really happy to have a well-organized and desktop+Android system with CMake and clang - and solving these two terps isn't a showstopper for me - as they are both Z-Machine and we have multiple to pick from. nitfol works! |
CONFIRMED: I do have a working Android.mk (legacy NDK build system / Makefile system) that can cross-compile Bocfel on Android. I DO NOTICE SOMETHING! I spent hours on that and found out that "include 'limits.h'" on the LOCAL_CFLAGS solved problems that other Gargoyle terps did not require.
Can we add some similar include to CMake side, where and what? As for Frotz - seems I never got that far and have no notes of getting it working on Android - and since I had both nitfol and bocfel working on all the CPU variations - I moved forward without frotz. |
Fresh look this morning, I discovered a clue: If I tell the NDK to cross-compile only one time, only x86 CPU, it works for WITH_BOCFEL. - is the CMake setting some var that the 2nd cycle through is causing problems? EDIT: it seems like only one CPU, picking 'armeabi-v7a' exclusive, also fails. Still trying to figure it out. |
I'm unable to reproduce the issue; what's the exact cmake invocation you're using? If unconditionally including |
While I'm thinking about it: can you make tads terp like the others, as a WITH_TADS option? |
I think I identified the problem. https://github.com/cspiegel/terps/blob/master/cmake/Modules/Compilers.cmake#L31 target_compile_options(${target} PUBLIC -flto) I comment that out, WITH_BOCFEL compiles fine for arm CPU. However, there is still some weirdness - I am making sure to completely delete my build directories each run, as it isn't behaving consistent. If I purge my build directory, and do only Bocfel, I can compile: 'arm64-v8a', 'x86' in one run (two cross-compile runs). |
Great, thank you for tracking that down. The failure with LTO in Bocfel is due to a Clang bug (see https://bugs.llvm.org/show_bug.cgi?id=32155 and android/ndk#350, for example). The problem is that the linker doesn't understand the
|
Chris: Thank you for all the labor of validating issues. Above and beyond your own personal projects. One tiny -OB arg in makin' C coding for 7 different CPU variations and billions of varied devices can result in months of discouraging results that have erratic failures like Bocfel showed. It's really supportive to have collaborative effort into the time-travel C code of decades past into the modern code editor. It's an adventure to the adventure. |
Are you working with this branch? https://github.com/erkyrath/glkterm/tree/widechar - Thank you.
The text was updated successfully, but these errors were encountered: