Installing the Chilkat Perl Module on macOS
Step-by-step instructions for installing the Chilkat module on macOS, for both Apple Silicon and Intel Macs.
- CPU architecture:
arm64for Apple Silicon (M-series), orx86_64for Intel Macs. - Perl version: it must match the
5.xxof your Perl. - Threading: a threaded Perl needs the thread-multi download; a non-threaded Perl needs the regular download (see Step 3).
-
Download
Get the build for your Mac from the Chilkat macOS Perl Downloads.
-
What's in the download
The
.tar.gzcontains:chilkat-perl-<version>-<arch>-macosx/ ├─ lib/ │ ├─ chilkat.pm the Perl module │ └─ libchilkat.dylib the compiled Chilkat library ├─ Makefile.PL build script (ExtUtils::MakeMaker) ├─ MANIFEST ├─ META.yml ├─ testChilkat.pl a test script ├─ license.pdf ├─ pcre2-license.pdf ├─ quickjs-license.pdf └─ THIRD-PARTY-NOTICES.txt
-
Match your architecture, Perl version, and threading
Confirm the download matches your system:
# CPU architecture (arm64 = Apple Silicon, x86_64 = Intel) uname -m # Perl version (must match the download's 5.xx) perl -version # Threaded Perl? "define" = use the thread-multi download perl -V:useithreads
If
useithreads='define', download the thread-multi build; otherwise download the regular build. See Thread-Multi or Non-Threaded? for details. -
Extract to any directory
tar xzf chilkat-perl-<version>-<arch>-macosx.tar.gz
-
Build
In the newly-created directory:
perl Makefile.PL make
The library is prebuilt, so this only generates and runs a Makefile that stages the files — there is no C compilation of Chilkat itself.
-
Install
Still in the same directory:
make install # or, if you need elevated permissions: sudo make installYou need write permission to your Perl library directory — installing system-wide usually requires root.
-
Test
Run the included
testChilkat.plto confirm the module loads:perl testChilkat.pl
It creates several Chilkat objects and prints the version of each:
use chilkat(); my $zip = new chilkat::CkZip(); print $zip->version() . "\r\n"; my $http = new chilkat::CkHttp(); print $http->version() . "\r\n"; # ... (the script creates several more Chilkat objects)
If it prints the Chilkat version, the module is installed correctly.
macOS Gatekeeper: “libchilkat.dylib cannot be opened”
Because the downloaded .dylib arrives with a quarantine attribute, macOS
Gatekeeper may block it with a message such as “libchilkat.dylib” cannot be
opened because the developer cannot be verified. Remove the quarantine attribute from
the extracted folder:
xattr -dr com.apple.quarantine chilkat-perl-<version>-<arch>-macosx
Then build and install as above. (You can also clear it from just the library:
xattr -d com.apple.quarantine lib/libchilkat.dylib.)
which perl. Each may
differ in version and threading.