Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi, i could not compile ats2 on my arch linux #31

Open
Abhinavpatel00 opened this issue Oct 24, 2024 · 7 comments
Open

hi, i could not compile ats2 on my arch linux #31

Abhinavpatel00 opened this issue Oct 24, 2024 · 7 comments

Comments

@Abhinavpatel00
Copy link

prelude/ats_main_prelude_dats.c:72:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2basics_2edats__dynload’ [-Wimplicit-function-declaratio]
72 | ATS_2d0_2e2_2e12_2prelude_2DATS_2basics_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:73:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2bool_2edats__dynload’ [-Wimplicit-function-declaration]
73 | ATS_2d0_2e2_2e12_2prelude_2DATS_2bool_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:74:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2char_2edats__dynload’ [-Wimplicit-function-declaration]
74 | ATS_2d0_2e2_2e12_2prelude_2DATS_2char_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:75:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2float_2edats__dynload’ [-Wimplicit-function-declaration]
75 | ATS_2d0_2e2_2e12_2prelude_2DATS_2float_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -I. -I./ccomp/runtime -c -o prelude_DATS_reference_dats.o prelude/DATS_reference_dats.c
prelude/ats_main_prelude_dats.c:76:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2integer_2edats__dynload’ [-Wimplicit-function-declaration]
76 | ATS_2d0_2e2_2e12_2prelude_2DATS_2integer_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:77:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2sizetype_2edats__dynload’ [-Wimplicit-function-declaration]
77 | ATS_2d0_2e2_2e12_2prelude_2DATS_2sizetype_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:78:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2pointer_2edats__dynload’ [-Wimplicit-function-declaration]
78 | ATS_2d0_2e2_2e12_2prelude_2DATS_2pointer_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:79:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2reference_2edats__dynload’ [-Wimplicit-function-declaration]
79 | ATS_2d0_2e2_2e12_2prelude_2DATS_2reference_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -I. -I./ccomp/runtime -c -o prelude_DATS_string_dats.o prelude/DATS_string_dats.c
prelude/ats_main_prelude_dats.c:80:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2string_2edats__dynload’ [-Wimplicit-function-declaratio]
80 | ATS_2d0_2e2_2e12_2prelude_2DATS_2string_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -I. -I./ccomp/runtime -c -o prelude_DATS_lazy_dats.o prelude/DATS_lazy_dats.c
prelude/ats_main_prelude_dats.c:81:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2lazy_2edats__dynload’ [-Wimplicit-function-declaration]
81 | ATS_2d0_2e2_2e12_2prelude_2DATS_2lazy_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:82:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2lazy_vt_2edats__dynload’ [-Wimplicit-function-declaration]
82 | ATS_2d0_2e2_2e12_2prelude_2DATS_2lazy_vt_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:83:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2printf_2edats__dynload’ [-Wimplicit-function-declaratio]
83 | ATS_2d0_2e2_2e12_2prelude_2DATS_2printf_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:84:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2filebas_2edats__dynload’ [-Wimplicit-function-declaration]
84 | ATS_2d0_2e2_2e12_2prelude_2DATS_2filebas_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:85:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats__dynload’ [-Wimplicit-function-declaration]
85 | ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:86:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats__dynload’ [-Wimplicit-function-declaration]
86 | ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:87:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2list0_2edats__dynload’ [-Wimplicit-function-declaration]
87 | ATS_2d0_2e2_2e12_2prelude_2DATS_2list0_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -I. -I./ccomp/runtime -c -o prelude_DATS_lazy_vt_dats.o prelude/DATS_lazy_vt_dats.c
prelude/ats_main_prelude_dats.c:88:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2option_2edats__dynload’ [-Wimplicit-function-declaratio]
88 | ATS_2d0_2e2_2e12_2prelude_2DATS_2option_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:89:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2option_vt_2edats__dynload’ [-Wimplicit-function-declaration]
89 | ATS_2d0_2e2_2e12_2prelude_2DATS_2option_vt_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:90:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2option0_2edats__dynload’ [-Wimplicit-function-declaration]
90 | ATS_2d0_2e2_2e12_2prelude_2DATS_2option0_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:91:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats__dynload’ [-Wimplicit-function-declaration]
91 | ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -I. -I./ccomp/runtime -c -o prelude_DATS_printf_dats.o prelude/DATS_printf_dats.c
prelude/ats_main_prelude_dats.c:92:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2array0_2edats__dynload’ [-Wimplicit-function-declaratio]
92 | ATS_2d0_2e2_2e12_2prelude_2DATS_2array0_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:93:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2matrix_2edats__dynload’ [-Wimplicit-function-declaratio]
93 | ATS_2d0_2e2_2e12_2prelude_2DATS_2matrix_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:94:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2matrix0_2edats__dynload’ [-Wimplicit-function-declaration]
94 | ATS_2d0_2e2_2e12_2prelude_2DATS_2matrix0_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prelude/ats_main_prelude_dats.c:95:1: error: implicit declaration of function ‘ATS_2d0_2e2_2e12_2prelude_2DATS_2ptrarr_2edats__dynload’ [-Wimplicit-function-declaratio]
95 | ATS_2d0_2e2_2e12_2prelude_2DATS_2ptrarr_2edats__dynload () ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:391: prelude_ats_main_prelude_dats.o] Error 1
make[1]: *** Waiting for unfinished jobs....

