#1 Make fails in Ubuntu 16.04

Closed
opened 6 years ago by certik · 3 comments
certik commented 6 years ago

I use Ubuntu 16.04, I installed gforth (apt install gforth) and typed make in this project:

$ make 
  IMG      lexer
/usr/bin/gforthmi: 47: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found
/usr/bin/gforthmi: 48: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found
redefined th  
*OS command line*:-1: No such file or directory
comp-image >>>./temp-image.fi1<<< ./temp-image.fi2 lexer bye
Backtrace:
$7FF627E198B0 throw 
$7FF627E4F208 slurp-file chmod: cannot access 'lexer': No such file or directory
rm: cannot remove './temp-image.fi1': No such file or directory
rm: cannot remove './temp-image.fi2': No such file or directory
...

The error comes from this line:

$ gforthmi lexer lexer.fs
/usr/bin/gforthmi: 47: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found
/usr/bin/gforthmi: 48: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found
redefined th  
*OS command line*:-1: No such file or directory
comp-image >>>./temp-image.fi1<<< ./temp-image.fi2 lexer bye
Backtrace:
$7FB57C6F28B0 throw 
$7FB57C728208 slurp-file 
chmod: cannot access 'lexer': No such file or directory
rm: cannot remove './temp-image.fi1': No such file or directory
rm: cannot remove './temp-image.fi2': No such file or directory

It looks like the gforthmi executable in Ubuntu 16.04 is broken. Is there a workaround to run this using just gforth?

I tried the following:

$ gforth lexer.fs parser.fs interpreter.fs generator.fs vm.fs < tests/input/print.in 
redefined skip with SKIP  redefined u. with U.  redefined expect with EXPECT  redefined ?EOF  redefined digit? with DIGIT?  redefined name with NAME  redefined BUF  redefined PEEK  redefined GETC  redefined SPACE?  redefined DIGIT?  redefined STRING with String  redefined INTEGER with Integer  redefined TOKEN  redefined "TYPE"  redefined .string with .STRING  140256185842272 140256185842328 140256185842384 140256185842440 140256185842496 140256185843072 140256185843136 140256185843192 140256185843248 140256185843312 140256185843376 140256185843432 140256185843496 140256185843560 140256185843616 140256185843680 140256185843744 140256185843808 140256185843872 140256185843936 140256185844000 140256185844056 redefined EXPECT  redefined parse with PARSE  redefined BUF  redefined PEEK  redefined GETC  redefined SPACE?  redefined >SPACE  redefined DIGIT?  redefined GETINT  redefined GETNAM  redefined GETSTR  redefined .  redefined CONS  redefined lookup with LOOKUP  redefined >string with >String  redefined handler with HANDLER  redefined $IDENTIFIER with $Identifier  redefined $INTEGER with $Integer  redefined $STRING with $String  redefined $PRTC with $Prtc  redefined $PRTI with $Prti  redefined $PRTS with $Prts  redefined $NOT with $Not  redefined $NEGATE with $Negate  redefined $SEQUENCE with $Sequence  redefined $ASSIGN with $Assign  redefined $WHILE with $While  redefined $IF with $If  redefined $SUBTRACT with $Subtract  redefined $ADD with $Add  redefined $MOD with $Mod  redefined $MULTIPLY with $Multiply  redefined $DIVIDE with $Divide  redefined $LESS with $Less  redefined $LESSEQUAL with $LessEqual  redefined $GREATER with $Greater  redefined $GREATEREQUAL with $GreaterEqual  redefined $EQUAL with $Equal  redefined $NOTEQUAL with $NotEqual  redefined $AND with $And  redefined $OR with $Or  redefined BUF  redefined PEEK  redefined GETC  redefined SPACE?  redefined >SPACE  redefined DIGIT?  redefined >Integer  redefined SKIP  redefined word with WORD  redefined INTERN  redefined "TYPE"  redefined .  redefined BUF'  redefined PREPEND  redefined NODE  redefined CONS  redefined LOOKUP  redefined GLOBALS  redefined depth with DEPTH  redefined >Identifier  redefined >String  redefined >;  redefined HANDLER  redefined READER  redefined GETAST  redefined READ  redefined (GETAST)  redefined Jz with jz  redefined mod  redefined EQ with eq  redefined and  redefined or  redefined BINARY  redefined .strings with .STRINGS  redefined ,"  
in file included from *OS command line*:-1
generator.fs:119: Invalid memory address
>>>,"<<< fetch store push  jmp   jz    prtc  prti  prts  "
Backtrace:
$7F8FF0227170 execute 
$7F8FF02294E0 GETTOK 
$7F8FF022DDE8 PARSE 

