Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

Hoping you can help. I'm trying to install Algorithm::Permute on cygwin. It seems to fail at make. I can't seem to figure out what's wrong. I've listed the errors encountered below.

$ cpan -f Algorithm::Permute CPAN: Storable loaded ok (v2.27) Going to read '/home/conor/.cpan/Metadata' Database was generated on Fri, 22 Aug 2014 14:41:02 GMT Running install for module 'Algorithm::Permute' Running make for E/ED/EDPRATOMO/Algorithm-Permute-0.12.tar.gz CPAN: Digest::SHA loaded ok (v5.71) CPAN: Compress::Zlib loaded ok (v2.033) Checksum for /home/conor/.cpan/sources/authors/id/E/ED/EDPRATOMO/Algor +ithm-Permute-0.12.tar.gz ok CPAN: File::Temp loaded ok (v0.22) CPAN: Parse::CPAN::Meta loaded ok (v1.4401) CPAN: CPAN::Meta loaded ok (v2.110440) CPAN.pm: Going to build E/ED/EDPRATOMO/Algorithm-Permute-0.12.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Algorithm::Permute Writing MYMETA.yml CPAN: Module::CoreList loaded ok (v2.49_02) cp Permute.pm blib/lib/Algorithm/Permute.pm AutoSplitting blib/lib/Algorithm/Permute.pm (blib/lib/auto/Algorithm/P +ermute) gcc-4 -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-strict-ali +asing -pipe -fstack-protector -DUSEIMPORTLIB -O3 -DVERSION=\"0.12\" + -DXS_VERSION=\"0.12\" "-I/usr/lib/perl5/5.14/i686-cygwin-threads-64 +int/CORE" -DPERL_EXT coollex.c Makefile:333: recipe for target 'coollex.o' failed make: *** [coollex.o] Error 1 EDPRATOMO/Algorithm-Permute-0.12.tar.gz make -- NOT OK CPAN: YAML loaded ok (v1.09) Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible
TRIED TO RUN MAKE MANUALLY
cpan[1]> look Algorithm::Permute $ perl Makefile.PL CC=/usr/bin/gcc LD=/usr/bin/gcc Writing Makefile for Algorithm::Permute Writing MYMETA.yml
MY MYMETA.yml FILE
--- abstract: ~ author: [] build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 distribution_type: module dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 6.57_05' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Algorithm-Permute no_index: directory: - t - inc requires: {} version: 0.12
MAKE ERROR
$ make /usr/bin/gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-str +ict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3 -DVERSION=\ +"0.12\" -DXS_VERSION=\"0.12\" "-I/usr/lib/perl5/5.14/i686-cygwin-thr +eads-64int/CORE" -DPERL_EXT coollex.c Makefile:333: recipe for target 'coollex.o' failed make: *** [coollex.o] Error 1

Replies are listed 'Best First'.
Re: make error installing Algorithm::Permute
by syphilis (Archbishop) on Aug 23, 2014 at 02:12 UTC
    That's very odd.
    Algorithm-Permute-0.12 builds fine for me on Cygwin, and the command that fails for you is exactly the same as the command that succeeds for me.
    If the approach suggested by roboticus doesn't yied anything, check the permissions of coollex.c. (For me, they're -rw-r--r--)

    I often have trouble building modules for Cygwin if the build directory is outside of the Cygwin tree, but it looks to me that your build directory is probably inside the Cygwin tree anyway.

    Cheers,
    Rob
Re: make error installing Algorithm::Permute
by roboticus (Chancellor) on Aug 22, 2014 at 22:10 UTC

    It surprises me that there isn't a better message. It appears that gcc either didn't start up properly, or it crashed without printing any error messages. Can you currently compile c programs?

    If you can use the compiler normally, the only thing I could guess would be to remove options from the compile line, one at a time, until it succeeds. You may also want to check your build directory to see if there are any coredumps--if so, it may help the compiler team (assuming it's a gcc problem).

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Thanks for the suggestions. I'll give it a go.
Re: make error installing Algorithm::Permute
by Anonymous Monk on Aug 22, 2014 at 23:37 UTC

    Not what you're asking, but have you considered using Algorithm::Combinatorics? This does (permut|combin|vari)ations, and more.

Re: make error installing Algorithm::Permute
by ikegami (Patriarch) on Aug 25, 2014 at 03:56 UTC

    Says there's an error with at line 333 of Makefile. What's line 333 of Makefile?