Score:1

Expected an UID followed by a ':' make: *** [Makefile:130 : compiler] Error 255

ki flag

I was trying to build the Sather compiler, everything was going fine and I got this error with make :


Creating C for installation compiler...

Boot/sacomp     -verbose -O_fast -O_no_move_while -O_no_hoist_const -O_no_cse -only_reachable Compiler/sacomp.module -o Bin/sacomp -only_C
/usr/local/src/sather-1.2.3/System/Common/CONFIG:1:error, expected an UID followed by a ':'
make: *** [Makefile:130 : compiler] Erreur 255

This doesn't seem to be a dependency problem (and I think I installed them all). Here is the whole output if it can help (sorry my computer is in french) :

make[1] : on entre dans le répertoire « /usr/local/src/sather-1.2.3/System/Common »
make[1]: rien à faire pour « all ».
make[1] : on quitte le répertoire « /usr/local/src/sather-1.2.3/System/Common »

Making serial library: System Socket 
Containers 

Making platform BOOT...
make[1] : on entre dans le répertoire « /usr/local/src/sather-1.2.3/System/Platforms/BOOT »
make[1]: rien à faire pour « all ».
make[1] : on quitte le répertoire « /usr/local/src/sather-1.2.3/System/Platforms/BOOT »
Making platform linux...
make[1] : on entre dans le répertoire « /usr/local/src/sather-1.2.3/System/Platforms/linux »
make[1]: rien à faire pour « all ».
make[1] : on quitte le répertoire « /usr/local/src/sather-1.2.3/System/Platforms/linux »

Making boot compiler...

make -C System/Platforms/linux boot CC='gcc'
make[1] : on entre dans le répertoire « /usr/local/src/sather-1.2.3/System/Platforms/linux »
ln -sf `pwd`/header.h ../BOOT
make -C /usr/local/src/sather-1.2.3/Boot/sacomp.code CC=gcc
make[2] : on entre dans le répertoire « /usr/local/src/sather-1.2.3/Boot/sacomp.code »
make[2]: « ../sacomp » est à jour.
make[2] : on quitte le répertoire « /usr/local/src/sather-1.2.3/Boot/sacomp.code »
rm -f ../BOOT/header.h
make[1] : on quitte le répertoire « /usr/local/src/sather-1.2.3/System/Platforms/linux »

Creating C for installation compiler...

Boot/sacomp     -verbose -O_fast -O_no_move_while -O_no_hoist_const -O_no_cse -only_reachable Compiler/sacomp.module -o Bin/sacomp -only_C
/usr/local/src/sather-1.2.3/System/Common/CONFIG:1:error, expected an UID followed by a ':'
make: *** [Makefile:130 : compiler] Erreur 255

Any help, or an easier way to install Sather on Ubuntu

Score:1
hr flag

The issue seems to be that the sather System/Common/Makefile uses The C Preprocessor, cpp to preprocess CONFIG.proto into CONFIG. Since cpp does not know that the intended output is sather rather than C, it processes and inserts the standard header file /usr/include/stdc-predef.h at the start of the CONFIG file, as you can verify by doing

cpp -dI System/Common/CONFIG.proto | head

Because make variable CPP is defined in the top-level Makefile as CPP=/lib/cpp -C -P, comments in the input files are not suppressed. So the CONFIG file ends up with a big /* C-style */ comment block at the top, which apparently chokes the sather parser (which apparently expects comments to start with -).

The inclusion of the stdc-predef.h seems to have been introduced in GCC 4.8, and the recommended way to enforce backward compatibility is with the option -ffreestanding (although this option does not appear to be documented in the cpp man page):

make clean
make CPP='cpp -ffreestanding -C -P'

You should then be able to execute ./Bin/sacomp as follows

SATHER_HOME=. ./Bin/sacomp
There is no class named MAIN.

(presumably it expects to be given the name of one or more source files).

See Porting to GCC 4.8 .

Niout8 avatar
ki flag
thank you very much now make didn't show any errors. I was very happy until this happens when I run sacomp : `Couldn't open file: /usr/lib/sather/System/Common/Common.module` `Command line error near: /usr/lib/sather/System/Common/Common.module in command line` `(See man page.)` Do you have any advice?
Niout8 avatar
ki flag
Apparently there is no /usr/lib/sather at all. I guess it's because I installed it at the wrong place
Niout8 avatar
ki flag
I moved the sather folder to /usr/lib and now I get this (tried copy pasting sather to its original place) : `Couldn't open file: $(SATHER_HOME)/Library/System/Socket/Socket.module Command line error near: -external in /usr/lib/sather/System/Platforms/linux/Platform.module (See man page.)`
hr flag
Executing `SATHER_HOME=. ./Bin/sacomp` from the `sather-1.2.3` directory seems to run for me (although it expects a source file - I don't know anything about this compiler)
hr flag
... in fact, the HTML installation instructions (at Doc/Installation.html) suggest setting `SATHER_HOME` **before** running `make`. In your case, that would be `export SATHER_HOME=/usr/local/src/sather-1.2.3` based on your choice of build location
Niout8 avatar
ki flag
I really thank you for taking the time to finds answers to find the answers to my problem. Actually I set the variable earlier but when running the correct `make CPP='cpp -ffreestanding -C -P'` I totally forgot. Now I'm getting `Internal compiler error: Couldn't write thumbprints` but the problem comes from the compiler and not from the build. Thanks again and I guess I'll just try another language lol
hr flag
@Niout8 you're welcome - good luck!
Niout8 avatar
ki flag
I managed to make it work by installing it again in /usr/lib/sather instead of the previous. You made my day
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.