Compiling timer.dats example

31 views
Skip to first unread message

spearman

unread,
Mar 2, 2017, 8:16:49 PM3/2/17
to ats-lang-users
What is the command to compile the `timer.dats` example from the Introduction to ATS book?

https://github.com/ats-lang/ats-lang.github.io/blob/master/DOCUMENT/INT2PROGINATS/CODE/CHAP_ABSVTYPE/timer.dats

The command I have tried (ATS/Postiats 0.3.2):

$ patscc timer.dats -o timer -lrt

results in the two errors:

timer_dats.c:1165:11: error: storage size of tmpref24 isnt known
 
ATStmpdec(tmpref24, atslib_libats_libc_timespec_type) ;
           
^

and:

In file included from timer_dats.c:15:0:
timer_dats
.c:1190:65: error: CLOCK_REALTIME undeclared (first use in this function)
 
ATSINSmove(tmp25, atslib_libats_libc_clock_gettime(ATSPMVextval(CLOCK_REALTIME), ATSPMVrefarg1(ATSPMVptrof(tmpref24)))) ;
                                                                 
^

Hongwei Xi

unread,
Mar 2, 2017, 8:25:22 PM3/2/17
to ats-lan...@googlegroups.com

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@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/454956d3-0c48-4811-bb93-4b4a2af1fbad%40googlegroups.com.

Hongwei Xi

unread,
Mar 2, 2017, 8:26:31 PM3/2/17
to ats-lan...@googlegroups.com
Basically, you need

-D_GNU_SOURCE -DATS_MEMALLOC_LIBC


On Thu, Mar 2, 2017 at 8:25 PM, Hongwei Xi <gmh...@gmail.com> wrote:
On Thu, Mar 2, 2017 at 8:16 PM, spearman <pearm...@gmail.com> wrote:
What is the command to compile the `timer.dats` example from the Introduction to ATS book?

https://github.com/ats-lang/ats-lang.github.io/blob/master/DOCUMENT/INT2PROGINATS/CODE/CHAP_ABSVTYPE/timer.dats

The command I have tried (ATS/Postiats 0.3.2):

$ patscc timer.dats -o timer -lrt

results in the two errors:

timer_dats.c:1165:11: error: storage size of tmpref24 isnt known
 
ATStmpdec(tmpref24, atslib_libats_libc_timespec_type) ;
           
^

and:

In file included from timer_dats.c:15:0:
timer_dats
.c:1190:65: error: CLOCK_REALTIME undeclared (first use in this function)
 
ATSINSmove(tmp25, atslib_libats_libc_clock_gettime(ATSPMVextval(CLOCK_REALTIME), ATSPMVrefarg1(ATSPMVptrof(tmpref24)))) ;
                                                                 
^

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.

August Alm

unread,
Mar 2, 2017, 8:32:38 PM3/2/17
to ats-lang-users
This works for me:
$ patscc -O2 -D_GNU_SOURCE -DATS_MEMALLOC_LIBC -latslib -lrt -o timer timer.dats
Reply all
Reply to author
Forward
0 new messages