2

At school we have been told to do a private project, in a language of our choosing. I chose perl, and for the graphics (compulsory component) chose SDL.

Earlier I had installed portable-git, and the git-bash thing came with perl. Hooray! It worked! Let's install sdl!

cpan SDL

output:

Can't locate CPAN/Author.pm in @INC (you may need to install the CPAN::Author module)

This confused me, especially when I get the same message for cpan CPAN::Author. So I install a portable version of strawberry-perl (school computer security settings forbid installation of software by non-admins), and I get a different error message (after loading a bunch of stuff):

Welcome to Alien::SDL module installation                                                                               
-----------------------------------------                                                                                 
checking operating system... MSWin32                                                                                    
checking for gcc... yes                                                                                                 
checking build system type... MSWin32-x64-multi-thread                                                                  
checking platform specific module... using 'My::Builder::Windows'                                                       
checking SDL_INST_DIR env var... no                                                                                     
checking for config script... no                                                                                        
checking for prebuilt binaries... no                                                                                                                                                                                                            
You have the following options:                                                                                         
[1] Quit installation                                                                                                                                                                                                                           
What way do you wanna go? [1 ]1                                                                                         
No 'Build' created  FROGGS/Alien-SDL-1.446.tar.gz                                                                         
C:\Users\gardner.mark.INFOLAB\Downloads\strawberry-perl\perl\bin\perl.exe 
Build.PL -- NOT OK                          Stopping: 'install' failed for 
'Alien::SDL'. 

I have tried cpan Alien::SDL, and using the -f flag on both commands, but I still get the same message. Do I need to install something else, or what is the problem?

EDIT: as @xxfelixxx suggested, I installed cpanm successfully. However, that gives the following output, with an error (in bold):

--> Working on SDL                                                                                                      
Fetching http://www.cpan.org/authors/id/F/FR/FROGGS/SDL-2.548.tar.gz ... OK                                             
==> Found dependencies: Alien::SDL, Tie::Simple                                                                         
--> Working on Alien::SDL                                                                                               
Fetching http://www.cpan.org/authors/id/F/FR/FROGGS/Alien-SDL-1.446.tar.gz... OK
Configuring Alien-SDL-1.446 ... N/A                                                                                     
! Configure failed for Alien-SDL-1.446. See [...]\STRAWB~1\data\.cpanm\work\1527577290.7232\build.log for details.                                                                                                     
--> Working on Tie::Simple                                                                                             
Fetching http://www.cpan.org/authors/id/H/HA/HANENKAMP/Tie-Simple-1.04.tar.gz ... OK                                    
Configuring Tie-Simple-1.04 ... OK                                                                                      
Building and testing Tie-Simple-1.04 ... OK                                                                             
Successfully installed Tie-Simple-1.04                                                                                  
! Installing the dependencies failed: Module 'Alien::SDL' is not installed                                              
! Bailing out the installation for SDL-2.548.                                                                           
1 distribution installed 

So, as earlier, Alien::SDL fails to configure itself.

