in reply to How to install Compress::Stream::Zstd in Strawberry Perl?

Monks-

This place is fantastic, as are the people who contribute! No wonder Perl continues to be my preferred language. I just wanted to describe the final solution that I ended up using, for anyone else who need this help.

Shout outs for:

Ok, here is what worked for me on a Windows 10 box:
  1. Install Strawberry Perl following the label directions

  2. Startup CPAN shell & install Alien::Zstd
    $ perl -MCPAN -e shell cpan> install Alien::Zstd
  3. Once successfully completed, verify the location of the libzstd.a library that was just built
    c:/Strawberry/perl/site/lib/auto/share/dist/Alien-zstd/lib/libzstd.a
  4. Back in CPAN shell, try to install Compress::Stream::Zstd (it should fail)

    cpan> install Compress::Stream::Zstd ... The system cannot find the file specified -or- Cannot find ext/zstd/lib/libzstd.a: No such file or directory -or- Something similar
  5. Figure out where CPAN is building your Compress::Stream::Zstd

    c:/Strawberry/cpan/build/Compress-Stream-Zstd-0.206-0
  6. Copy the Alien::zstd libzstd.a file to where Compress::Stream::Zstd expects it to be:

    $ copy c:/Strawberry/perl/site/lib/auto/share/dist/Alien-zstd/lib/libz +std.a c:/Strawberry/cpan/build/Compress-Stream-Zstd-0.206-0/ext/zstd/ +lib
  7. Go to the CPAN build directory for Compress::Stream::Zstd and finish building by hand:

    $ cd c:/Strawberry/cpan/build/Compress-Stream-Zstd-0.206-0 $ perl ./Build.PL $ ./Build $ ./Build test $ ./Build install
  8. That should complete successfully, and you are now done!

Replies are listed 'Best First'.
Re: SOLUTION: How to install Compress::Stream::Zstd in Strawberry Perl?
by swl (Prior) on Mar 08, 2025 at 06:25 UTC

    Good to see it works, and thanks for the set of steps.

    In the interests of TIMTOWTDI, steps 4-7 could be simplified using cpanm. Calling cpanm --look opens a shell in the build directory. On Windows it is a cmd chell.

    (Untested)

    cpanm --look Compress::Stream::Zstd :: You are now in the build dir :: This next line prints the location of the Alien::Zstd files, under +which will be libzstd.a perl -MAlien::Zstd -E"say Alien::Zstd->dist_dir" :: assuming it is in the dir you noted in your post the line would be copy c:/Strawberry/perl/site/lib/auto/share/dist/Alien-zstd/lib/libzst +d.a ext\zstd\lib :: (One could also use File::Copy to use perl to find and copy the fil +e in one step) :: build, test, install perl .\Build.PL && build && build test && build install :: back to your previous shell exit