But it gave an error.

Any ideas? I would like to get something that works on my machine, so that I can start playing with it.

I use Ubuntu 16.04, I installed gforth (`apt install gforth`) and typed `make` in this project: ``` $ make IMG lexer /usr/bin/gforthmi: 47: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found /usr/bin/gforthmi: 48: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found redefined th *OS command line*:-1: No such file or directory comp-image >>>./temp-image.fi1<<< ./temp-image.fi2 lexer bye Backtrace: $7FF627E198B0 throw $7FF627E4F208 slurp-file chmod: cannot access 'lexer': No such file or directory rm: cannot remove './temp-image.fi1': No such file or directory rm: cannot remove './temp-image.fi2': No such file or directory ... ``` The error comes from this line: ``` $ gforthmi lexer lexer.fs /usr/bin/gforthmi: 47: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found /usr/bin/gforthmi: 48: /usr/bin/gforthmi: /usr/lib/gforth/0.7.2/gforth-ditc: not found redefined th *OS command line*:-1: No such file or directory comp-image >>>./temp-image.fi1<<< ./temp-image.fi2 lexer bye Backtrace: $7FB57C6F28B0 throw $7FB57C728208 slurp-file chmod: cannot access 'lexer': No such file or directory rm: cannot remove './temp-image.fi1': No such file or directory rm: cannot remove './temp-image.fi2': No such file or directory ``` It looks like the `gforthmi` executable in Ubuntu 16.04 is broken. Is there a workaround to run this using just `gforth`? I tried the following: ``` $ gforth lexer.fs parser.fs interpreter.fs generator.fs vm.fs < tests/input/print.in redefined skip with SKIP redefined u. with U. redefined expect with EXPECT redefined ?EOF redefined digit? with DIGIT? redefined name with NAME redefined BUF redefined PEEK redefined GETC redefined SPACE? redefined DIGIT? redefined STRING with String redefined INTEGER with Integer redefined TOKEN redefined "TYPE" redefined .string with .STRING 140256185842272 140256185842328 140256185842384 140256185842440 140256185842496 140256185843072 140256185843136 140256185843192 140256185843248 140256185843312 140256185843376 140256185843432 140256185843496 140256185843560 140256185843616 140256185843680 140256185843744 140256185843808 140256185843872 140256185843936 140256185844000 140256185844056 redefined EXPECT redefined parse with PARSE redefined BUF redefined PEEK redefined GETC redefined SPACE? redefined >SPACE redefined DIGIT? redefined GETINT redefined GETNAM redefined GETSTR redefined . redefined CONS redefined lookup with LOOKUP redefined >string with >String redefined handler with HANDLER redefined $IDENTIFIER with $Identifier redefined $INTEGER with $Integer redefined $STRING with $String redefined $PRTC with $Prtc redefined $PRTI with $Prti redefined $PRTS with $Prts redefined $NOT with $Not redefined $NEGATE with $Negate redefined $SEQUENCE with $Sequence redefined $ASSIGN with $Assign redefined $WHILE with $While redefined $IF with $If redefined $SUBTRACT with $Subtract redefined $ADD with $Add redefined $MOD with $Mod redefined $MULTIPLY with $Multiply redefined $DIVIDE with $Divide redefined $LESS with $Less redefined $LESSEQUAL with $LessEqual redefined $GREATER with $Greater redefined $GREATEREQUAL with $GreaterEqual redefined $EQUAL with $Equal redefined $NOTEQUAL with $NotEqual redefined $AND with $And redefined $OR with $Or redefined BUF redefined PEEK redefined GETC redefined SPACE? redefined >SPACE redefined DIGIT? redefined >Integer redefined SKIP redefined word with WORD redefined INTERN redefined "TYPE" redefined . redefined BUF' redefined PREPEND redefined NODE redefined CONS redefined LOOKUP redefined GLOBALS redefined depth with DEPTH redefined >Identifier redefined >String redefined >; redefined HANDLER redefined READER redefined GETAST redefined READ redefined (GETAST) redefined Jz with jz redefined mod redefined EQ with eq redefined and redefined or redefined BINARY redefined .strings with .STRINGS redefined ," in file included from *OS command line*:-1 generator.fs:119: Invalid memory address >>>,"<<< fetch store push jmp jz prtc prti prts " Backtrace: $7F8FF0227170 execute $7F8FF02294E0 GETTOK $7F8FF022DDE8 PARSE ``` But it gave an error. Any ideas? I would like to get something that works on my machine, so that I can start playing with it.
bavier commented 6 years ago
Owner

