Problems building ParaSail v8 under Windows MSYS2 MINGW64

173 views
Skip to first unread message

Zing Chen

unread,
May 2, 2019, 5:16:42 AM5/2/19
to ParaSail Programming Language
Hello,

I'm trying to build ParaSail v8 under Windows 7 - x64 in MSYS2\MINGW64 environment.

I'm stuck at parasail_gtk:

$ mingw32-make
cd interpreter
; ./config.sh
Config: PO locks enabled
C
:/msys64/mingw64/bin/mingw32-make -C parser/build
mingw32
-make[1]: Entering directory 'C:/parasail/parser/build'
cd ayacc
; gnatmake -I../../../aflex_ayacc/ayacc ../../../aflex_ayacc/ayacc/ayacc.adb -o ../bin/ayacc
gnatmake
: "../bin/ayacc.exe" up to date.
cd aflex
; gnatmake -I../../../aflex_ayacc/aflex -I../../../aflex_ayacc/aflex/GEN ../../../aflex_ayacc/aflex/aflex.adb -o ../bin/aflex
gnatmake
: "../bin/aflex.exe" up to date.
mingw32
-make[1]: Leaving directory 'C:/parasail/parser/build'
cd testsuite
/ParaSail; ../support/clean.sh
cd testsuite
/Sparkel;  ../support/clean.sh
cd testsuite
/Parython; ../support/clean.sh
cd testsuite
/Javallel; ../support/clean.sh
gprbuild
-p -p -g -O0 -gnato -gnata -gnatE -gnat95 -P build/parasail -largs
gprbuild
: "parasail_main.exe" up to date
gprbuild
-p -c -P build/compiled_main -largs -lm
gprbuild
-p -c -p -g -O0 -gnato -gnata -gnatE -gnat95 -P build/compiled_main_with_interp -largs -lm
gprbuild
-p -p -g -O0 -gnato -gnata -gnatE -gnat95 -P build/parasail_gtk -largs
Link
   
[link]         parasail_main_gtk.adb
c
:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgtk-win32-2.0
c
:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgdk-win32-2.0
c
:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -latk-1.0
c
:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgdk_pixbuf-2.0
collect2
.exe: error: ld returned 1 exit status
gprbuild
: link of parasail_main_gtk.adb failed
mingw32
-make: *** [Makefile:116: parasail_gtk] Error 4

gtk_libs (created by the builder)
-LC:/msys64/mingw64/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -pthread -lgthread-2.0 -lintl -lglib-2.0

Obviously, ld.exe finds static libraries (.a), such as libintl.a, from the relevant lib directory (C:/msys64/mingw64/lib). But it refuses to 'see' imported dynamic libraries, such as libgtk-win32-2.0.dll.a, which is present in the same directory.

How can I tell it to look at the .ddl.a as well?

Thank you.


Tucker Taft

unread,
May 2, 2019, 11:33:26 AM5/2/19
to ParaSail Programming Language
I suggest you omit the GTK executable.  It hasn't been tested on windows, and even on the Mac where I do most of my testing, the GTK interface has become pretty flaky.  As far as the direct answer to your question, I have never seen ".dll.a" as a good extension.  What does that mean?  I am used to seeing ".dll" on Windows, or ".a" on Unix-oids. In general, I am not a Windows expert, and so will be flailing a bit trying to answer questions that touch on system-level issues there.

-Tuck

--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zing Chen

unread,
May 2, 2019, 7:26:09 PM5/2/19
to ParaSail Programming Language

On Thursday, May 2, 2019 at 10:33:26 PM UTC+7, Tucker Taft wrote:
I suggest you omit the GTK executable.  It hasn't been tested on windows, and even on the Mac where I do most of my testing, the GTK interface has become pretty flaky. 

I'm not sure I understand. Would parasail only (not parasail_gtk) suffice to make a working compiler? What is, then, the point of parasail_gtk?

As far as the direct answer to your question, I have never seen ".dll.a" as a good extension.  What does that mean?  I am used to seeing ".dll" on Windows, or ".a" on Unix-oids. In general, I am not a Windows expert, and so will be flailing a bit trying to answer questions that touch on system-level issues there.

-Tuck

A .dll.a file is a stub file that describes a .dll which should exist in the run environment but does not exist in the build environment. msys2/mingw64 tool chain (GCC-Ada etc) simulates a *NIX build environment that specifically targets Windows 64-bit environment. So, it is kind of a *NIX-to-64-bit-Windows cross-compiler.

