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.

Pick the right download for your Mac The Chilkat module is a prebuilt native library, so the download must match your system on three points:
  • CPU architecture: arm64 for Apple Silicon (M-series), or x86_64 for Intel Macs.
  • Perl version: it must match the 5.xx of your Perl.
  • Threading: a threaded Perl needs the thread-multi download; a non-threaded Perl needs the regular download (see Step 3).
  1. Download

    Get the build for your Mac from the Chilkat macOS Perl Downloads.

  2. What's in the download

    The .tar.gz contains:

    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
  3. 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.

  4. Extract to any directory

    tar xzf chilkat-perl-<version>-<arch>-macosx.tar.gz
  5. 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.

  6. Install

    Still in the same directory:

    make install
    # or, if you need elevated permissions:
    sudo make install

    You need write permission to your Perl library directory — installing system-wide usually requires root.

  7. Test

    Run the included testChilkat.pl to 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.)


Multiple Perls? If you use Perl from brew, perlbrew, or the system, make sure you build, install, and run with the same one — confirm with which perl. Each may differ in version and threading.