Inline-Perl5 icon indicating copy to clipboard operation
Inline-Perl5 copied to clipboard

Windows 10: gmake fails with: `make (e=2): The system cannot find the file specified.`

Open hakonhagland opened this issue 4 years ago • 8 comments

On Windows 10, raku version 2021.05, Strawberry perl version 5.30.1 : After applying the fix in #165,

> raku configure.pl6
> gmake
cl -Wall p5helper.c   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl530.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a"  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -shared -o "resources\libraries\p5helper.dll" -fPIC -g
process_begin: CreateProcess(NULL, cl -Wall p5helper.c -s -LC:\STRAWB~1\perl\lib\CORE -LC:\STRAWB~1\c\lib C:\STRAWB~1\perl\lib\CORE\libperl530.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -IC:\STRAWB~1\perl\lib\CORE -shared -o resources\libraries\p5helper.dll -fPIC -g, ...) failed.
make (e=2): The system cannot find the file specified.
gmake: *** [Makefile:12: resources\libraries\p5helper.dll] Error 2

hakonhagland avatar Jun 13 '21 18:06 hakonhagland

This seems to be caused by compiling with cl.exe instead of gcc.exe. If I change CC = cl to CC = gcc in the generated Makefile and then rerun gmake it compiles:

> gmake
gcc -Wall p5helper.c   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl530.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a"  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -shared -o "resources\libraries\p5helper.dll" -fPIC -g
p5helper.c: In function 'p5_call_gv_two_args':
p5helper.c:1040:36: warning: format '%d' expects argument of type 'int', but argument 3 has type 'I32' {aka 'long int'} [-Wformat=]
             fprintf(stderr, "err: %d\n", *err);
                                   ~^     ~~~~
                                   %ld
p5helper.c: In function 'p5_scalar_call_gv_two_args':
p5helper.c:1078:36: warning: format '%d' expects argument of type 'int', but argument 3 has type 'I32' {aka 'long int'} [-Wformat=]
             fprintf(stderr, "err: %d\n", *err);
                                   ~^     ~~~~
                                   %ld


hakonhagland avatar Jun 13 '21 18:06 hakonhagland

How did you install Rakudo? Did you compile it yourself or did you use a precompiled package?

niner avatar Jul 04 '21 19:07 niner

I can confirm I had to change "cl" to "gcc" to get it to compile for me under Windows. I have Strawberry Perl installed and I installed Raku from an installer executable I found on the Raku website.

I still couldn't get Inline::Perl5 to install until I removed a couple of lines from one of the files involved in installing--I should've created a separate issue for it before I removed the cloned directory tree. Sorry.

Heptite avatar Oct 16 '22 00:10 Heptite

Pasting from @Heptite's reddit comment:

However, once I did get Inline::Perl5 installed, Tk fails to work under Windows. Once I run the MainLoop the program silently exits--it could be crashing, but I'm not sure how to tell.

I did try a couple of small Perl5 modules such as Digest::MD5 and they did work.

@Heptite Is that silently failing Raku code the same as what worked on Linux Mint?

raiph avatar Oct 16 '22 02:10 raiph

Yeah. I still plan on trying something more extensive using Tk with Inline::Perl5 under Mint to see whether I can get it to fail, but my main computer is Windows based so it will take me a little time.

Heptite avatar Oct 16 '22 02:10 Heptite

@Heptite

I still plan on trying something more extensive using Tk with Inline::Perl5

Putting that aside for now, please confirm (or correct) what I write below. TIA.

use Digest::MD5:from<Perl5>;
says md5_hex('abc');

Works on both your Linux Mint and Windows systems.

use Tk:from<Perl5>;
$top = Tk::MainWindow.new;
say 'OK1';
Tk::MainLoop;
say 'OK2';

Works on your Linux Mint system but says nothing, just silently failing on your Windows system.

raiph avatar Oct 17 '22 22:10 raiph

@Heptite

I still plan on trying something more extensive using Tk with Inline::Perl5

Putting that aside for now, please confirm (or correct) what I write below. TIA.

use Digest::MD5:from<Perl5>;
says md5_hex('abc');

Works on both your Linux Mint and Windows systems.

Yes.

use Tk:from<Perl5>;
$top = Tk::MainWindow.new;
say 'OK1';
Tk::MainLoop;
say 'OK2';

Works on your Linux Mint system but says nothing, just silently failing on your Windows system.

I have to add a "my" to the code to get it to compile, but that aside, it prints "OK1" on Windows, but fails to do anything else there; I assume it crashes at the point of trying to open a Tk toplevel window but I don't know how to tell.

On Mint it prints "OK1", opens a blank Tk toplevel window, and waits for me to close it before it then prints "OK2".

Heptite avatar Oct 17 '22 22:10 Heptite

Okay, I finally had a chance to try to build an actual Tk application using Inline::Perl5, but I get a crash when I try to create, for example, a button. I don't even have a chance to try to add the button to the toplevel window or anything. I just get an instant segfault.

So, in short, even simple Tk applications aren't possible even on Linux Mint.

Heptite avatar Oct 17 '22 22:10 Heptite