Mark Gardner
  • 442
  • 1
  • 6
  • 18
  • I have also tried to use the perl from cmder, but that gives the error from git-bash. – Mark Gardner May 28 '18 at 09:00
  • Did it successfully install the module, or did you get errors? seems like you had prerequisites missing and it did not complete the make.. – Gerhard May 28 '18 at 11:32
  • Try using cpanm. `cpan App-cpanminus` then `cpanm SDL` – xxfelixxx May 28 '18 at 12:29
  • 1
    In general, if the install fails on some other module (here CPAN::Author), try installing that module, then re-try your original install. – xxfelixxx May 28 '18 at 12:33
  • 1
    @xxfelixxx as I said, `cpan CPAN::Author` gives the same error. Since it literally told me to try installing it, I did. – Mark Gardner May 28 '18 at 13:20
  • @GerhardBarnard as this is Alien::SDL, it is a pure binary package (or something like that). I have included everything that is output after it gets ready to build it. It seems to me that it doesn't even try. maybe the fault lies in the line `checking for config script... no` ? – Mark Gardner May 28 '18 at 13:24
  • @xxfelixxx the `cpanm` idea might work, I'll check. Why not make that an answer? – Mark Gardner May 28 '18 at 13:25
  • @xxfelixxx cpanm didn't work, further detail in edit – Mark Gardner May 29 '18 at 07:20
  • Show the contents of: `\STRAWB~1\data\.cpanm\work\1527577290.7232\build.log` – xxfelixxx May 29 '18 at 11:19
  • Have a look at the cpan testers matrix and see if anyone else with your perl version, os version got it to work: http://matrix.cpantesters.org/?dist=Alien-SDL+1.446 – xxfelixxx May 29 '18 at 11:22
  • https://www.libsdl.org/download-2.0.php try installing the library first – xxfelixxx May 30 '18 at 03:09
  • @xxfelixxx wouldnt that log be the same as the output of `cpan`? And as far as I know, Alien::SDL should install the binaries on its own (and I'm on an unprivileged account, so I can't install anything, only use portable things). – Mark Gardner May 30 '18 at 14:01
  • Well, your message is that configure failed...we need to know why it failed. You are likely missing a dependency for configure. The log may shed light on the situation. – xxfelixxx May 30 '18 at 14:05
  • Ok, tomorrow I'll get the log (I'm at home now.) – Mark Gardner May 30 '18 at 14:07
  • @xxfelixxx hang on a minute, cpan says that it can't find a configuration script, so wouldn't that cause this? – Mark Gardner May 30 '18 at 14:08
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/172083/discussion-between-xxfelixxx-and-mark-gardner). – xxfelixxx May 30 '18 at 14:15
  • SDL 1.x in 2018 ? it is long dead and rotting, use `SDL2` and `Alien::SDL2` - that announce was posted in March 2013 - six years ago! http://yapgh.blogspot.com/ – Arioch 'The Jul 30 '19 at 22:07
  • @Arioch'The I was aware of that, and looked into it. It seemed to me that the `SDL` package was actually using SDL version 2. If not, I'm just as surprised/confused as you. – Mark Gardner Aug 10 '19 at 15:16
  • Sources of that package(that failed to you) clearly quote DLL names they want, including version numbers. Brief search for the developers made those packages bring to announcement they considered "SDL2" stabilized enough to start it, but not announcement they finished it. Lastly, mere grep through CPAN libraries list shows separate packages for SDL and SDL2, with all similar except for that 2 in name – Arioch 'The Aug 11 '19 at 12:29

1 Answers1

4

Short answer to the topicstarter:

Both SDL 1.x library and Alien:SDL perl module seem unmaintained, everyone went to SDL2 and Alien::SDL2

And so should you.

I installed Strawberry 5.30 Win64 and then I resolved obvious problems with file/folder access rights because I DO NOT want to run Perl or Perl games as Administrator user.

  • d:\Strawberry\cpan\
  • d:\Strawberry\perl\

Then I just issued Windows shell command cpan install Alien:SDL2 - and it installed like a charm.

Alternatively it seems to be possible to install Alien:SDL version 1 but that would need Win32/x86 version of Strawberry Perl, not Win64/x64 version. But... why? According to http://yapgh.blogspot.com the SDL v.1 is dead since March 2013.


Just adding more details.
Was hit by this too....
My wish is just to run Frozen Bubbles game on Win10 x64 box.
I have some experience with programming, but not in Perl, nor do I have Perl IDE or something.
I don't want any Perl programming hassle, I just want to make the game run.

I dropped here from Google for the same error message, so this maybe will help to somebody else too, whom Google maybe will forward here too.


Like I said, SDL 1.x library and Alien:SDL perl module are unmaintained.

However FrozenBubble game is not maintained any more too and only works with SDL 1.x