Contrary to mingw (or mingw-w64), msys2/mingw64 is more *NIX-like. For example, it can run the pre-built ParaSail interpreter interps.csh.

Contrary to msys2 alone (or cygwin), msys2/mingw64 produces more Windows-like executables. For example, theoretically, it can compile a ParaSail compiler that runs on Windows natively, i.e. without installed msys2 or cygwin.

That's to my best understanding. I use msys2/mingw64 very occasionally.

Thank you.

Tucker Taft

unread,
May 2, 2019, 8:25:08 PM5/2/19
to ParaSail Programming Language
On Thu, May 2, 2019 at 7:26 PM Zing Chen <tranng...@gmail.com> wrote:

On Thursday, May 2, 2019 at 10:33:26 PM UTC+7, Tucker Taft wrote:
I suggest you omit the GTK executable.  It hasn't been tested on windows, and even on the Mac where I do most of my testing, the GTK interface has become pretty flaky. 

I'm not sure I understand. Would parasail only (not parasail_gtk) suffice to make a working compiler? What is, then, the point of parasail_gtk?

Yes, "parasail" by itself is a full interpreter.  ParaSail_GTK supports some additional operations defined in the file examples/gtk_cairo.psl.  So I recommend you ignore the parasail_gtk executable, and just use the parasail one.


As far as the direct answer to your question, I have never seen ".dll.a" as a good extension.  What does that mean?  I am used to seeing ".dll" on Windows, or ".a" on Unix-oids. In general, I am not a Windows expert, and so will be flailing a bit trying to answer questions that touch on system-level issues there.

-Tuck

On Thu, May 2, 2019 at 5:16 AM Zing Chen wrote:
Hello,

I'm trying to build ParaSail v8 under Windows 7 - x64 in MSYS2\MINGW64 environment.

I'm stuck at parasail_gtk:
...

A .dll.a file is a stub file that describes a .dll which should exist in the run environment but does not exist in the build environment. msys2/mingw64 tool chain (GCC-Ada etc) simulates a *NIX build environment that specifically targets Windows 64-bit environment. So, it is kind of a *NIX-to-64-bit-Windows cross-compiler.

Contrary to mingw (or mingw-w64), msys2/mingw64 is more *NIX-like. For example, it can run the pre-built ParaSail interpreter interps.csh.

Contrary to msys2 alone (or cygwin), msys2/mingw64 produces more Windows-like executables. For example, theoretically, it can compile a ParaSail compiler that runs on Windows natively, i.e. without installed msys2 or cygwin.

That's to my best understanding. I use msys2/mingw64 very occasionally.

I am somewhat familiar with cygwin and mingw, though I have more experience with mingw32.


Thank you.

I think so long as you steer clear of *gtk things should work on Windows.

-Tuck
...

Zing Chen

unread,
May 2, 2019, 11:35:35 PM5/2/19
to ParaSail Programming Language
Thank you very much. I followed your advice, with a restricted build command:

$ mingw32-make config build_no_gtk  build_sparkel build_javallel build_parython  test_runtime local-install

I sucessfully tested the new (not pre-built) version of the interpreter parasail_main.exe, using the Drinking Philosophs example as advised by the PARASAIL INSTALLATION "SMOKE TEST" section of the release notes.

I then tried building the compiler and the run-time, following the PARASAIL LLVM-BASED COMPILER section of the release notes:

$ ./pslc.csh -b3 -O2

The good news is it finally reported error, that I haven't installed LLVM (yet):

llc: Command not found.

The bad news is it detected such errors only after 2 hours of intensive working (in both CPU and memory consumption).

Here're the full offer from MSYS2:

# pacman -Ss llvm
mingw32
/mingw-w64-i686-clang 8.0.0-2
    C language family frontend
for LLVM (mingw-w64)
mingw32
/mingw-w64-i686-compiler-rt 8.0.0-2
   
Runtime libraries for Clang and LLVM (mingw-w64)
mingw32
/mingw-w64-i686-lld 8.0.0-2
   
Linker tools for LLVM (mingw-w64)
mingw32
/mingw-w64-i686-llvm 8.0.0-2
   
Low Level Virtual Machine (mingw-w64)
mingw32
/mingw-w64-i686-polly 8.0.0-2
   
Polly - Polyhedral optimizations for LLVM (mingw-w64)
mingw64
/mingw-w64-x86_64-clang 8.0.0-2
    C language family frontend
for LLVM (mingw-w64)
mingw64
/mingw-w64-x86_64-compiler-rt 8.0.0-2
   
