Installing the Chilkat Perl Module on Linux & Alpine Linux

Step-by-step instructions for installing the Chilkat module on Linux (all architectures) and on Alpine Linux.

Pick the right download for your system The Chilkat module is a prebuilt native library, so the download must match your system on three points:
  • C library: use the Linux download on standard (glibc) distributions, and the Alpine download on Alpine Linux (musl). They are not interchangeable.
  • CPU architecture: x86_64, aarch64 (64-bit ARM), armv7l (32-bit ARM, e.g. Raspberry Pi 2/3), or x86.
  • 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 system from the Chilkat Linux Perl Downloads (Linux and Alpine are both listed there).

  2. What's in the download

    Each .tar.gz contains:

    chilkat-perl-<version>-<arch>-linux/
    ├─ lib/
    │   ├─ chilkat.pm              the Perl module
    │   └─ libchilkat.so           the compiled Chilkat library
    ├─ Makefile.PL                 build script (ExtUtils::MakeMaker)
    ├─ MANIFEST
    ├─ META.yml
    ├─ test.pl                     a short test / unlock example
    ├─ license.pdf
    ├─ pcre2-license.pdf
    ├─ quickjs-license.pdf
    └─ THIRD-PARTY-NOTICES.txt

    (The Alpine download has the same layout, with a musl-compatible libchilkat.so.)

  3. Match your Perl version, architecture, and threading

    Confirm the download matches your system. Check each with:

    # Perl version (must match the download's 5.xx)
    perl -version
    
    # CPU architecture (x86_64, aarch64, armv7l, ...)
    uname -m
    
    # Threaded Perl? "define" = use the thread-multi download
    perl -V:useithreads

    If useithreads='define', download the thread-multi build; if useithreads='undef', download the regular build. A mismatch is the usual cause of the PL_stack_base error (see below).

  4. Extract to any directory

    tar xzf chilkat-perl-<version>-<arch>-linux.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. Verify the installation

    Run the included test.pl, or this short script, which unlocks Chilkat in 30-day trial mode and prints the version:

    use chilkat();
    
    my $glob = new chilkat::CkGlobal();
    my $success = $glob->UnlockBundle("Anything for 30-day trial");
    if ($success != 1) {
        print $glob->lastErrorText() . "\n";
        exit;
    }
    
    print "Version: " . $glob->version() . "\n";

Notes for Alpine Linux

  • Use the Alpine download, which is built for musl libc. The standard Linux (glibc) build will not load on Alpine.
  • The build needs Perl and make. If they aren't present: apk add perl make (add perl-utils or perl-dev if ExtUtils::MakeMaker is missing).
  • The remaining steps (extract, build, install, verify) are identical to standard Linux.

Common error: undefined symbol: PL_stack_base

If you see an error like undefined symbol: PL_stack_base at … DynaLoader.pm when using Chilkat, it usually means the download's threading does not match your Perl (a non-thread module with a threaded Perl, or vice-versa). Re-check Step 3 and download the matching build.