eldesh / mlyacc-polyml

MLYacc for Poly/ML
Other
1 stars 0 forks source link

Fails to build from source #3

Open ryanakca opened 2 years ago

ryanakca commented 2 years ago

The file Readme.md claims that mlyacc is not required to build mlyacc-polyml from source. Unfortunately, this does not seem to be the case for a fresh checkout. The problem is that mlyacc is needed to generate src/yacc.grm.sig and src/yacc.grm.sml, and these files are not included in the repository (they are explicitly excluded by .gitignore).

❯ make -n MLLEX=/tmp/mllex-polyml/bin/mllex-polyml
echo "  [MLYacc] src/yacc.grm.sig"
src/yacc.grm
chmod -w src/yacc.grm.*
echo "  [POLYML] mlyacc-polyml.o"
echo "" | poly -q --error-exit --use /tmp/mlyacc-polyml/script/load.sml \
        --eval 'PolyML.loadModule "./lib/mlyacc-lib-1.0.0.poly"' \
        --eval 'load "src/load.sml"' \
        --eval 'PolyML.export ("mlyacc-polyml.o", Main.main)'
echo "  [POLYMLC] bin/mlyacc-polyml"
polyc -o bin/mlyacc-polyml mlyacc-polyml.o
make -C doc PDFLATEX:=pdflatex mlyacc.pdf
make[1]: Entering directory '/tmp/mlyacc-polyml/doc'
pdflatex mlyacc.tex
pdflatex mlyacc.tex
pdflatex mlyacc.tex
make[1]: Leaving directory '/tmp/mlyacc-polyml/doc'
cp doc/mlyacc.pdf doc/mlyacc-polyml.pdf
❯ make MLLEX=/tmp/mllex-polyml/bin/mllex-polyml
  [MLYacc] src/yacc.grm.sig
make: src/yacc.grm: Permission denied
make: *** [Makefile.mlyacc:10: src/yacc.grm.sig] Error 127

Installing mlyacc from mlton-tools and passing make MLYACC=mlyacc fixes this issue. Subsequent builds then succeed without mlyacc installed. Please consider including src/yacc.grm.* in the repository.

spamegg1 commented 1 year ago

I had similar issues. Needed to do sudo apt install ml-lex ml-yacc and then sudo make MLLEX=ml-lex MLYACC=ml-yacc to proceed. In addition to the 2 files you mentioned, I also needed yacc.lex.sml which was missing.

Here are the 3 files: yacc.zip

Here are the mllex-polyml and mlyacc-polyml binaries: mllex-mlyacc.zip