Runtime libraries for Clang and LLVM (mingw-w64)
mingw64
/mingw-w64-x86_64-lld 8.0.0-2
   
Linker tools for LLVM (mingw-w64)
mingw64
/mingw-w64-x86_64-llvm 8.0.0-2
   
Low Level Virtual Machine (mingw-w64)
mingw64
/mingw-w64-x86_64-polly 8.0.0-2
   
Polly - Polyhedral optimizations for LLVM (mingw-w64)
msys
/clang-svn 60106.1d5b05f-1
    C language family frontend
for LLVM (mingw-w64)
msys
/lld-svn 4595.3511ec1-1
   
Linker tools for LLVM (mingw-w64)
msys
/llvm-svn 124592.2aebced-1
   
Low Level Virtual Machine (mingw-w64)

Should I install all mingw64/xxxx packages from the offer? I wish I knew the exact list of required packages without much trials and errors.

Any hint is welcome.

-- Zing.

Zing Chen

unread,
May 3, 2019, 5:55:36 AM5/3/19
to ParaSail Programming Language


On Friday, May 3, 2019 at 10:35:35 AM UTC+7, Zing Chen wrote:
...
Should I install all mingw64/xxxx packages from the offer? I wish I knew the exact list of required packages without much trials and errors.


One trial and error more, I determined that at least two mingw64/mingw-w64-x86_64-xxxx packages are necessary:

llvm
clang

I installed both. But
$ ./pslc.csh -b3 -O2

still complained that it can not understand 'make' command. I didn't install msys/make package to reduce the possibility of invoking the wrong (MSYS2) tool.

I copied pslc.csh into pslc1.csh and replaced the only 'make' command in pslc1.csh
make --silent $make_target OBJS="$objs" EXE="$exe" $silent
with
mingw32-make --silent $make_target OBJS="$objs" EXE="$exe" $silent

The command
$ ./pslc.csh -b1 -O0
completed succesfully: aaa.psi.o was created in directory /c/parasail/lib. On the other hand,
$ ./pslc.csh -b2 -O0
has failed:

gcc.exe: error: /c/parasail/lib/reflection.psl.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/llvm_printer.psi.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/llvm_printer.psl.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/psvm_debugging.psl.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/type_desc_llvm_utils.psi.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/type_desc_llvm_utils.psl.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/compiler.psi.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/compiler.psl.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/compiler_main.psl.o: No such file or directory
gcc
.exe: error: /c/parasail/lib/aaa.psi.o: No such file or directory
gprbuild
: link of compiled_main_with_interp.adb failed
mingw32
-make: *** [Makefile:154: compiled_main_with_interp] Error 4

Strange is, that it did create intermediate .ll files (like reflection.psl.ll) and the respective .o file (reflection.psl.o). The .ll files are deleted but the .o files are still there.

So, I have no idea what's going on and what may be wrong here. Any suggestion?

Thank you.

-- Zing.

Zing Chen

unread,
May 3, 2019, 5:59:35 AM5/3/19
to ParaSail Programming Language
On Friday, May 3, 2019 at 4:55:36 PM UTC+7, Zing Chen wrote:

The command
$ ./pslc.csh -b1 -O0
completed succesfully: aaa.psi.o was created in directory /c/parasail/lib. On the other hand,
$ ./pslc.csh -b2 -O0
has failed:


Oops. I mean pslc1.csh in both cases. The pslc.csh is kept intact.

Sorry for the typo.

-- Zing

Zing Chen

unread,
May 3, 2019, 12:01:59 PM5/3/19
to ParaSail Programming Language
UPDATE. I've installed msys/make package and use the original pslc.csh script (not the modified pslc1.csh which replaces 'make' with 'mingw32-make.exe'. It works.

parasail.exe compiled.

I've run the test suit to check that the build is complete. Out of 167 tests, 160 passed, 5 failed, and 2 unknown:

*** ParaSail Testsuite
Using the ParaSail Compiler
Tests summary
-------------
Num_Tests = 160/167 (Failed = 5)

real    
24m47.193s
user    
0m7.388s
sys    
2m47.545s


output saved
in /c/parasail/testsuite/ParaSail/runtests.out

Failed: core_clock div_con fifo_queue_con for_loop_con locked_box

As a dirty and quick test that it is indeed a native Windows (mingw-w64) program, I've tried to run it in a Windows shell (cmd.exe), with a copy of libreadline8.dll and libtermcap-0.dll put in the same directory. It did run:

c:\parasail\bin>compiler
ParaSail Interpreter and Virtual Machine Revision: 8.0
Copyright (C) 2011-2019, AdaCore, New York NY, USA
This program is provided "as is" with no warranty.
Report problems at http://groups.google.com/group/parasail-programming-language

Enter input files:
.
It would be hard to test the later throughoutly without msys2 or cygwin because the compiler is implemented not only in ParaSail but also in csh and I know of no other good and free tcsh shell. I'll keep trying.

Thank you.

-- Zing.

On Friday, May 3, 2019 at 4:55:36 PM UTC+7, Zing Chen wrote:

Zing Chen

unread,
May 3, 2019, 2:30:25 PM5/3/19
to ParaSail Programming Language
On Friday, May 3, 2019 at 11:01:59 PM UTC+7, Zing Chen wrote:
UPDATE. I've installed msys/make package and use the original pslc.csh script (not the modified pslc1.csh which replaces 'make' with 'mingw32-make.exe'. It works.

parasail.exe compiled.

Oops. Actually compiler.exe. I'm sorry for the typo.


I've run the test suit to check that the build is complete. Out of 167 tests, 160 passed, 5 failed, and 2 unknown:


Oops. Actually out of 167 tests, 160 done (7 omitted), of which 5 failed (155 passed). I'm sorry for misreading the result.

There is a significant increase in failure rate when built with optimization level -O2:
*** ParaSail Testsuite
Using the ParaSail Compiler
Tests summary
-------------
Num_Tests = 160/167 (Failed = 32)

real    
23m38.184s
user    
0m7.711s
sys    
2m47.689s


output saved
in /c/parasail/testsuite/ParaSail/runtests.out

Failed: agg_with_iterator core_array2d core_basic_map core_bit_set core_clock core_countable_range core_enum_with_rep core_file core_fixed core_io core_map core_packed core_packed_word core_range_set core_set core_time div_con dp_with_colons dp2 drinking_phils fifo_queue_con for_loop_con hippo_game imat_vec locked_box mapset mat_vec non_univ_string para_hello range_set tokenizer2 wgraph

Since all failed tests end with raising an exception (see attachment), I guess I have a broken build.

I'll keep trying to re-build.

Thank you.

-- Zing.
runtests.out

Tucker Taft

unread,
May 3, 2019, 4:17:34 PM5/3/19
to ParaSail Programming Language
Glad to hear everything built well with default options.  Not obvious what might have gone wrong with -O2.  Hopefully it was just a temporary "glitch."

The c-shell scripts are not very complicated, so you could probably hand translate to the "normal" shell if you wanted to.

Take care,
-Tuck

--

Zing Chen

unread,
May 4, 2019, 2:19:31 PM5/4/19
to ParaSail Programming Language


On Saturday, May 4, 2019 at 3:17:34 AM UTC+7, Tucker Taft wrote:
Glad to hear everything built well with default options.  Not obvious what might have gone wrong with -O2.  Hopefully it was just a temporary "glitch."


It was a temporary glitch. Unfortunately, the permanent result is worse.

Example 1
$ bin/pslc.csh examples/fib.psl
psc
-interpreter.adb:11431: Error: invalid data

Runtime error: Exception CONSTRAINT_ERROR propagated.
Executing [null] at PC 1
 
Routine address = 16#8E_A230#
 
Locals at 16#6A1_BBD0#
Runtime error: Execute_For_Thread: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
Runtime error: Internal: Thread_Server 6: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
raised PSC
.INTERPRETER.PROPAGATING_EXCEPTION : psc-interpreter.adb:17143

C
:\msys64\mingw64\bin\llc.exe: error: C:\msys64\mingw64\bin\llc.exe: examples/fib.psl.ll: error: Could not open input file: No such file or directory

Example 2
$ bin/pslc.csh examples/hello_main.psl
psc
-interpreter.adb:11431: Error: invalid data

Runtime error: Exception CONSTRAINT_ERROR propagated.
Executing [null] at PC 1
 
Routine address = 16#8E_8FC0#
 
Locals at 16#49E_4D30#
Runtime error: Execute_For_Thread: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
Runtime error: Internal: Thread_Server 3: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
raised PSC
.INTERPRETER.PROPAGATING_EXCEPTION : psc-interpreter.adb:17143

call_compiled_main
.o: In function `_ada_call_compiled_main':
C:/parasail/interpreter/call_compiled_main.adb:128: undefined reference to `
_parasail_main_routine'
C:/parasail/interpreter/call_compiled_main.adb:109: undefined reference to `_parasail_main_routine'

collect2
.exe: error: ld returned 1 exit
status
gprbuild
: link of call_compiled_main.adb failed
make
: *** [Makefile:150: compiled_main] Error 4

On the other hand, if the -O2 is omitted (which is equivalent to -O0, right?) the result is good, although the exact number and identifiers of failed tests may vary:
*** ParaSail Testsuite
Using the ParaSail Compiler
Tests summary
-------------
Num_Tests = 160/167 (Failed = 5)

real    
24m43.985s
user    
0m6.768s
sys    
2m47.478s


output saved
in /c/parasail/testsuite/ParaSail/runtests.out

Failed: div_con fifo_queue_con for_loop for_loop_con locked_box

Here is how to reproduce the success / failure:

0. From a clean install of MSYS2, under MSYS2 shell, using the package manager pacman, install the msys package make and any other necessary *NIX base-devel tool, the mingw-w64-x86_64 packages gcc-ada, clang and all dependencies, and any other needed by ParaSail, such as readline.

1. Unzip the sub-directory parasail_release_8_0 in the ParaSail release v8 ZIP archive to the root directory of drive C: and rename it to parasail.

2. From MSYS2, under MINGW64 shell, type the following commands.

$ cd c:/parasail
$ make config build_no_gtk test_runtime local-install
$ bin/
pslc.csh -b3 [-O2]

3. Run examples and testsuite as needed, in the same (MINGW64) shell.

In order to try a bootstrap command anew (-b3 or -b3 -O2 or any other -bn -Om), repeat steps 1 through 2. Note that make clean would not suffice to delete all built files.


The c-shell scripts are not very complicated, so you could probably hand translate to the "normal" shell if you wanted to.


Certainly, I don't want to.

Take care,
-Tuck

Thank you for your consideration.

-- Zing.

Tucker Taft

unread,
May 4, 2019, 3:52:19 PM5/4/19
to ParaSail Programming Language
The handful of failures in the test suite are expected, as a number of these tests have inevitable load dependence due to potential thread scheduling differences, and so their saved output is not always identical.

The "-O2" problem is a mystery.  Try passing in "-i" to pslc.csh to verify that the "interpreted" compiler is doing the right thing.  E.g.:

   pslc.csh -i examples/fib.psl

When you rebuild with -O2, are you using "-b3" to rebuild everything, or are you using "-b2" to only rebuild the compiler?  It would be interesting to see whether the results are different.

Do you feel up to using the "gdb" that comes with the Ada compiler to try to diagnose what is happening?  If so, I can give you some instructions.

Take care,
-Tuck

Zing Chen

unread,
May 5, 2019, 2:37:13 PM5/5/19
to ParaSail Programming Language
On Sunday, May 5, 2019 at 2:52:19 AM UTC+7, Tucker Taft wrote:
The handful of failures in the test suite are expected, as a number of these tests have inevitable load dependence due to potential thread scheduling differences, and so their saved output is not always identical.

Which version? The non-optimized version (compiled without -O2) fails very few tests (about 5 out of 160). The -O2 version fails almost all tests (157 out of 160).

I've reported an -O2 version that fails "only" 32 tests. It was built with mingw32-make. (Except the final pslc.csh -b2 -O2 which uses make instead. I hoped that plsc.csh and Makefile were made to be Windows-friendly. I was wrong.) I can't reproduce that version. Every later trial following the same procedure results in a compiler that crashes in almost all cases.


The "-O2" problem is a mystery.  Try passing in "-i" to pslc.csh to verify that the "interpreted" compiler is doing the right thing.  E.g.:

   pslc.csh -i examples/fib.psl


The compiler crashes only if compiled. If interpreted, it works. For example
$ bin/pslc.csh -i -O2 examples/fib.psl -o fib

generates a fib.exe that runs under regular Windows shell (cmd.exe) and computes the correct answer
c:\parasail>fib 50
Fib(50) = 12586269025

c
:\parasail>


When you rebuild with -O2, are you using "-b3" to rebuild everything, or are you using "-b2" to only rebuild the compiler?  It would be interesting to see whether the results are different.

I use -b3 -O2, as reported yesterday.

Do you mean building the compiler (-b2 -O2) without first building the library (-b1 -O2)? I never tried this. Should I try this?

I've tried -b1 -O2 then -b2 -O2, but I always deleted compiler.exe first to force using the interpreter (parasail_main.exe) in both the steps. I didn't notice any difference between results of the normal method (-b3 -O2) and the alternative method (-b1 -O2 then -b2 -O2).


Do you feel up to using the "gdb" that comes with the Ada compiler to try to diagnose what is happening?  If so, I can give you some instructions.

Take care,
-Tuck

Please instruct me.

I've never used a debugger in command-line mode. And I can't remember the last time I touched the debugger in an graphic-mode Ada IDE.

BTW the package gcc-ada depends on about 20 other packages (which are also automatically downloaded and installed), but the gdb is not included.

Thank you very much.

-Zing

Zing Chen

unread,
May 6, 2019, 5:38:30 PM5/6/19
to ParaSail Programming Language


On Monday, May 6, 2019 at 1:37:13 AM UTC+7, Zing Chen wrote:
I've reported an -O2 version that fails "only" 32 tests. It was built with mingw32-make. (Except the final pslc.csh -b2 -O2 which uses make instead. I hoped that plsc.csh and Makefile were made to be Windows-friendly. I was wrong.) I can't reproduce that version. Every later trial following the same procedure results in a compiler that crashes in almost all cases.

I made advance a bit today. I found that -O2 compiler works, i.e. it doesn't crash, as long as it is linked with -O0 library.

0. Already have a compiler built with -b3 [-O0], which works (reported earlier).
1. Made library with -b1 -O0. The -O0 compiler was used. The library is already -O0 so this step is redundant, but that's what I did.
2. Made compiler with -b2 -O2. The -O0 compiler was used. The new compiler (with -O0 library) fails only 4 tests.
3. Made library with -b1 -O2. The -O2 compiler (with -O0 library) was used. The compiler + the new -O2 library (linked with test samples) fails 31 tests.
4. Rolled back step  2 - 3 and made a library with -b1 -O2 using the pure -O0 compiler. The pure -O0 compiler + the new -O2 library linked with test samples fails "only" 30 tests.

Thank you for reading.

-Zing

Tran Ngoc Duong

unread,
Jul 29, 2021, 6:06:21 PM7/29/21
to parasail-progr...@googlegroups.com
With llvm+clang v12 I can no longer compile the compiler. The following error was reported for Parasail v8.4.

$ bin/pslc.csh -b3 -O2

Installing Debugging Console!

the third field of the element type is mandatory, specify i8* null to migrate from the obsoleted 2-field form
llc: error: 'C:/parasail/lib/aaa.psi.ll': input module cannot be verified

--

Tucker Taft

unread,
Jul 29, 2021, 8:03:35 PM7/29/21
to ParaSail Programming Language
Yes, this is a known bug.  I have attached a version of lib/compiler.psl that fixes this problem.  Just replace your existing lib/compiler.psl with this file (after changing its name to "compiler.psl").

Take care,
-Tuck

compiler.psl.newerllvm

Zing Chen

unread,
Aug 17, 2021, 10:37:10 PM8/17/21
to ParaSail Programming Language
I'm sorry for late reply. Gmail didn't deliver your message and I didn't check this Google Group.

The new  `compiler.psl` didn't work:
```
$ bin/pslc.csh -b3 -O2
Installing Debugging Console!
C:/parasail/lib/aaa.psi:6612:9: Error: Assertion failed:  {> (for some Lit of Literals => Lit == Univ) <}
Executing "from_univ" at PC 1
  Locals at 16#797_FFE0#