I was able to recreate the missing-gforth-ditc-error on debian. It appears gforth-ditc is installed into "/usr/lib/$MACHINE/gforth/$version/gforth-ditc" on debian-based systems. If you can find it, you can fix this on your system by setting and exporting the "GFORTHD" environment variable to point to it. Then run make again.

As an alternative, you can use e.g. gforth lexer.fs -e COLD to simulate the shrink-wrapped image-based application. You'll need to separately invoke each stage of the pipeline, e.g.:

./lexer <tests/input/gcd.in | ./parser | ./interpreter

or

gforth lexer.fs -e COLD <tests/input/gcd.in \
  | gforth parser.fs -e COLD \
  | gforth interpreter.fs -e COLD

Note with the latter approach you'll see a bunch of messages mixed in the output from gforth about redefined words. Those are harmless, but I don't know of any way to disable them.

I was able to recreate the missing-gforth-ditc-error on debian. It appears gforth-ditc is installed into "/usr/lib/$MACHINE/gforth/$version/gforth-ditc" on debian-based systems. If you can find it, you can fix this on your system by setting and exporting the "GFORTHD" environment variable to point to it. Then run `make` again. As an alternative, you can use e.g. `gforth lexer.fs -e COLD` to simulate the shrink-wrapped image-based application. You'll need to separately invoke each stage of the pipeline, e.g.: ``` ./lexer <tests/input/gcd.in | ./parser | ./interpreter ``` or ``` gforth lexer.fs -e COLD <tests/input/gcd.in \ | gforth parser.fs -e COLD \ | gforth interpreter.fs -e COLD ``` Note with the latter approach you'll see a bunch of messages mixed in the output from gforth about redefined words. Those are harmless, but I don't know of any way to disable them.
certik commented 6 years ago
Poster

Thanks! I think I got it working on Ubuntu 16.04 as follows:

$ export GFORTHD=/usr/lib/x86_64-linux-gnu/gforth/0.7.2/gforth-ditc 
$ make
  IMG      lexer
redefined skip with SKIP  redefined u. with U.  redefined expect with EXPECT  redefined ?EOF  redefined digit? with DIGIT?  redefined name with NAME  redefined skip with SKIP  redefined u. with U.  redefined expect with EXPECT  redefined ?EOF  redefined digit? with DIGIT?  redefined name with NAME  redefined th  
  IMG      parser
redefined digit? with DIGIT?  redefined .string with .STRING  redefined expect with EXPECT  redefined parse with PARSE  redefined digit? with DIGIT?  redefined .string with .STRING  redefined expect with EXPECT  redefined parse with PARSE  redefined th  
  IMG      interpreter
redefined digit? with DIGIT?  redefined .  redefined lookup with LOOKUP  redefined >string with >String  redefined handler with HANDLER  redefined digit? with DIGIT?  redefined .  redefined lookup with LOOKUP  redefined >string with >String  redefined handler with HANDLER  redefined th  
  IMG      generator
