Compiling Oforth on Linux 64bits systems

If you have any questions, remarks, ... if you need help... its here...

Compiling Oforth on Linux 64bits systems

Postby Franck » 31 Mar 2018 09:05

Currently, Oforth is a 32bits application.
It will run on both 32bits and 64bits platforms.

If you want to compile Oforth 32bits on your Linux 64bits system, you have to check that you have some packages installed :
libc-dev-i386
g++-multilib

Then, a "make all" will do to job...

Franck
Franck
 
Posts: 170
Joined: 29 Oct 2014 19:01

Re: Compiling Oforth on Linux 64bits systems

Postby k5nwa » 24 Apr 2019 20:48

I had problems re-compiling oforth in a Linux Mint V19.1 X64 environment, it compiled after loading the 32-bit multilib libraries as mentioned by you;

sudo apt-get install gcc-multilib g++-multilib

I still have issues compiling the source under Windows 10 Pro X64 it is a different issue. I loaded the latest mingw and it appears to be confused as to the OS running, the parameter OS=Windows_NT is set so any clues by anyone would be helpful as I'm not familiar with make or GCC.

Thanks

Cecil - k5nwa
k5nwa
 
Posts: 7
Joined: 27 Mar 2019 19:50

Re: Compiling Oforth on Linux 64bits systems

Postby Franck » 24 Apr 2019 21:21

Hello,