Frame # 1
Executing $lambda_2930_505_11 at PC 2
C:/parasail/lib/compiler.psl:505:11: Info: within call of "from_univ", type => PSC::Reflection::Instruction::Opcode_Enum
  Locals at 16#797_FFB8#
>> ParaSail Debugger
Stack frame #2:
  func PSL::Core::Enum::"from_univ" (
    Univ : Univ_Enumeration
  ) -> Enum : Enum
  Enclosing_Type : PSC::Reflection::Instruction::Opcode_Enum
  Src_Pos : C:/parasail/lib/aaa.psi:6612:9 (Pc : 1)
  Assertion failure:
   6612>      {(for some Lit of Literals => Lit == Univ)}
(tcb:1.389.44) (psldb)
```
I'm following the  procedure described earlier in this thread. In particular, I use `$make config build_no_gtk test_runtime local-install` under Windows in MSYS2 MINGW64 build environment. The Ada compiler is `gcc-ada` v10.3.0-5 of the MinGW-w64 tool chain.

Thank you.

-Zing



On Friday, July 30, 2021 at 7:03:35 AM UTC+7 Tucker Taft wrote:
Yes, this is a known bug.  I have attached a version of lib/compiler.psl that fixes this problem.  Just replace your existing lib/compiler.psl with this file (after changing its name to "compiler.psl").

Take care,
-Tuck

On Thu, Jul 29, 2021 at 6:06 PM Zing Chen wrote:
With llvm+clang v12 I can no longer compile the compiler. The following error was reported for Parasail v8.4.

$ bin/pslc.csh -b3 -O2

Installing Debugging Console!

the third field of the element type is mandatory, specify i8* null to migrate from the obsoleted 2-field form
llc: error: 'C:/parasail/lib/aaa.psi.ll': input module cannot be verified

On Tue, May 7, 2019 at 4:38 AM Zing Chen wrote:


On Monday, May 6, 2019 at 1:37:13 AM UTC+7, Zing Chen wrote:
I've reported an -O2 version that fails "only" 32 tests. It was built with mingw32-make. (Except the final pslc.csh -b2 -O2 which uses make instead. I hoped that plsc.csh and Makefile were made to be Windows-friendly. I was wrong.) I can't reproduce that version. Every later trial following the same procedure results in a compiler that crashes in almost all cases.

I made advance a bit today. I found that -O2 compiler works, i.e. it doesn't crash, as long as it is linked with -O0 library.

0. Already have a compiler built with -b3 [-O0], which works (reported earlier).
1. Made library with -b1 -O0. The -O0 compiler was used. The library is already -O0 so this step is redundant, but that's what I did.
2. Made compiler with -b2 -O2. The -O0 compiler was used. The new compiler (with -O0 library) fails only 4 tests.
3. Made library with -b1 -O2. The -O2 compiler (with -O0 library) was used. The compiler + the new -O2 library (linked with test samples) fails 31 tests.
4. Rolled back step  2 - 3 and made a library with -b1 -O2 using the pure -O0 compiler. The pure -O0 compiler + the new -O2 library linked with test samples fails "only" 30 tests.

Thank you for reading.

-Zing

--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.

Tucker Taft

unread,
Aug 18, 2021, 10:49:30 AM8/18/21
to ParaSail Programming Language
Sorry about that.  I sent you a version of compiler.psl that had other changes besides the important one, and so wasn't compatible with other files that were already in the release 8.4.  So here is the *correct* compiler.psl, I believe, for release 8.4.  Again, use it to replace "lib/compiler.psl"

-Tuck

compiler.psl.goodllvm

Zing Chen

unread,
Aug 19, 2021, 12:56:15 AM8/19/21
to ParaSail Programming Language
The new compiler.psl compiles. Thank you.

However I got a broken compiler. The result remains the same as v8.0 (2 year ago.)
<pre>$ bin/pslc.csh examples/fib.psl
psc-interpreter.adb:11873: Error: invalid data


Runtime error: Exception CONSTRAINT_ERROR propagated.
Executing [null] at PC 1
 Routine address = 16#1_3FBC_F930#
  Locals at 16#2BB_5070#

Runtime error: Execute_For_Thread: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
Runtime error: Internal: Thread_Server 4: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
raised PSC.INTERPRETER.PROPAGATING_EXCEPTION : psc-interpreter.adb:17719

C:\msys64\mingw64\bin/llc.exe: error: C:\msys64\mingw64\bin/llc.exe: examples/fib.psl.ll: error: Could not open input file: No such file or directory
</pre>
As v8.4 is missing compile.sh, I copied it from v8.0.

Thank you for reading.

-Zing

Tucker Taft

unread,
Aug 19, 2021, 9:25:55 AM8/19/21
to ParaSail Programming Language
Please try:

   % cd examples
   % ../bin/pslc.csh -i -k -d fib_main.psl

This should give more information.

Thanks,
-Tuck

Zing Chen

unread,
Aug 19, 2021, 11:32:10 AM8/19/21
to ParaSail Programming Language
Please find below the output for fib.psl (as there's no fib_main.psl).
```
$ ../bin/pslc.csh -i -k -d fib.psl
ParaSail LLVM-Based Compiler version 2.0
/c/parasail/build/bin/parasail_main -parcalls off /c/parasail/lib/aaa.psi /c/parasail/lib/reflection.psi /c/parasail/lib/reflection.psl /c/parasail/lib/llvm_printer.psi /c/parasail/lib/llvm_printer.psl /c/parasail/lib/psvm_debugging.psl /c/parasail/lib/type_desc_llvm_utils.psi /c/parasail/lib/type_desc_llvm_utils.psl /c/parasail/lib/compiler.psi /c/parasail/lib/compiler.psl /c/parasail/lib/debugger_console.psl fib.psl -command Compile --debug fib.psl
Installing Debugging Console!
   [Error messages in file "errors.err"]
   [compiling fib.psl]
   [Fib contains 1 top level operation]
   [Fib_Helper contains 1 top level operation]
   [Fibit contains 1 top level operation]
   [Test_Print contains 1 top level operation]
   [Minus contains 1 top level operation]
   [Fib_Slow contains 1 top level operation]
   [main contains 1 top level operation]
 Begin initialization code for fib.psl
 Emit 101 type descriptors for fib.psl
 Emit 4 anon consts for fib.psl
 Emit 0 named consts for fib.psl
 Register 7 compiled ops for fib.psl
 Emit 267 strings for fib.psl
 Emit initialization func for fib.psl
 Dump LLVM for fib.psl
   [done compiling fib.psl]