redefined digit? with DIGIT?  redefined skip with SKIP  redefined word with WORD  redefined .  redefined lookup with LOOKUP  redefined depth with DEPTH  redefined >string with >String  redefined handler with HANDLER  redefined Jz with jz  redefined mod  redefined and  redefined or  redefined .strings with .STRINGS  redefined ,"  redefined emit with EMIT  redefined digit? with DIGIT?  redefined skip with SKIP  redefined word with WORD  redefined .  redefined lookup with LOOKUP  redefined depth with DEPTH  redefined >string with >String  redefined handler with HANDLER  redefined Jz with jz  redefined mod  redefined and  redefined or  redefined .strings with .STRINGS  redefined ,"  redefined emit with EMIT  redefined th  
  IMG      vm
redefined digit? with DIGIT?  redefined word with WORD  redefined >string with >STRING  redefined .  redefined Jz with jz  redefined mod  redefined and  redefined or  redefined interpret with INTERPRET  redefined digit? with DIGIT?  redefined word with WORD  redefined >string with >STRING  redefined .  redefined Jz with jz  redefined mod  redefined and  redefined or  redefined interpret with INTERPRET  redefined th  

Tests run except one:

$ make check
               tests/lexer/test-lexer.sh : -e PASS
             tests/parser/test-parser.sh : -e PASS
   tests/interpreter/test-interpreter.sh : -e PASS
       tests/generator/test-generator.sh : -e PASS
                     tests/vm/test-vm.sh : -e FAIL
Thanks! I think I got it working on Ubuntu 16.04 as follows: ``` $ export GFORTHD=/usr/lib/x86_64-linux-gnu/gforth/0.7.2/gforth-ditc $ make IMG lexer redefined skip with SKIP redefined u. with U. redefined expect with EXPECT redefined ?EOF redefined digit? with DIGIT? redefined name with NAME redefined skip with SKIP redefined u. with U. redefined expect with EXPECT redefined ?EOF redefined digit? with DIGIT? redefined name with NAME redefined th IMG parser redefined digit? with DIGIT? redefined .string with .STRING redefined expect with EXPECT redefined parse with PARSE redefined digit? with DIGIT? redefined .string with .STRING redefined expect with EXPECT redefined parse with PARSE redefined th IMG interpreter redefined digit? with DIGIT? redefined . redefined lookup with LOOKUP redefined >string with >String redefined handler with HANDLER redefined digit? with DIGIT? redefined . redefined lookup with LOOKUP redefined >string with >String redefined handler with HANDLER redefined th IMG generator redefined digit? with DIGIT? redefined skip with SKIP redefined word with WORD redefined . redefined lookup with LOOKUP redefined depth with DEPTH redefined >string with >String redefined handler with HANDLER redefined Jz with jz redefined mod redefined and redefined or redefined .strings with .STRINGS redefined ," redefined emit with EMIT redefined digit? with DIGIT? redefined skip with SKIP redefined word with WORD redefined . redefined lookup with LOOKUP redefined depth with DEPTH redefined >string with >String redefined handler with HANDLER redefined Jz with jz redefined mod redefined and redefined or redefined .strings with .STRINGS redefined ," redefined emit with EMIT redefined th IMG vm redefined digit? with DIGIT? redefined word with WORD redefined >string with >STRING redefined . redefined Jz with jz redefined mod redefined and redefined or redefined interpret with INTERPRET redefined digit? with DIGIT? redefined word with WORD redefined >string with >STRING redefined . redefined Jz with jz redefined mod redefined and redefined or redefined interpret with INTERPRET redefined th ``` Tests run except one: ``` $ make check tests/lexer/test-lexer.sh : -e PASS tests/parser/test-parser.sh : -e PASS tests/interpreter/test-interpreter.sh : -e PASS tests/generator/test-generator.sh : -e PASS tests/vm/test-vm.sh : -e FAIL ```
bavier commented 6 years ago
Owner

I fixed the vm tests in commit 026d3c32b2. The vm previously only worked in 32-bit gforths.

I fixed the vm tests in commit 026d3c32b2317a39c5f58df4e1fc1f6bb3710465. The vm previously only worked in 32-bit gforths.
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.