• pForth Compilation on Linux

    From Aimee Hesterman@21:1/5 to All on Wed Nov 9 10:51:35 2022
    Hi,

    I just downloaded pForth v28 from Phil Burke's GitHub site and it compiled just fine using the UNIX makefile on Ubuntu. By default it somehow knew I was on a 64-bit machine so created a 64-bit version of pForth with a cell size of 8. I would like a
    cell size of 4 bytes, however, like on all the other Forths I have used.

    It appears that there is a variable called 'cell_t' in the source which indicates the size of everything but cannot find any way to set that to 4. I'm not a C-programmer (or much of a programmer at all, really) so don't understand these things.

    Does anyone know how to set this up so that I can get a cell size of 4 bytes or compile an i386 version of pForth on a 64-bit machine? Thanks for your help.

    Nathan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aimee Hesterman@21:1/5 to minf...@arcor.de on Wed Nov 9 12:08:27 2022
    On Wednesday, November 9, 2022 at 12:19:45 PM UTC-7, minf...@arcor.de wrote:
    aimeehe...@gmail.com schrieb am Mittwoch, 9. November 2022 um 19:51:37 UTC+1:
    Hi,

    I just downloaded pForth v28 from Phil Burke's GitHub site and it compiled just fine using the UNIX makefile on Ubuntu. By default it somehow knew I was on a 64-bit machine so created a 64-bit version of pForth with a cell size of 8. I would like a
    cell size of 4 bytes, however, like on all the other Forths I have used.

    It appears that there is a variable called 'cell_t' in the source which indicates the size of everything but cannot find any way to set that to 4. I'm not a C-programmer (or much of a programmer at all, really) so don't understand these things.

    Does anyone know how to set this up so that I can get a cell size of 4 bytes or compile an i386 version of pForth on a 64-bit machine? Thanks for your help.

    Modern Linuxes are all 64-bit today, so it might not be easy to compile a 32-bit pforth version.
    Pointers will occupy 64 bits anyhow. But I don't know pforth really.

    My suggestion: install a small 32-bit Linux in a virtual machine (eg Virtualbox) and compile
    pforth from there. Or even simpler: do it in a USB drive e.g. with https://antixlinux.com/

    Thanks! That's a great idea. I'll give it a shot.

    Nathan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to aimeehe...@gmail.com on Wed Nov 9 11:19:43 2022
    aimeehe...@gmail.com schrieb am Mittwoch, 9. November 2022 um 19:51:37 UTC+1:
    Hi,

    I just downloaded pForth v28 from Phil Burke's GitHub site and it compiled just fine using the UNIX makefile on Ubuntu. By default it somehow knew I was on a 64-bit machine so created a 64-bit version of pForth with a cell size of 8. I would like a
    cell size of 4 bytes, however, like on all the other Forths I have used.

    It appears that there is a variable called 'cell_t' in the source which indicates the size of everything but cannot find any way to set that to 4. I'm not a C-programmer (or much of a programmer at all, really) so don't understand these things.

    Does anyone know how to set this up so that I can get a cell size of 4 bytes or compile an i386 version of pForth on a 64-bit machine? Thanks for your help.


    Modern Linuxes are all 64-bit today, so it might not be easy to compile a 32-bit pforth version.
    Pointers will occupy 64 bits anyhow. But I don't know pforth really.

    My suggestion: install a small 32-bit Linux in a virtual machine (eg Virtualbox) and compile
    pforth from there. Or even simpler: do it in a USB drive e.g. with https://antixlinux.com/



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to aimeehesterman@gmail.com on Wed Nov 9 21:52:21 2022
    In article <391345f7-3438-4cbb-b562-a1f6a8379680n@googlegroups.com>,
    Aimee Hesterman <aimeehesterman@gmail.com> wrote:
    Hi,

    I just downloaded pForth v28 from Phil Burke's GitHub site and it compiled just fine using the
    UNIX makefile on Ubuntu. By default it somehow knew I was on a 64-bit machine so created a
    64-bit version of pForth with a cell size of 8. I would like a cell size of 4 bytes, however,
    like on all the other Forths I have used.

    It appears that there is a variable called 'cell_t' in the source which indicates the size of
    everything but cannot find any way to set that to 4. I'm not a C-programmer (or much of a
    programmer at all, really) so don't understand these things.

    Does anyone know how to set this up so that I can get a cell size of 4 bytes or compile an i386
    version of pForth on a 64-bit machine? Thanks for your help.

    (I have "some" experience in c.)
    I succeeded building a 32 bit version on Ubuntu by modifying these lines
    in the Makefile (adding -m32)

    CCOPTS = $(WIDTHOPT) -m32 -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS)
    LDFLAGS = $(XLDFLAGS) -m32

    Result:

    ~/PROJECT/pforth/pforth/build/unix$ ls
    Makefile pf_fileio_stdio.eo pf_io_none.o pf_save.eo pfcompil.o pf_cglue.eo pf_fileio_stdio.o pf_io_posix.eo pf_save.o pfcustom.eo pf_cglue.o pf_inner.eo pf_io_posix.o pf_text.eo pfcustom.o pf_clib.eo pf_inner.o pf_main.eo pf_text.o pfdicdat.h pf_clib.o pf_io.eo pf_main.o pf_words.eo pforth
    pf_core.eo pf_io.o pf_mem.eo pf_words.o pforth.dic pf_core.o pf_io_none.eo pf_mem.o pfcompil.eo pforth_standalone ~/PROJECT/pforth/pforth/build/unix$ pforth
    PForth V27-LE/32, built Nov 9 2022 21:28:48
    pForth loading dictionary from file pforth.dic
    File format version is 9
    Name space size = 120000
    Code space size = 300000
    Entry Point = 0
    Cell Size = 4
    Little Endian Dictionary

    1 2 + . 3 ok
    1 CELLS . 4 ok
    Stack<10>


    Nathan

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aimee Hesterman@21:1/5 to none albert on Thu Nov 10 10:35:11 2022
    On Wednesday, November 9, 2022 at 1:52:25 PM UTC-7, none albert wrote:
    In article <391345f7-3438-4cbb...@googlegroups.com>,
    Aimee Hesterman <aimeehe...@gmail.com> wrote:
    Hi,

    I just downloaded pForth v28 from Phil Burke's GitHub site and it compiled just fine using the
    UNIX makefile on Ubuntu. By default it somehow knew I was on a 64-bit machine so created a
    64-bit version of pForth with a cell size of 8. I would like a cell size of 4 bytes, however,
    like on all the other Forths I have used.

    It appears that there is a variable called 'cell_t' in the source which indicates the size of
    everything but cannot find any way to set that to 4. I'm not a C-programmer (or much of a
    programmer at all, really) so don't understand these things.

    Does anyone know how to set this up so that I can get a cell size of 4 bytes or compile an i386
    version of pForth on a 64-bit machine? Thanks for your help.
    (I have "some" experience in c.)
    I succeeded building a 32 bit version on Ubuntu by modifying these lines
    in the Makefile (adding -m32)

    CCOPTS = $(WIDTHOPT) -m32 -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS)
    LDFLAGS = $(XLDFLAGS) -m32

    Result:

    ~/PROJECT/pforth/pforth/build/unix$ ls
    Makefile pf_fileio_stdio.eo pf_io_none.o pf_save.eo pfcompil.o
    pf_cglue.eo pf_fileio_stdio.o pf_io_posix.eo pf_save.o pfcustom.eo
    pf_cglue.o pf_inner.eo pf_io_posix.o pf_text.eo pfcustom.o
    pf_clib.eo pf_inner.o pf_main.eo pf_text.o pfdicdat.h
    pf_clib.o pf_io.eo pf_main.o pf_words.eo pforth
    pf_core.eo pf_io.o pf_mem.eo pf_words.o pforth.dic
    pf_core.o pf_io_none.eo pf_mem.o pfcompil.eo pforth_standalone ~/PROJECT/pforth/pforth/build/unix$ pforth
    PForth V27-LE/32, built Nov 9 2022 21:28:48
    pForth loading dictionary from file pforth.dic
    File format version is 9
    Name space size = 120000
    Code space size = 300000
    Entry Point = 0
    Cell Size = 4
    Little Endian Dictionary

    1 2 + . 3 ok
    1 CELLS . 4 ok
    Stack<10>


    Nathan

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    Thank you Albert!

    I am in the process of downloading a 32-bit version of Linux Mint to compile pForth in VirtualBox. I will try your solution first, however, before I make a new virtual machine. Looks like a winner.

    Nathan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aimee Hesterman@21:1/5 to Aimee Hesterman on Thu Nov 10 13:10:50 2022
    On Thursday, November 10, 2022 at 11:35:13 AM UTC-7, Aimee Hesterman wrote:
    On Wednesday, November 9, 2022 at 1:52:25 PM UTC-7, none albert wrote:
    In article <391345f7-3438-4cbb...@googlegroups.com>,
    Aimee Hesterman <aimeehe...@gmail.com> wrote:
    Hi,

    I just downloaded pForth v28 from Phil Burke's GitHub site and it compiled just fine using the
    UNIX makefile on Ubuntu. By default it somehow knew I was on a 64-bit machine so created a
    64-bit version of pForth with a cell size of 8. I would like a cell size of 4 bytes, however,
    like on all the other Forths I have used.

    It appears that there is a variable called 'cell_t' in the source which indicates the size of
    everything but cannot find any way to set that to 4. I'm not a C-programmer (or much of a
    programmer at all, really) so don't understand these things.

    Does anyone know how to set this up so that I can get a cell size of 4 bytes or compile an i386
    version of pForth on a 64-bit machine? Thanks for your help.
    (I have "some" experience in c.)
    I succeeded building a 32 bit version on Ubuntu by modifying these lines in the Makefile (adding -m32)

    CCOPTS = $(WIDTHOPT) -m32 -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS)
    LDFLAGS = $(XLDFLAGS) -m32

    Result:

    ~/PROJECT/pforth/pforth/build/unix$ ls
    Makefile pf_fileio_stdio.eo pf_io_none.o pf_save.eo pfcompil.o
    pf_cglue.eo pf_fileio_stdio.o pf_io_posix.eo pf_save.o pfcustom.eo pf_cglue.o pf_inner.eo pf_io_posix.o pf_text.eo pfcustom.o
    pf_clib.eo pf_inner.o pf_main.eo pf_text.o pfdicdat.h
    pf_clib.o pf_io.eo pf_main.o pf_words.eo pforth
    pf_core.eo pf_io.o pf_mem.eo pf_words.o pforth.dic
    pf_core.o pf_io_none.eo pf_mem.o pfcompil.eo pforth_standalone ~/PROJECT/pforth/pforth/build/unix$ pforth
    PForth V27-LE/32, built Nov 9 2022 21:28:48
    pForth loading dictionary from file pforth.dic
    File format version is 9
    Name space size = 120000
    Code space size = 300000
    Entry Point = 0
    Cell Size = 4
    Little Endian Dictionary

    1 2 + . 3 ok
    1 CELLS . 4 ok
    Stack<10>


    Nathan

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
    Thank you Albert!

    I am in the process of downloading a 32-bit version of Linux Mint to compile pForth in VirtualBox. I will try your solution first, however, before I make a new virtual machine. Looks like a winner.

    Nathan

    Hi Albert,

    I copied the lines you changed and added them to the makefile, commenting out those two existing lines, and get the following:

    nhesterm@SAM:~/pforth-master-2022-11-09/platforms/unix$ make
    c99 -m32 -x c -O2 --std=c89 -fsigned-char -fno-builtin -fno-unroll-loops -fno-keep-inline-functions -pedantic -Wcast-qual -Wall -Wwrite-strings -Winline -Wmissing-prototypes -Wmissing-declarations -g -I. -DPF_SUPPORT_FP -D_DEFAULT_SOURCE -
    D_GNU_SOURCE -c -o pf_cglue.o ../../csrc/pf_cglue.c
    In file included from ../../csrc/pf_inc1.h:26,
    from ../../csrc/pf_all.h:48,
    from ../../csrc/pf_cglue.c:22:
    /usr/include/string.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory
    26 | #include <bits/libc-header-start.h>
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:79: pf_cglue.o] Error 1

    I don't know why it would work on your Ubuntu install but not on mine. I'm using a new install of Ubuntu 22.04 LTS.

    Nathan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aimee Hesterman@21:1/5 to Paul Rubin on Thu Nov 10 13:57:48 2022
    On Thursday, November 10, 2022 at 2:15:50 PM UTC-7, Paul Rubin wrote:
    Aimee Hesterman <aimeehe...@gmail.com> writes:
    ... bits/libc-header-start.h: No such file or directory
    I don't know why it would work on your Ubuntu install but not on mine.
    Try "apt-get install gcc-multilib", You can usually find this type of
    info by pasting the error message into a search engine.

    Sorry. Thank you all. That did the trick!

    Nathan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Aimee Hesterman on Thu Nov 10 13:15:47 2022
    Aimee Hesterman <aimeehesterman@gmail.com> writes:
    ... bits/libc-header-start.h: No such file or directory
    I don't know why it would work on your Ubuntu install but not on mine.

    Try "apt-get install gcc-multilib", You can usually find this type of
    info by pasting the error message into a search engine.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to aimeehesterman@gmail.com on Thu Nov 10 23:36:31 2022
    In article <ac4c535e-b0dd-48fd-8d27-89c81b978817n@googlegroups.com>,
    Aimee Hesterman <aimeehesterman@gmail.com> wrote:
    <SNIP>

    Hi Albert,

    I copied the lines you changed and added them to the makefile, commenting out those two
    existing lines, and get the following:

    nhesterm@SAM:~/pforth-master-2022-11-09/platforms/unix$ make
    c99 -m32 -x c -O2 --std=c89 -fsigned-char -fno-builtin -fno-unroll-loops >-fno-keep-inline-functions -pedantic -Wcast-qual -Wall -Wwrite-strings -Winline
    -Wmissing-prototypes -Wmissing-declarations -g -I. -DPF_SUPPORT_FP -D_DEFAULT_SOURCE
    -D_GNU_SOURCE -c -o pf_cglue.o ../../csrc/pf_cglue.c
    In file included from ../../csrc/pf_inc1.h:26,
    from ../../csrc/pf_all.h:48,
    from ../../csrc/pf_cglue.c:22:
    /usr/include/string.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory
    26 | #include <bits/libc-header-start.h>
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:79: pf_cglue.o] Error 1

    I don't know why it would work on your Ubuntu install but not on mine. I'm using a new install
    of Ubuntu 22.04 LTS.

    I have an ubuntu too:
    Linux cherry 5.4.0-126-generic #142-Ubuntu SMP Fri Aug 26 12:12:57 UTC 2022 x86_64 x86_64 x86_
    64 GNU/Linux

    Note that you include string.h that should be legal, and then there is
    a complaint that has nothing to do with pforth.

    You can compile an hello world program, and insert string.h

    -------------
    #include <stdio.h>
    #include <string.h>

    int main(char **argv , int argc )
    {
    printf("Hello world\n");
    }
    ------------
    gcc -m32 hellow.c -o hellow
    and
    gcc hellow.c -o hellow
    As this fails, there is something wrong with the installation of gcc.

    Otherwise there is some weird interaction that can hardly be diagnosed
    from afar.

    And gcc is complicated. The man page runs 22.000 lines, mostly not relevant.


    Nathan
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)