```

Thank you.
-Zing

Tucker Taft

unread,
Aug 19, 2021, 11:56:54 AM8/19/21
to ParaSail Programming Language
OK, that looks promising.  I suggest you try re-compiling the compiler, using an "interpreted" version (that's the "-i" switch):

   %  cd <parasail_install_directory>
   %  bin/pslc.csh -i -k -b3 -w -d

The "-d" makes this verbose.  The "-k" and "-w" means it saves all intermediate results (*.ll, *.s, *.lst). This might take 30 minutes or so.

Take care,
-Tuck

Zing Chen

unread,
Aug 19, 2021, 2:22:06 PM8/19/21
to ParaSail Programming Language

Without -O2, the command produces a working compiler. With -O2 it results in a broken compiler.

Following are output of compiling the example fib.psl.
Working compiler:

$ ../bin/pslc.csh -O2 fib.psl -o fib
$ ./fib 30
Fib(30) = 832040

Broken compiler:

$ ../bin/pslc.csh  fib.psl
psc-interpreter.adb:11873: Error: invalid data

Runtime error: Exception CONSTRAINT_ERROR propagated.
Executing [null] at PC 1
 Routine address = 16#1_3FC5_F930#
  Locals at 16#4B3_4AB0#
Runtime error: Execute_For_Thread: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
Runtime error: Internal: Thread_Server 5: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
raised PSC.INTERPRETER.PROPAGATING_EXCEPTION : psc-interpreter.adb:17719

Tucker Taft

unread,
Aug 19, 2021, 4:34:01 PM8/19/21
to ParaSail Programming Language
Weird.  The -O2 flag is passed along to the LLVM compiler.  It also has the effect of suppressing certain run-time checks in the code generated by the compiler, but you would expect *fewer* run-time failures in the optimized version from that side effect.  So it sounds like we are hitting some kind of llvm bug, or generating llvm IL that is not properly annotated so the optimizer over-optimizes.

You might try adding the "-a" flag which keeps the run-time checks in the generated code even when -O2 is specified, to eliminate that as a source of the problem.

-Tuck

Zing Chen

unread,
Aug 19, 2021, 10:09:38 PM8/19/21
to ParaSail Programming Language

Like -O2, the -O2 -a results in a broken compiler:

$ ../bin/pslc.csh -O2 fib.psl -o fib
psc-interpreter.adb:11873: Error: invalid data

Runtime error: Exception CONSTRAINT_ERROR propagated.
Executing [null] at PC 1
 Routine address = 16#1_3F71_68E0#
  Locals at 16#2C7_3870#
Runtime error: Execute_For_Thread: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
Runtime error: Internal: Thread_Server 4: PSC.INTERPRETER.PROPAGATING_EXCEPTION raised.
raised PSC.INTERPRETER.PROPAGATING_EXCEPTION : psc-interpreter.adb:17719

C:\msys64\mingw64\bin/llc.exe: error: C:\msys64\mingw64\bin/llc.exe: fib.psl.ll: error: Could not open input file: No such file or directory

Pls find in the attached file complete log of the 3 trial builds of the compiler (no additional option, with -O2 and with -O2 -a).

Indeed, the working compiler (one resulted from -i -k -b3 -w -d) compiles better in -O2 mode. For example, the fib.exe resulted from pslc.csh -O2 fib.psl can compute fib(50) while one resulted from pslc.csh fib.psl can compute only fib(30). The fib(40) raises STORAGE_ERROR.

Thank you for consideration.

-Zing.

ParaSail-buildlog-1.txt
Reply all
Reply to author
Forward
0 new messages