modula3 / cm3

Critical Mass Modula-3
http://modula3.github.io/cm3/
Other
134 stars 25 forks source link

Assembler failing #1053

Open SethMarshall opened 2 years ago

SethMarshall commented 2 years ago

I'm trying to follow the instructions at https://modula3.elegosoft.com/cm3/doc/tutorial/m3/ to compile a basic program. I have downloaded cm3-bin-core-AMD64_LINUX-5.8.6-REL.tgz onto a Debian system running in VMWare.

It appears the compiler is correctly installed and path set: cm3 --version

_Critical Mass Modula-3 version 5.8.6 last updated: 2010-04-11 compiled: 2010-07-12 20:10:34 configuration: /usr/local/cm3/bin/cm3.cfg host: AMD64_LINUX target: AMD64LINUX

Here is my source code for module "Main.m3" which is in /home/usr/Modula/

MODULE Main; VAR num: INTEGER; BEGIN num := 10; END Main.

When I enter cm3 Main.m3 here is the resulting error:

new source -> compiling Main.m3 /bin/sh: 1: as: not found assemble => 127 assembler failed assembling: Main.ms compilation failed => not building program "prog" Fatal Error: package build failed

Any ideas what the problem is?

Thanks.

P.S. Why does the compiler create the folder "AMD64_LINUX" when trying to compile?

RodneyBates commented 2 years ago

On 9/3/22 10:59, SethMarshall wrote:

I'm trying to follow the instructions at https://modula3.elegosoft.com/cm3/doc/tutorial/m3/ to compile a basic program. I have downloaded cm3-bin-core-AMD64_LINUX-5.8.6-REL.tgz http://www.opencm3.net/releng/cm3-bin-core-AMD64_LINUX-5.8.6-REL.tgz onto a Debian system running in VMWare.

It appears the compiler is correctly installed and path set: cm3 --version

/Critical Mass Modula-3 version 5.8.6 last updated: 2010-04-11 compiled: 2010-07-12 20:10:34 configuration: /usr/local/cm3/bin/cm3.cfg host: AMD64_LINUX target: AMD64_LINUX/

Here is my source code for module "Main.m3" which is in /home/usr/Modula/

MODULE Main; VAR num: INTEGER; BEGIN num := 10; END Main.

When I enter cm3 Main.m3 here is the resulting error:

/new source -> compiling Main.m3 /bin/sh: 1: as: not found assemble => 127 assembler failed assembling: Main.ms compilation failed => not building program "prog" Fatal Error: package build failed/

Any ideas what the problem is?

"as" is the Gnu assembler.  Cm3 invokes it at the end of its compilation process.  You need to have it installed and apparently don't.  On my Mint 20.1, the executable itself is in /usr/bin/as.  The package that installs it is named "binutils", and on my machine, it is version 2.34-6ubuntu1.3.

Thanks.

P.S. Why does the compiler create the folder "AMD64_LINUX" when trying to compile?

Cm3 puts all its generated files in there, including object code files, the final executable, and several with compiler-produced info that it uses to implement the inter-file, type-safe compilation of Modula-3, plus some other things.  The name "AMD64_LINUX" is one of Cm3's many names of different cpu/os/etc targets it can compile to.

It is possible to cross-compile the same source code from "src/*" into target code for different targets, putting it into different directories alongside the "src" directory, with different names. You most likely aren't interested in doing this.  Your installation of Cm3 chose this name from the platform you are running on.

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1053, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSVZNA5GHEMRP4CBRAZHDLV4NYWFANCNFSM6AAAAAAQD6LKBE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

SethMarshall commented 2 years ago

That was it. Thanks!

VictorMiasnikov commented 2 years ago

Critical Mass Modula-3 version 5.8.6

We have Critical Mass Modula-3 version 5.11.9 :

https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20220208_13-48

Are You really want use cm3 5.8.6 ? ( We have message about migrating to Github on main page http://modula3.org/ , https://modula3.elegosoft.com/cm3/ , but , unfortunately, we don't have this info on all pages . . . ;-( Sorry )

P.S.

2022-11-16:

In https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20221108_14-05 we have more modern cm3 AMD64_LINUX