GDCC: An Alternative ACS Compiler [0.15.0]

Any utility that assists in the creation of mods, assets, etc, go here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Sun May 08, 2016 7:27 am

To put it simply, locals in the ACS front have the same problem as globals. It needs to be in an array to access array members. In this case, unfortunately, you would need to copy it into one like:
Code: Select allExpand view
function FPlayerHUD _H_CreateRainDroplet(FPlayerHUD playerHUD_, int type, int x, int y)
{
   FPlayerHUD playerHUD[1] = {playerHUD};
   // etc
   return playerHUD[0];
}

Simply declaring the parameter as an array would cause it to be have a pointer type as in C.

The more technical explanation, for anyone curious, is that the compiler sees the address of playerHUD being used dynamically and changes it to be stored on the automatic storage stack. But the calling convention for ACS functions does not have a stack pointer, which makes the resulting IR code impossible to translate to ZDACS bytecode. The exact error occurring when it tries to determine which register index holds the stack pointer. To which I should probably improve the error message to something other than just the name of the function.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Sun May 08, 2016 7:46 am

Okay got it, thanks!
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby Matt » Sat May 21, 2016 8:40 pm

I'm getting this, anyone have any idea what's going on?
Code: Select allExpand view
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o
In file included from /home/[user]/doom/GDCC-master/src/Core/Number.cpp:13:0:
/home/[user]/doom/GDCC-master/inc/Core/Number.hpp:17:19: fatal error: gmpxx.h: No such file or directory
 #include <gmpxx.h>
                   ^
