As I recall, the nested functions issue was also the main reason ACE wouldn’t compile on Windows. The use of the executable stack for nested functions is a known security vulnerability, so I’m doubtful that macOS will enable it in the future, but maybe GCC can emulate it somehow via another mechanism.
In the long term, removing the use of nested functions in ACE would be a good thing, but unfortunately I think it’d be more work than anyone wants to put in right now.
Thanks @sweaglesw for that special ACE binary. It’s mostly OK on my new M1 MacBook Pro, except that compiling ERG 2018 hangs when including the ubertagger. Commenting out all the ut/ lines in ace/config.tdl allows the compilation to complete, and the resulting grammar image seems to work fine.
The special binary also works on my (x86_64) iMac - so would it make sense just to move the freezer to 0x7000000000 on macOS?
Thanks Eric and John for the feedback that it is working as expected for you. It sounds like it’s not for TJ? I’m going to order myself an M2 MBP for the purpose of being able to do this work on my own machine (previous work was on a borrowed M1 laptop). For all I know the GCC folks have resolved the nested functions problem by now, but I also took the step of purging the nested functions from the code last year, so either way I expect it should be much more straightforward to produce a new binary these days – at least from the SVN trunk.
The additional purpose was to figure out ACE on ARM.
In my most recent reply, I was thinking in terms of (1) but I think everyone else was thinking in terms of (2), so that’s my bad. I’ve sorted things out and here’s my re-reply
@sweaglesw Regarding purpose (2), I was able to use the provided ARM binary with no trouble to 1. compile the ERG, 2. parse a sample sentence, 3. generate from the top MRS for that sentence.
Regarding purpose (1), I realize now that my quoted info was naïve in that I didn’t update anything in the formula since the ARM updates. I’ve since tried using SVN trunk and gotten ACE to compile, but I’m getting the same error when compiling a grammar.
Thanks for clarifying, TJ. And thanks also for working on teaching homebrew how to compile ACE – that’s awesome. I got ACE to compile on an M2 machine yesterday, using the Apple-supplied clang compiler. It was mostly straightforward, but there were a couple of speedbumps.
(Installing developer tools, then homebrew, then brew install boost, then brew install svn… all worked without any hitch)
Compiling REPP revealed that although I had purged nested functions from the ACE code I hadn’t yet done that from REPP. I will have to make a new REPP library release. I assume you are using GCC and therefore this isn’t a problem in your brew recipe.
I had to change the freezer location in freeze.h. As far as I know the new location will make all OSes happy (at least I am going to assume that until I find evidence to the contrary), so I committed that change to SVN tonight. I believe that should resolve the problem you are currently seeing.
Compiled grammar files are not portable between Intel Macs and M1/2 Macs. There is a way around this involving cross compiling and making “fat” binaries, and I have it working, but it will need a little more nuance to be included in the SVN tree (i.e. it would break other platforms at the moment).
Great! I can try again with brew soon. By the way, if you want to play around with the homebrew installation, you can do brew install delph-in/delphin/ace --HEAD --debug. The debug flag falls into some options on an exception, including accessing the shell. There’s a similar flag that hits the options at the end of compilation on failure or success.
Regarding portable grammar files, my opinion is that this isn’t necessary. I understand that may not be a universally held opinion.
@sweaglesw I have moved beyond the freezer error, so that’s good. Unfortunately now after running brew install delph-in/delphin/ace --HEAD && ace -g ~/Code/erg/ace/config.tdl -G ~/Code/erg.dat I get a segfault very shortly after
$ ace -g erg/ace/config.tdl -G erg.dat
reading configuration from `erg/ace/config.tdl'
reading types from `erg/ace/../mtr.tdl'
grammar version ERG (trunk)
loaded grammar in 7.80826s
types: 101.3M rules: 20.6M lex-info: 3.4M
zsh: segmentation fault ace -g erg/ace/config.tdl -G erg.dat