With optimization completely turned off I finally managed to build ATS1. I
had to first build GMP because OS X doesn’t have it by default.
I had to manually copy the libatsdoc and utils directories to $ATSHOME/libbecause it seemed ATS2 needed them and they were not automatically
installed by ATS1’s Makefile.
Building ATS2 was smooth but when it got to the point to generate patsoptfrom object files, the linker complained about undefined symbols:
Undefined symbols for architecture x86_64:
“_ATS_2d0_2e2_2e11_2libc_2SATS_2gmp_2esats__staload”, referenced from:
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_intinf_2esats__staload
in pats_intinf_sats.o
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_intinf_2edats__staload
in pats_intinf_dats.o
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_intinf_2edats__dynload
in pats_intinf_dats.o
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_lintprgm_myint_intinf_2edats__staload
in pats_lintprgm_myint_intinf_dats.o
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_lintprgm_myint_intinf_2edats__dynload
in pats_lintprgm_myint_intinf_dats.o
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_constraint3_solve_2edats__staload
in pats_constraint3_solve_dats.o
“_atslib_mpz_out_str_exn”, referenced from:
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_intinf_2esats__fprint_intinf
in pats_intinf_dats.o
__2Users_2minglei_2Downloads_2ATS_2dPostiats_2src_2pats_intinf_2esats__fprint_intinfset
in pats_intinf_dats.o
ld: symbol(s) not found for architecture x86_64
These two symbols look to be GMP related. Is it because somehow GMP support
was not included in my ATS1’s libraries?On Monday, December 9, 2013 5:53:38 PM UTC-6, gmhwxi wrote:
Forgot to mention that I had already uploaded an ATS1 package
containing the fixes.
On Monday, December 9, 2013 6:51:04 PM UTC-5, gmhwxi wrote:
I have fixed the memset issue in gcats1.cats.
I think that the problem of atsopt not functioning properly was caused by
a faulty GC.
If you drop -O2 (or change it to -O1) when using gcc to compile the GC of
ATS, then the
problem may disappear.
On Monday, December 9, 2013 12:12:11 AM UTC-5, Ming Lei wrote:
I’m trying to build ATS2 on OS X (Maverick, Darwin 13) from the latest
source on GitHub. So far I’ve seen two problems:
First, I need to build ATS1 (anairiats) to bootstrap ATS2, but ATS1 uses
pthread_spin_lock(), which is not available on OS X. Is there a way to
build ATS1 without multithread support, just for the purpose
of bootstrapping ATS2? (Or better, when can we drop the ATS1 requirement
and bootstrap ATS2 with itself?)
Second, in both ATS1 and ATS2’s prelude/CATS/char.cats file, there are
definitions like:
#ifndef isascii
extern int isascii (int c) ; // _XOPEN_SOURCE
#endif // end of [isascii]
It’s the same thing for isblank() and toascii(). These functions are
inline functions in OS X’s ctype.h, but because they are declared as
extern functions here, they are not inline anymore and are included in the
objects files. As char.cats is included verbatim in many source files,
I get duplicate symbols when the linker tries to link their object files
together. If I delete these extern declarations the linking will succeed.
What’s the purpose of these conditionals? I think all the supported
platforms should have these C functions provided. Can we remove them?
Thanks in advance!