1. Unable to compile Eu programs
- Posted by SunPsych08 Jun 08, 2016
- 2650 views
Hello,
I'm having a program compiling my Eu programs. Any help would be appreciated.
I'm running Win7 on a 64bit machine.
Eu 4.1.0 is installed at c:\Euphoria. My user variables are: EUDIR = c:\Euphoria and path = c:\Euphoria\bin;
MinGW (for 32 bit) is installed at c:\MinGW. The (user) path is set to c:\MinGW\bin;
My Eu programs are at: c:\users\user\programming\projects\euphoria
At the console prompt in that directory i enter: euc -gcc -con hello.ex
I get a message that says:
Couldn't compile file init-.c
Status: -1
Command: gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -02 -m64 -IC:/Euphoria -ffast-math init-.c
Can anyone please decode the message for me and suggest a solution?
Thank you,
Alex
2. Re: Unable to compile Eu programs
- Posted by jimcbrown (admin) Jun 09, 2016
- 2601 views
Hello,
I'm running Win7 on a 64bit machine.
MinGW (for 32 bit) is installed at c:\MinGW. The (user) path is set to c:\MinGW\bin;
Command: gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -02 -m64 -IC:/Euphoria -ffast-math init-.c
Can anyone please decode the message for me and suggest a solution?
Might be a problem with our configure script. If MinGW is 32bit then we should not be passing the -m64 option to it.
3. Re: Unable to compile Eu programs
- Posted by SunPsych08 Jun 09, 2016
- 2566 views
Hello,
Command: gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -02 -m64 -IC:/Euphoria -ffast-math init-.c
Might be a problem with our configure script. If MinGW is 32bit then we should not be passing the -m64 option to it.
OK. I wonder what other Euphorians are doing? Cygwin or OW I guess. Anyway, thank you. I'll try another compiler.
Alex
4. Re: Unable to compile Eu programs
- Posted by ne1uno Jun 10, 2016
- 2540 views
Hello,
Command: gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -02 -m64 -IC:/Euphoria -ffast-math init-.c
Might be a problem with our configure script. If MinGW is 32bit then we should not be passing the -m64 option to it.
OK. I wonder what other Euphorians are doing? Cygwin or OW I guess. Anyway, thank you. I'll try another compiler.
Alex
you can use -cflags and -lflags to change -m32 and the other compiler options but this is probably a bug or a feature request. there should be an -m32 option on 64bit euc so that you know it will build a 32bit executable that will compile and run properly.
the 4.1 32bit eui can build the 4.1 64bit executables, so maybe it's possibly to just change -m32?
the 64 bit MinGW compiler can build 32 bit or 64 bit programs
5. Re: Unable to compile Eu programs
- Posted by SDPringle Jun 10, 2016
- 2558 views
Euphoria is written with the expectation that if you can run the 64 bit version of the translator, you have a compiler that can create 64-bit binaries.
I can imagine scenarios when a user might want to create 32-bit binaries on his 64-bit machine. If you are writing programs for other computers, you surely want this. Yet, if you do, perhaps you don't want the performance of programs running on your 64-bit box to be limited to a 32-bit version of Euphoria.
Other Euphoria users have a matching compiler for the translator. Changing ming to a 64-bit version or changing Euphoria to a 32-bit version would eliminate the error message and allow you to create binaries. The cflags option should work as well, and can be made less painful with a batch file.
Shawn
6. Re: Unable to compile Eu programs
- Posted by jimcbrown (admin) Jun 10, 2016
- 2497 views
Euphoria is written with the expectation that if you can run the 64 bit version of the translator, you have a compiler that can create 64-bit binaries.
I can imagine scenarios when a user might want to create 32-bit binaries on his 64-bit machine.
This is suppose to work with the -arch option of the translator.
7. Re: Unable to compile Eu programs
- Posted by SunPsych08 Jun 11, 2016
- 2479 views
Euphoria is written with the expectation that if you can run the 64 bit version of the translator, you have a compiler that can create 64-bit binaries.
Shawn
Admittedly, I'm new at this. I read in the Manual under 6.4.2.1 Notes: that "Currently, only 32-bit compilers are supported on 64-bit platforms", and I took this to mean that I should use the 32-bit version of MinGW, even though I've got a 64-bit machine. In case it makes any difference, I can add that to date I've tried typing at the prompt: C:\...>euc -con hello.ex and C:\...>euc -gcc -con hello.ex, without success.
To get me going, if someone told me what MinGW compiler they use, where they got it from, how they installed it (if any special fiddling was required), and how they make it work for Eu 4.1, I'll happily follow in their footsteps.
Actually, what I really want to do is to use the translator to generate C code from my programs, so that I can study it. If I can achieve that without messing about with compilers, I could live with it and continue to bind my programs instead. (Even so, it would still be nice to know how to compile them as well.) I'd appreciate any guidance in this matter also.
Thank you,
Alex
8. Re: Unable to compile Eu programs
- Posted by petelomax Jun 12, 2016
- 2451 views
Actually, what I really want to do is to use the translator to generate C code from my programs, so that I can study it. If I can achieve that without messing about with compilers, I could live with it and continue to bind my programs instead. (Even so, it would still be nice to know how to compile them as well.) I'd appreciate any guidance in this matter also.
Thank you,
Alex
Well, if what you really want to study is how things work at the lowest level, I can suggest an alternative.
Download a copy of Phix (nothing else required) and run "p -d test" - it will generate a list.asm to go with the test.exe. (replace test with an actual program)
However the listing is in low-level assembly rather than C. For study purposes, "p -d -nodiag test" might be easier to digest.
There is also demo\arwendemo\filedumpN.exw which will list every single byte of your test.exe in excruciating detail (modify the fixed path in main() or just use File/Open).
Regards,
Pete
9. Re: Unable to compile Eu programs
- Posted by SunPsych08 Jun 12, 2016
- 2398 views
Well, if what you really want to study is how things work at the lowest level, ... Download Phix...
Regards,
Pete
Thanks Pete.
When I tried installing Phix, via the installer and also from the zip file, I got the following error on both occasions:
"C:\Program Files (x86)\Phix"
Cannot open autoinclude VM\pcallfunc.e
in C:\Program Files (x86)\Phix\,
...C:\Program Files (x86)\Phix\builtins\VM\,
...C:\Program Files (x86)\Phix\builtins\,
or C:\Euphoria\include.
Do I have to do something extra to make it work?
Thank you,
Alex
10. Re: Unable to compile Eu programs
- Posted by petelomax Jun 12, 2016
- 2387 views
Cannot open autoinclude VM\pcallfunc.e
Do I have to do something extra to make it work?
Oh yeah, sorry, I forgot that was reported a month ago ( http://openeuphoria.org/forum/129606.wc#129606 ) and I have not re-zipped yet...
Can you grab a copy of that file from my bitbucket repository and put it in Phix\builtins\VM?
Pete
11. Re: Unable to compile Eu programs
- Posted by SunPsych08 Jun 13, 2016
- 2388 views
Can you grab a copy of that file from my bitbucket repository and put it in Phix\builtins\VM?
Pete
Got it! Thanks Pete.
Alex
12. Re: Unable to compile Eu programs
- Posted by jmduro Aug 26, 2016
- 2272 views
Oh yeah, sorry, I forgot that was reported a month ago ( http://openeuphoria.org/forum/129606.wc#129606 ) and I have not re-zipped yet...
Can you grab a copy of that file from my bitbucket repository and put it in Phix\builtins\VM?
Pete
Hello Pete,
I installed Phix on Linux Debian 8 32-bits. I thought I had to compile p.exw because p is allways mentioned as the interpreter/compiler. After compiling, I understood p is renamed to phix on Linux. Maybe this is worth mentioning.
To be able to compile it with ./phix -c p.exw, I had not only to get builtins/VM/pcallfunc.e from the bitbucket repository but also builtins/pAlloc.e.
Regards
Jean-Marc
13. Re: Unable to compile Eu programs
- Posted by jmduro Aug 26, 2016
- 2197 views
Now to run some demos as tinEWGdemo/poly.exw, other include files are missing (pCrashN.e). Maybe phix.zip should be updated.
Jean-Marc
14. Re: Unable to compile Eu programs
- Posted by jmduro Aug 26, 2016
- 2218 views
OK. tinEWG is Windows-specific. Most of Phix stuff is Windows-specific. HTML help does not work: most of the links are outdated. Running archmage under Linux on the CHM help file brings HTML help up to date.
CHM files can be viewed with xchm. chm2pdf generates an error when trying to convert phix.chm in PDF but does the job. I tried following commands:
chm2pdf --book phix.chm phix_book.pdf chm2pdf --webpage phix.chm phix_web.pdf chm2pdf --continuous phix.chm phix_cont.pdf
The last one seems to be the most convenient as it gives correct page numbers.
wee demo does not work even with ui_gtk.e copied into the directory. It seems related to scintilla and does not work even with scintilla development files installed.
I'm looking further to get something graphical to be displayed. Actually I just saw the textual cpuid demo work, but I did not test all demos.
Jean-Marc
15. Re: Unable to compile Eu programs
- Posted by petelomax Aug 26, 2016
- 2177 views
Hello Pete,
Hello there
I installed Phix on Linux Debian 8 32-bits.
Very brave of you!
p is renamed to phix on Linux. Maybe this is worth mentioning. but also builtins/pAlloc.e. other include files are missing (pCrashN.e).
All noted, thanks
Maybe phix.zip should be updated.
Most of Phix stuff is Windows-specific.
wee demo does not work
HTML help does not work
I have spent the last two months or more working on IUP, mainly trying to port Edita.
Just this week I was thinking it is about time I fired up Linux and got what I have so far working, and ship a new release.
That is not likely to happen overnight, though.
I'm looking further to get something graphical to be displayed.
Me too
Seriously though, all help appreciated, of course, but at the moment I have to admit that Phix on Linux is not really usable yet.
(I think demo/pGUI/alarm.exw worked, but that was about it.)
Will keep you posted if/when I make any progress.
Pete
16. Re: Unable to compile Eu programs
- Posted by petelomax Aug 26, 2016
- 2180 views
- Last edited Aug 27, 2016
HTML help does not work: most of the links are outdated. Running archmage under Linux on the CHM help file brings HTML help up to date.
The chm is generated from docs/phix/src via docs/phix/html using docs/phix/makephix.exw
Some time ago I generated an online version at http://www.phix.is-great.org/docs.
I suspect I used constant justcompile=1, and I am (vaguely) aware that there is some kind of docs/ vs docs/docs/ issue, which ought to be fixed.
In short, while .chm is perfect for Windows, it should be relatively straightforward to modify docs/phix/makephix.exw to make something perfect for Linux (as long as it is html-based).
Pete
17. Re: Unable to compile Eu programs
- Posted by jmduro Aug 27, 2016
- 2130 views
Thank's Pete,
syswait.ew reference /home/pete in the bitbucket version leading to errors when executing demos:
builtins/syswait.ew:setenv("PHIXROOT","/home/pete/phix/")
/phix should do the job for anyone if phix is installed as recommended in /home/<user>/phix.
Regards
Jean-Marc
18. Re: Unable to compile Eu programs
- Posted by jmduro Aug 27, 2016
- 2098 views
It's amazing! The line I refered to is located in a multi-line comment so it should not be executed, but when I launch alarm.exw, /home/pete/phix appears in ex.err and I did not find another place where /home/pete is declared:
/home/pete/phix/pglobals.e:-1 in procedure set_rootpath() index 0 out of bounds, reading sequence length 4 cl = {"phix","phix","alarm.exw"} j = 0 ... called from /home/pete/phix/pglobals.e:110 ... called from /home/pete/phix/p.exw:166 Global & Local Variables /home/pete/phix/builtins/VM/pprntfN.e: init2 = 1 inf = inf nan = nan hexchar = "0123456789ABCDEFabcdef" bases = {10,16,8,2} /home/pete/phix/builtins/pgetpath.e: kernel32 = <novalue> buffer = <novalue> xGetLongPathName = <novalue> gppinit = 0 ...
Jean-Marc
19. Re: Unable to compile Eu programs
- Posted by petelomax Aug 28, 2016
- 2082 views
It's amazing! The line I refered to is located in a multi-line comment so it should not be executed, but when I launch alarm.exw, /home/pete/phix appears in ex.err and I did not find another place where /home/pete is declared:
Might be worth checking ptok.e - mine has a couple of
-- path = "/home/pete/phix/"&path[3..$] path = getenv("HOME")&"/phix/"&path[3..$]
- one in addPath(), and one in includeFile().
/home/pete/phix/pglobals.e:-1 in procedure set_rootpath() index 0 out of bounds, reading sequence length 4
I may have already addressed the "-1 => proper line number" issue on my copy, in any case it is obviously the find(rootpath[j],..) on line 104
I have no real idea why I coded
for j=length(rootpath) to 0 by -1 do
instead of
for j=length(rootpath) to 1 by -1 do
It may be worth trying that, or it may be that rootpath needs to be set to "" or ".", or there may be more serious problems with get_proper_path() on Lnx...
The other thing you could try is "./phix alarm.exw"
Pete
20. Re: Unable to compile Eu programs
- Posted by jmduro Aug 28, 2016
- 2099 views
I may have already addressed the "-1 => proper line number" issue on my copy, in any case it is obviously the find(rootpath[j],..) on line 104
I have no real idea why I coded
for j=length(rootpath) to 0 by -1 do
instead of
for j=length(rootpath) to 1 by -1 do
It may be worth trying that, or it may be that rootpath needs to be set to "" or ".", or there may be more serious problems with get_proper_path() on Lnx...
The other thing you could try is "./phix alarm.exw"
Pete
I already tried that but I still get the error as if this were hardcoded in phix executable (I get the same error with this line modified).
I must test this with a version I was able to compile on another PC at work. I can't understand why the same archive run on different PCs with the same Linux release behave differently. I know I did not test phix.zip recompile and the bitbucket version in the same order.
Regards
Jean-Marc