CPAN testing has the following record for Alien::SDL on Windows: http://www.cpantesters.org/cpan/report/154af118-6c11-1014-a593-b7c73b50a26f

Notable things:

  • it used Strawberry 5.28.2 not 5.30,
  • it uses x86/Win32 not x64/Win63
  • it quotes gccversion='7.1.0' ( Straberry 5.30 win64 seems to have 8.3)

So it seems to boil down to question, whether ABI for Win64 of GCC 7.1 and 8.3 is the same or not.


The error seems triggered by this file:

  • d:\Strawberry\cpan\build\Alien-SDL-1.446-0\inc\My\Utility.pm

It has $prebuilt_binaries array listing some - whd'ya think? - pre-built SDL 1.x libraries. It has 3 options for Win32 prebuilt SDL1.x and two options for Win64:

  • BEWARE: binaries are using old ABI option just for old strawberryperl 5.12.x/64bit and GCC 4.4.3
  • RECOMMENDED one for GCC gccversion_re => qr/^4\.(4\.[5-9]|[5-9]\.[0-9])$/
  • Notice: the GCC Version element is missed (no check) for Win32 library binaries!

That file also has a sub check_prebuilt_binaries which loops through the array and tries to match found Perl environment to those criteria.

The second line of the sub was commented out debug printf of environment to be checked (except for GCC). I de-commented it, moved upward and extended to include GCC.

sub check_prebuilt_binaries
{
  print "(os=$^O cc=$cc archname=$Config{archname} gccVer=$Config{gccversion})\r\n";
  print "checking for prebuilt binaries... ";
  my @good = ();
  foreach my $b (@{$prebuilt_binaries}) {
    if ( ($^O =~ $b->{os_re}) &&
         ($Config{archname} =~ $b->{arch_re}) &&
         ($cc =~ $b->{cc_re}) &&
         (!defined $b->{gccversion_re} || $Config{gccversion} =~ $b->{gccversion_re})
        ) {
      $b->{buildtype} = 'use_prebuilt_binaries';
      push @good, $b;
    }
  }
  scalar(@good)
    ? print "yes, " . scalar(@good) . " option(s)\n"
    : print "no\n";
  #returning ARRAY of HASHREFs (sometimes more than one value)
  return \@good;
}

Then I run Perl Build and here is what I got:

d:\Strawberry\cpan\build\Alien-SDL-1.446-0>perl ./Build.PL
Welcome to Alien::SDL module installation
-----------------------------------------
checking operating system... MSWin32
checking for gcc... yes
checking build system type... MSWin32-x64-multi-thread
checking platform specific module... using 'My::Builder::Windows'
checking SDL_INST_DIR env var... no
checking for config script... no
(os=MSWin32 cc=gcc archname=MSWin32-x64-multi-thread gccVer=8.3.0)
checking for prebuilt binaries... no

You have the following options:
[1] Quit installation

What way do you wanna go? [1 ]1

I am not good regexper, but for what I can see the GCC Win64 version is pinned to be 4.4.5+ or 4.5.x - and no version 5.0+ are allowed. Probably they did not exist when Alien:SDL was last committed.


GCC release notes mention ABI change w.r.t. x86-64 rather often, for example:

etc.

Which specific Win64 GCC ABI changes can be crucial for LibSDL I don't know. But it seems from CPAN test that at least Win32 ABI changes between GCC 4.5 and 7.1 were not that bad. Anyway, compiling SDL 1.x with modern GCC from sources would definitely be above my capabilities. So, take it or leave it...


Hoping for the good, I just removed (commented out) the GCC version test for the "recommended" Win64 SDL1 pre-built binaries.

d:\Strawberry\cpan\build\Alien-SDL-1.446-0>perl ./Build.PL test
Welcome to Alien::SDL module installation
-----------------------------------------
checking operating system... MSWin32
checking for gcc... yes
checking build system type... MSWin32-x64-multi-thread
checking platform specific module... using 'My::Builder::Windows'
Too early to specify a build action 'test'.  Do 'Build test' instead.