So, on Linux, this is ok ? You managed to compile with debug mode and see the native code generated (using #see) ?

On windows, here is the command file I use to build Oforth :

@echo off
cd \home\oforth\ofsrc
set TMPDIR=C:\TMP
set LIBRARY_PATH=C:\BIN\LIB
set C_INCLUDE_PATH=C:\BIN\INCLUDE
set GDBTK_LIBRARY=C:\BIN\LIB\TK4.2
make all


Create a file (I named it m.bat) and copy those lines (you will have to modify the directories).
Run m

Tell me if it worked (and, if not, what is the error).

Franck,
Franck
 
Posts: 170
Joined: 29 Oct 2014 19:01

Re: Compiling Oforth on Linux 64bits systems

Postby k5nwa » 25 Apr 2019 01:54

Unfortunately I see nothing even close to resembling those folders in my PC, inside mingw there is a bin directory but it contains no other folders so your folders and mine are not even close, I have the latest mingw you might have something older.

Below is the error I get when using make all;

Error on line 71: expecting target : dependencies

That section of code is for Linux so it should not be executing there, below is a portion of my environment variables.

NUMBER_OF_PROCESSORS=8
OFORTH_PATH=D:/Programs/oforth
OneDrive=C:\Users\a013\OneDrive
OneDriveConsumer=C:\Users\a013\OneDrive
ORANGEC=C:\Program Files (x86)\Orange C 386
OS=Windows_NT

With the original makefile I have the same error the only change was to remove the comment on the line;

# DBGMODE=DBG

Cecil - k5nwa
k5nwa
 
Posts: 7
Joined: 27 Mar 2019 19:50

Re: Compiling Oforth on Linux 64bits systems

Postby Franck » 25 Apr 2019 09:13

imo, this is a problem of make version.

Could you give me what make version you use on windows (make --v I think, or something like that) ?

Franck
Franck
 
Posts: 170
Joined: 29 Oct 2014 19:01

Re: Compiling Oforth on Linux 64bits systems

Postby k5nwa » 25 Apr 2019 19:29

I have Digital Mars C compiler and it has it's own make, and it's the one running, dues to the PATH order so that might be the problem. Lazarus also has it's own make, but I don't see even a path to the minGW path.

Digital Mars Make Version 5.06
Copyright (C) Digital Mars 1985-2012. All Rights Reserved.
Written by Walter Bright digitalmars.com
Documentation: http://www.digitalmars.com/ctg/make.html

I added the path to minGW but now a version from Microsoft is what runs. After rearranging the paths a bit, I get the GNU Make to run and it's version 3.81d

Well it starts running and it looks similar to the Linux version but it gets an error "make: gcc: Command not Found" it looks like I will have to add a path to the gcc command. I added a new path to GCC.

It now goes further as it finds GCC but new error;

./preproc primitive.ps
./preproc: ./preproc: cannot execute binary file
make: *** [primitivs.S] Error 126

Help!

Thanks

Cecil - k5nwa
k5nwa
 
Posts: 7
Joined: 27 Mar 2019 19:50

Re: Compiling Oforth on Linux 64bits systems

Postby k5nwa » 25 Apr 2019 19:49

Addendum: Prior to the error the following was listed on the screen showing the file being compile that to the error;

gcc -c -D__OWIN32__ -D__x86__ -D__x8632__ -D__FLOAT_ENABLE__ -D__TCP_ENABLE__ -D__MTHREAD_ENABLE__ -D__DYN_ENABLE__ -D__DBG__ -I -fstrength-reduce -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions -Wall -mthreads -Wl,--dynamicbase,--export-all-symbols,--nxcompat -s -m32 -march=core2 -mtune=generic -o preproc.o preproc.c
gcc preproc.o -o preproc.exe -s -m32 -march=core2 -mtune=generic
./preproc primitivs.ps


Thanks

Cecil - k5nwa
k5nwa
 
Posts: 7
Joined: 27 Mar 2019 19:50

Re: Compiling Oforth on Linux 64bits systems

Postby Franck » 25 Apr 2019 19:54

imo, this errors means that the "preproc.exe" (or preproc) executable file is not compatible with your Windows architecture. Does it comes from Linux ?

I suggest you to erase all .o files, .exe files, a "preproc" file if it comes from Linux, and oforth file if it comes from Linux and restart the build using
make all

If it does not work and if you have objdump utility (otherwise install it), can you try :
objdump -f preproc.exe
and copy here the result ?

And also all the output (from the start) of the build when running "make all" after a clean.
Franck
 
Posts: 170
Joined: 29 Oct 2014 19:01

Re: Compiling Oforth on Linux 64bits systems

Postby k5nwa » 25 Apr 2019 23:16

The src directory was extracted from the source code on your site and is not related to my work with it in the Linux side of the PC, especially since Windows can not read the Linux partition, I just deleted the folder and extracted it from the original source on your site.dir *.exe

the prepoc.exe was created by the make process, if I delete it and I run make all it creates it but has an error when i t runs. The objdump has the following output;

preproc.exe: file format pei-i386
architecture: i386, flags 0x00000102:
EXEC_P, D_PAGED
start address 0x004012d0

After deleting everything and restoring from the original it goes past that point but then gets a strange error that the copy command can't be found, I can use the copy command just fine from that folder but that file was just created so trying to overwrite it with a plain copy command would not work since it will ask for confirmation to overwrite the file. But the error is that it can't find the copy command which is not true.

make: copy: Command not found
make: *** [primitivs.o] Error 127

Thanks

Cecil - k5nwa
k5nwa
 
Posts: 7
Joined: 27 Mar 2019 19:50

Re: Compiling Oforth on Linux 64bits systems

Postby Franck » 26 Apr 2019 10:31

Hello,

Very weird. The only things I can think of is
1) Problem with your PATH variable.
2) Problem with your shell : do you use COMMAND.COM or CMD ? I suggest cmd if you don't use it.
3) Problem with make version.

I never saw this kind of problem detected by make.

I don't understand this : "that file was just created so trying to overwrite it with a plain copy command would not work since it will ask for confirmation to overwrite the file"
Is the file tmp.def created into the directory ?
If so you can try (after deleting primitiv.S if it exists) :
copy tmp.def primitiv.S

Otherwise, did you manage to run Oforth on Windows using the precompiled version ? Is it working ?

Franck
Franck
 
Posts: 170
Joined: 29 Oct 2014 19:01

Next

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron