Issues building ATS2 in Cygwin

66 views
Skip to first unread message

Matt Chelen

unread,
Mar 12, 2019, 2:41:41 PM3/12/19
to ats-lang-users
As per the instructions on the download page, I downloaded ATS2 via the tar file and attempted to build it in Cygwin. The Makefile threw an error about a missing separator on line 1 (which is apparently not an uncommon error?) and converting it between ANSI and UTF-8 didn't solve that, so I bypassed it and attempted to build with Makefile_dist, since the Makefile was simply a reference to it.

I am currently getting this error:

make[2]: Entering directory '/home/mattc/ATS2-Postiats/utils/atscc/BUILD'
rm
-f *~
rm
-f *_?ats.o
rm
-f *_?ats.c
"/home/mattc/ATS2-Postiats"/bin/patsopt --output patscc_dats.c --dynamic patscc.dats
/home/mattc/ATS2-Postiats/share/atspre_staload.hats: 1(line=1, offs=1) -- 5(line=1, offs=5): error(parsing): the token is discarded.
exit(ATS): uncaught exception: _2home_2hwxi_2Research_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)
make
[2]: *** [../Makefile_build:38: patscc_dats.c] Error 1
make
[2]: Leaving directory '/home/mattc/ATS2-Postiats/utils/atscc/BUILD'
make
[1]: *** [Makefile:18: build] Error 2
make
[1]: Leaving directory '/home/mattc/ATS2-Postiats/utils/atscc'
make
: *** [Makefile_dist:88: utl_atscc] Error 2

I am unsure of what that means or how to solve it, as I have yet to work with ATS2 at all and documentation seems to be limited. I know that others have successfully built ATS2 in Cygwin, so I am confused as to what I am doing wrong.

Any help is appreciated. Thanks in advance!

Hongwei Xi

unread,
Mar 13, 2019, 8:50:18 AM3/13/19
to ats-lan...@googlegroups.com
Here is my *guess*:

atspre_staload.hats is currently a symbolic link. The error message seems to show that
the symbolic link was incorrectly treated as a regular file. If you remove atspre_staload.hats
and then copy HATS/atspre_staload_prelude.hats to atspre_staload.hats, you can check to see if
things will work out. You may have to do the same for atspre_staload_libats_ML.dats.



--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/76304693-f80c-466f-a853-4a8e4e8ca0d4%40googlegroups.com.

Matt Chelen

unread,
Mar 16, 2019, 2:05:28 AM3/16/19
to ats-lang-users
Thanks, that worked. Now I have a new issue.

make -C utils/myatscc copy build clean
make
[1]: Entering directory '/home/mattc/ATS2-Postiats/utils/myatscc'
\
cp
-f DATS/*.?ats BUILD/.
\
make \
-C BUILD -f ../Makefile_build
make[2]: Entering directory '/home/mattc/ATS2-Postiats/utils/myatscc/BUILD'
/home/mattc/ATS2-Postiats/bin/patsopt --output myatscc_main_dats.c --dynamic myatscc_main.dats
/home/mattc/ATS2-Postiats/utils/myatscc/BUILD/myatscc_lexer.dats: 542(line=41, offs=1) -- 602(line=43, offs=36): error(1): the file [$PATSHOMELOCS/atscntrb-hx-parcomb/mylibies.hats] is not available for inclusion.
/home/mattc/ATS2-Postiats/utils/myatscc/BUILD/myatscc_parser.dats: 274(line=21, offs=1) -- 334(line=23, offs=36): error(1): the file [$PATSHOMELOCS/atscntrb-hx-parcomb/mylibies.hats] is not available for inclusion.
patsopt(TRANS1): there are [2] errors in total.
exit(ATS): uncaught exception: _2home_2hwxi_2Research_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)
make[2]: *** [../Makefile_build:69: myatscc_main_dats.c] Error 1
make[2]: Leaving directory '/home/mattc/ATS2-Postiats/utils/myatscc/BUILD'

make[1]: *** [Makefile:18: build] Error 2
make[1]: Leaving directory '/home/mattc/ATS2-Postiats/utils/myatscc'
make: *** [Makefile_dist:95: utl_myatscc] Error 2

The file it can't find seems to be related to this variable that is set in utils/myatscc/Makefile_build.

######
#
export \
PATSHOMELOCS
=\
./node_modules:./../../node_modules
#
######

The variable is in utils/myatscc/node_modules/atscntrb-hx-parcomb, but there is no node_modules folder in the root folder, which is two levels up from that folder and it probably can't create a symbolic link (since it couldn't read one), so perhaps that's the issue?

Thanks again,

Richard

unread,
Mar 16, 2019, 2:47:38 AM3/16/19
to ats-lang-users
Maybe try commenting out  the lines (41-43) in the file BUILD/myatscc_lexer.dats

it should look like below after commenting out
// #include
// "$PATSHOMELOCS\
// /atscntrb-hx-parcomb/mylibies.hats"

and then insert the following line directly below

#include "./../node_modules/atscntrb-hx-parcomb/mylibies.hats"

gmhwxi

unread,
Mar 16, 2019, 7:49:22 AM3/16/19
to ats-lang-users
This is another issue caused by symbolic linking.

Go into the directory and remove 'node_modules'
and then copy:

cd BUILD; rm -f node_modules; cp -rf ../node_modules .

On Saturday, March 16, 2019 at 2:05:28 AM UTC-4, Matt Chelen wrote:

Matt Chelen

unread,
Apr 1, 2019, 1:34:51 AM4/1/19
to ats-lang-users
Apologies for the late reply, but I meant to mention that I downloaded a new tar file and tried building it from scratch and it just worked, so I've got it set up now.

On another note, just for the sake of doing so (in an attempt to set up an install that doesn't rely on Cygwin), I tried using the MSYS2 build script here, but it didn't work. When it starts compiling the ATS code, several variables are reported to be undefined and it errors out. Not a big deal, as I have it set up now, but I figured I'd leave a note.

Cheers!
Reply all
Reply to author
Forward
0 new messages