d:\Strawberry\cpan\build\Alien-SDL-1.446-0>perl ./Build test
Fetching 'http://strawberryperl.com/package/kmx/sdl/Win64_SDL-1.2.14-extended-bin_20111205.zip'...
Checking checksum for 'download\Win64_SDL-1.2.14-extended-bin_20111205.zip'...
Extracting download\Win64_SDL-1.2.14-extended-bin_20111205.zip...
t\001_load.t ................ 1/1 # Testing Alien::SDL 1.446, Perl 5.030000, D:\Strawberry\perl\bin\perl.exe
# Build type: use_prebuilt_binaries
# Detected sdl-config script: n.a.
# Build option used:
#       Binaries Win/64bit SDL-1.2.14 (extended, 20111205) RECOMMENDED
#       (gfx, image, mixer, net, smpeg, ttf, sound, svg, rtf, Pango)
# URL:
#       http://strawberryperl.com/package/kmx/sdl/Win64_SDL-1.2.14-extended-bin_20111205.zip
#       http://froggs.de/libsdl/Win64_SDL-1.2.14-extended-bin_20111205.zip
# SHA1: 35f3b496ca443a9d14eff77e9e26acfa813afafd
t\001_load.t ................ ok
t\002_config.t .............. 1/6 # Prefix='D:\Strawberry\cpan\build\Alien-SDL-1.446-0\blib\lib\auto\share\dist\Alien-SDL\1.446_6ae293a9\bin\..\'
t\002_config.t .............. ok
t\003_check_header.t ........ # Testing basic headers SDL.h + SDL_version.h
[Alien::SDL] Testing header(s): SDL.h
t\003_check_header.t ........ 1/2 L.h, SDL_version.h
t\003_check_header.t ........ ok
t\004_get_header_version.t .. 1/1 # Core version: 1.2.14
t\004_get_header_version.t .. ok
t\release-pod-coverage.t .... skipped: these tests are for release candidate testing
t\release-pod-syntax.t ...... skipped: these tests are for release candidate testing
All tests successful.
Files=6, Tests=10,  8 wallclock secs ( 0.06 usr +  0.05 sys =  0.11 CPU)
Result: PASS

Yahoo! works!!! or so it seems....


Now I can finally use CPAN to install the lib and the game?

…sadly, not.

CPAN probably detects I tinkered with the sources (checksum failures), re-fetches vanilla library into a new d:\Strawberry\cpan\build\Alien-SDL-1.446-1\ folder - and fails build with the same error as above. No good.

At least perl ./Build.PL install worked, but this library albeit installed locally was hardly registered in local CPAN registry because being installed outside CPAN framework?..

Probably CPAN gurus would manage to either pin local version faking CPAN checksums, or just would upload updated SDL module to CPAN, but... I am not them.

cpan> install  Games::FrozenBubble
Running install for module 'Games::FrozenBubble'
Checksum for D:\Strawberry\cpan\sources\authors\id\K\KT\KTHAKORE\Games-FrozenBubble-2.212.tar.gz ok

……

Running make test for DRTECH/Locale-Maketext-Lexicon-1.00.tar.gz
"D:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/1-basic.t ...................... 1/33 "msgunfmt" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
t/1-basic.t ...................... ok
…… 
t/55-runextract.t ................ ok
t/6-gettext.t .................... 1/30 "msgunfmt" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
t/6-gettext.t .................... ok
…...
t/preload.t ...................... ok
t/release-eol.t .................. skipped: these tests are for release candidate testing
t/release-pod-syntax.t ........... skipped: these tests are for release candidate testing
All tests successful.
Files=17, Tests=361, 11 wallclock secs ( 0.22 usr +  0.17 sys =  0.39 CPU)
Result: PASS

PASS??? Really?


with few more patches - it runs though. Nostalgy... https://github.com/kthakore/frozen-bubble/issues/72

Arioch 'The
  • 15,799
  • 35
  • 62