gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple compiling/running problem


From: Eric Streit
Subject: Re: simple compiling/running problem
Date: Wed, 11 Oct 2023 17:31:32 +0200
User-agent: Thunderbird Daily

Hi again,

I search on the mailing list archives, found some references:

I tried them all ... nothing works.

My system is Debian/Bookworm up to date.

the main gm2 is based on gcc12 and is the one shipped with Debian

the second is from the last gcc release (13)

With a very simple helloworlds program, with all the suggestions in the mailing list, I got either:

1) Debian gm2:


$/usr/bin/gm2 -g Test1.mod

/usr/bin/ld : /tmp/ccwOR7hD.a(a-Test1_m2.o) : dans la fonction « init(int, char**) » : /home/eric/Devs/Compilation/Test-Modula2/a-Test1_m2.cpp:69 : référence indéfinie vers « _M2_hello_init » /usr/bin/ld : /tmp/ccwOR7hD.a(a-Test1_m2.o) : dans la fonction « finish() » : /home/eric/Devs/Compilation/Test-Modula2/a-Test1_m2.cpp:80 : référence indéfinie vers « _M2_hello_finish » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_select » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_initSemaphore » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_wait » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_signal »
collect2: error: ld returned 1 exit status

2) Debian gm2

$/usr/bin/gm2 -g -fruntime-modules=Storage,SYSTEM,M2RTS,RTExceptions,IOLink,RTco Test1.mod

/usr/bin/ld : /tmp/ccFWLtLQ.a(a-Test1_m2.o) : dans la fonction « init(int, char**) » : /home/eric/Devs/Compilation/Test-Modula2/a-Test1_m2.cpp:69 : référence indéfinie vers « _M2_hello_init » /usr/bin/ld : /tmp/ccFWLtLQ.a(a-Test1_m2.o) : dans la fonction « finish() » : /home/eric/Devs/Compilation/Test-Modula2/a-Test1_m2.cpp:80 : référence indéfinie vers « _M2_hello_finish » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_select » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_initSemaphore » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_wait » /usr/bin/ld : /usr/lib/gcc/x86_64-linux-gnu/12/m2/m2pim/libm2pim.so : référence indéfinie vers « RTco_signal »
collect2: error: ld returned 1 exit status
eric@aldebaran:~/Devs/Compilation/Test-Modula2$

3) Debian gm2

$/usr/bin/gm2 -g -flibs=pim,iso  Test1.mod

/usr/bin/ld : /tmp/ccsJj9zu.a(a-Test1_m2.o) : dans la fonction « init(int, char**) » : /home/eric/Devs/Compilation/Test-Modula2/a-Test1_m2.cpp:69 : référence indéfinie vers « _M2_hello_init » /usr/bin/ld : /tmp/ccsJj9zu.a(a-Test1_m2.o) : dans la fonction « finish() » : /home/eric/Devs/Compilation/Test-Modula2/a-Test1_m2.cpp:80 : référence indéfinie vers « _M2_hello_finish »
collect2: error: ld returned 1 exit status
eric@aldebaran:~/Devs/Compilation/Test-Modula2$

4) GCC13 gm2 (self compiled)

$gm2 -g -flibs=pim,iso  -o Test1 Test1.mod

eric@aldebaran:~/Devs/Compilation/Test-Modula2$ ./Test1

./Test1: error while loading shared libraries: libm2pim.so.18: cannot open shared object file: No such file or directory
eric@aldebaran:~/Devs/Compilation/Test-Modula2$

I don't know how to do it right :( :(

Best regards

Eric

On 10/10/2023 12:00, Eric Streit wrote:
Hi,

I just compiled the last gm2 release.

It went well (well, not so simple at first, as there are no simple instructions about how to do that), but I find out.

So, it runs perfectly (just tried to compile a simple hello program for now), but I got problem when I wanted to execute the resulting a.out

./a.out: error while loading shared libraries: libm2cor.so.18: cannot open shared object file: No such file or directory

I added the corresponding path (/usr/local/lib64 to the ld.so.conf configuration file).

If I launch : ldd a.out, I get this:


*********
eric@aldebaran:~/Devs/Compilation/Test-Modula2$ ldd a.out
     linux-vdso.so.1 (0x00007fff698b0000)
     libm2cor.so.18 => not found
     libm2log.so.18 => not found
     libm2pim.so.18 => not found
     libm2iso.so.18 => not found
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7021400000)
     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7021321000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7021642000)
     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7021140000)
     /lib64/ld-linux-x86-64.so.2 (0x00007f702168e000)
eric@aldebaran:~/Devs/Compilation/Test-Modula2$
*********

So here are my questions :

1) how can I launch the resulting a.out program ; something is certainly missing. I just tried the first test program from the documentation with the correct parameters (as they were given in the documentation)

2) Why are the correct libraries references not set like they are for the other non-gm2 libraries?

3) What is about this "a.out" resulting program. Why is it not the name of the main module? For a hello.mod -> hello

4) I didn't find test suites for the different dialects implemented in gm2: I'm sure they exist, but couldn't find them.

4) When testing some things in the gcc/m2 directory (the README), they just don't work. They certainly need update (the make doc line in the Readme doesn't work)


Sorry for all of these beginner questions ...


Best regards

Eric









reply via email to

[Prev in Thread] Current Thread [Next in Thread]