compilation terminated.
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Option.cpp.o
src/Core/CMakeFiles/gdcc-core-lib.dir/build.make:169: recipe for target 'src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o' failed
make[2]: *** [src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:898: recipe for target 'src/Core/CMakeFiles/gdcc-core-lib.dir/all' failed
make[1]: *** [src/Core/CMakeFiles/gdcc-core-lib.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: GDCC: An Alternative ACS Compiler

Postby Marrub » Sat May 21, 2016 8:46 pm

Vaecrius wrote:I'm getting this, anyone have any idea what's going on?
Code: Select allExpand view
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o
In file included from /home/[user]/doom/GDCC-master/src/Core/Number.cpp:13:0:
/home/[user]/doom/GDCC-master/inc/Core/Number.hpp:17:19: fatal error: gmpxx.h: No such file or directory
 #include <gmpxx.h>
                   ^
compilation terminated.
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Option.cpp.o
src/Core/CMakeFiles/gdcc-core-lib.dir/build.make:169: recipe for target 'src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o' failed
make[2]: *** [src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:898: recipe for target 'src/Core/CMakeFiles/gdcc-core-lib.dir/all' failed
make[1]: *** [src/Core/CMakeFiles/gdcc-core-lib.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

Do you not have libgmp?
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion
Github ID: marrub--
Operating System: Other Linux 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: GDCC: An Alternative ACS Compiler

Postby Matt » Sat May 21, 2016 8:48 pm

I did not! Thanks! (and I think I might be learning how to read these things...)

And now I've got a new problem: It can't find zcommon.acs no matter what I do.

Is there a manual or something?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Sun May 22, 2016 7:42 am

Please... option for error on forward declared function... this time it's not even about my custom build scripts anymore. I was putting something together in SLADE and I wasted almost half an hour wondering why do my scripts not even work, turns out I accidentally forward declared a function. SLADE happily compiles this and doesn't display any errors.

Please.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Sun May 22, 2016 8:51 am

Vaecrius wrote:And now I've got a new problem: It can't find zcommon.acs no matter what I do.
Under non-Windows systems, the default library path is /usr/share/gdcc/lib. You can override it using the --lib-path option.

Vaecrius wrote:Is there a manual or something?
No, but a usage overview document would probably be a good idea. I would appreciate input people who have the perspective of learning to use GDCC, actually.

Nash wrote:Please... option for error on forward declared function... this time it's not even about my custom build scripts anymore. I was putting something together in SLADE and I wasted almost half an hour wondering why do my scripts not even work, turns out I accidentally forward declared a function. SLADE happily compiles this and doesn't display any errors.
I have made it an error if a forward declared function is not defined at the time of codegen, although this may have undesired consequences for other projects. Ideally, SLADE would have the ability to display compiler warnings, but I suspect this would conflict with how acc always prints stuff.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Sun May 22, 2016 9:30 am

DavidPH wrote:I have made it an error if a forward declared function is not defined at the time of codegen, although this may have undesired consequences for other projects. Ideally, SLADE would have the ability to display compiler warnings, but I suspect this would conflict with how acc always prints stuff.


Thank you thank you thank you thank you... although you didn't have to change it... I did say "option"... so a command line parameter, so that other projects won't break with this change...
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby Matt » Sun May 22, 2016 5:22 pm

Under non-Windows systems, the default library path is /usr/share/gdcc/lib. You can override it using the --lib-path option.
Okay, just tried
Code: Select allExpand view
gdcc-acc _zip/acs/hdacs.acs _zip/acs/hdacs.o --lib-path ~/doom/acc/
and I still get the same error even though it is most definitely in that folder. (I also copied the gdcc-acc binary into that folder and am attempting to run that - is that the problem?)

DavidPH wrote:
Vaecrius wrote:Is there a manual or something?
No, but a usage overview document would probably be a good idea. I would appreciate input people who have the perspective of learning to use GDCC, actually.

So far, I've had some snags on...

- what dependencies are required
- how to compile (I just extrapolated from how to compile (G)ZDoom)
- where the executables are once you've compiled them
- what to do with those things
- how it looks for ACS libraries and how to customize that
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Mon May 23, 2016 3:33 pm

The directory that you point --lib-path at has to contain the lib/inc directory from the repository (or, of course, a copy of it). For example, if you have gdcc checked out at ~/src/gdcc, then you would use --lib-path ~/src/gdcc/lib.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Matt » Mon May 23, 2016 7:17 pm

I'm trying this
Code: Select allExpand view
gdcc-acc _zip/acs/hdacs.acs _zip/acs/hdacs.o --lib-path ~/doom/GDCC-master/lib/
and it doesn't work.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Tue May 24, 2016 8:17 pm

Assuming something hasn't gone catastrophically wrong and ~/doom/GDCC-master/lib/inc/ACS/zcommon.acs exists, does --sys-include ~/doom/GDCC-master/lib/inc/ACS make it able to find zcommon.acs?
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Matt » Wed May 25, 2016 1:01 am

DavidPH wrote:Assuming something hasn't gone catastrophically wrong and ~/doom/GDCC-master/lib/inc/ACS/zcommon.acs exists, does --sys-include ~/doom/GDCC-master/lib/inc/ACS make it able to find zcommon.acs?
Still no luck, but that folder most definitely has a zcommon.acs.

EDIT: Sorry, my bad! It was a problem with my bash shortcut!

I am now getting this error, however:
Code: Select allExpand view
ERROR: _zip/acs/hdacs.acs:5:19: non-constant initializer for static storage object
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: GDCC: An Alternative ACS Compiler

Postby Marrub » Wed May 25, 2016 1:05 am

Stupid question: Have you tried reordering the argument to before the source name? I don't know why this would work, but try it: gdcc-acc --lib-path ~/doom/GDCC-master/lib/ _zip/acs/hdacs.acs _zip/acs/hdacs.o
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion
Github ID: marrub--
Operating System: Other Linux 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: GDCC: An Alternative ACS Compiler

Postby Matt » Wed May 25, 2016 1:39 am

Same "non-constant initializer for static storage object" error... my prior problem was actually that I was running gdcc from a script that only contained room for 2 parameters so the path was being ignored.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

PreviousNext

Return to Editors / Asset Manipulation

Who is online

Users browsing this forum: No registered users and 0 guests