Installing Compress::Zstd on FreeBSD

This page discusses how to install the Perl module Compress::Zstd on the FreeBSD operating system. Compress::Zstd implements Facebook's new Zstandard fast real-time compression algorithm. Unfortunately, as can be seen at CPAN testers, it won't install on FreeBSD without a little extra effort due to BSD make and Gnu make incompatibilities.

Obtain the module from CPAN using a command of the form

$ wget

Untar the files and run the Build.PL script.

$ tar xfz Compress-Zstd-0.02.tar.gz 
$ cd Compress-Zstd-0.02
$ perl Build.PL 

Now, before running ./Build, change directory to ext/zstd and run gmake (not make). Then change directory to ext/zstd/lib, and run gmake again.

$ cd ext/zstd
$ gmake
$ cd lib
$ gmake

Then change directory back to the top directory, Compress-Zstd-0.02 in this case, and run ./Build.

$ cd ../../..
$ ./Build
$ ./Build install

The module should then be installed without any further complications.

Web links

Copyright © Ben Bullock 2009-2023. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( or use the discussion group at Google Groups. / Privacy / Disclaimer