@githwxi
Copy link
Owner

githwxi commented Oct 24, 2024

You just need to disable -Wimplicit-function-declaration flag.

@Abhinavpatel00
Copy link
Author

thank you for reply

i got this instead

./configure && make  CFLAGS=-Wno-implicit-function-declaration
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking whether ln -s works... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking size of void*... 8
checking for posix_memalign... yes
checking for memalign... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating bin/patscc_env.sh
config.status: creating bin/myatscc_env.sh
config.status: creating bin/patsopt_env.sh
config.status: creating config.h
config.status: config.h is unchanged
\
make -j4 -C src/CBOOT patsopt \
CCOMP=gcc GCFLAG= LDFLAGS= 
make[1]: Entering directory '/home/lka/programming/compiler/ATS2-Postiats-int-0.4.2/src/CBOOT'
gcc -Wno-implicit-function-declaration -c -o prelude_ats_main_prelude_dats.o prelude/ats_main_prelude_dats.c
prelude/ats_main_prelude_dats.c:10:10: fatal error: ats_config.h: No such file or directory
   10 | #include "ats_config.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:391: prelude_ats_main_prelude_dats.o] Error 1
make[1]: Leaving directory '/home/lka/programming/compiler/ATS2-Postiats-int-0.4.2/src/CBOOT'
make: *** [Makefile:79: src2_patsopt] Error 2

@githwxi
Copy link
Owner

githwxi commented Oct 25, 2024

I don't see the include path in your gcc command-line.
Maybe the following modification can fix the issue:

make CFLAGS=-Wno-implicit-function-declaration -I. -I./ccomp/runtime

@Abhinavpatel00
Copy link
Author

Abhinavpatel00 commented Oct 26, 2024

i got this ,

 make CFLAGS=-Wno-implicit-function-declaration -I. -I./ccomp/runtime
\
make -j4 -C src/CBOOT patsopt \
CCOMP=gcc GCFLAG= LDFLAGS= 
make[1]: Entering directory '/home/user/programming/compiler/ATS2-Postiats-int-0.4.2/src/CBOOT'
gcc -Wno-implicit-function-declaration -c -o prelude_ats_main_prelude_dats.o prelude/ats_main_prelude_dats.c
prelude/ats_main_prelude_dats.c:10:10: fatal error: ats_config.h: No such file or directory
   10 | #include "ats_config.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:391: prelude_ats_main_prelude_dats.o] Error 1
make[1]: Leaving directory '/home/user/programming/compiler/ATS2-Postiats-int-0.4.2/src/CBOOT'
make: *** [Makefile:79: src2_patsopt] Error 2

@githwxi
Copy link
Owner

githwxi commented Oct 26, 2024

make CFLAGS=-Wno-implicit-function-declaration -I. -I./ccomp/runtime

Should be

make CFLAGS="-Wno-implicit-function-declaration -I. -I./ccomp/runtime"

@githwxi
Copy link
Owner

githwxi commented Oct 26, 2024

By the way, you can also use the nix package for ATS2 (without the need for compiling ATS2 yourself):

Here is some information copied from the Piazza page for a class of mine:

Nix package for ATS2

nix-shell -p ats2 --run "patscc -o lambda0 -DATS_MEMALLOC_LIBC lambda0.dats"

I recently learned the existence of a nix package for ATS2, which allows you to use a nix-shell to run patscc (as is shown in the above command-line).

For more on this, you can take a look at the following Makefile in the class repo:

https://github.com/hwxi/CS525-2024-Fall/blob/main/lambdas/lambda0/Makefile

@Abhinavpatel00
Copy link
Author

Abhinavpatel00 commented Oct 28, 2024

make CFLAGS=-Wno-implicit-function-declaration -I. -I./ccomp/runtime

Should be

make CFLAGS="-Wno-implicit-function-declaration -I. -I./ccomp/runtime"

thank you so much professor it worked

extern fun f (): void

implement
main0 () = f ()

implement
 f (): void = let
  val () = print("i wish we could attend classes from you, your language is interesting \n")
in
  f ()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants