Kalles Fraktaler 2 + GMP

As the orginal upstream author Karl Runmo says:

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler!

I (Claude Heiland-Allen) forked the code and swapped out the custom arbitrary precision floating point code for the highly optimized GMP library, making it even faster.

Binary downloads

Binary downloads for Windows 64bit (they also work in WINE on Linux, where I do my coding):

Legal note: these binaries are statically linked with GMP, which is under dual LGPLv3 / GPLv2 license. If you redistribute the binaries you must also be prepared to distribute the source corresponding to those binaries to anyone you distribute the binary to. To make this easier for you, the more recent zips include the source too (though you'll also need to get the Boost and GMP sources). And of course insert here the usual legal disclaimers about no warranty of any kind.

Source code repository

The source code is available from my git repository:

git clone https://code.mathr.co.uk/kalles-fraktaler-2.git
cd kalles-fraktaler-2
git checkout master       # for Karl's original upstream
git checkout claude       # for MINGW build system and minor bug fixes
git checkout claude-gmp   # for the full GMP fork
git checkout formulas     # for the full GMP fork with formula XML and OpenCL experimentation
git tag -l                # list available release tags

Compiling on Windows with MSYS2

(out of date) Build instructions for compiling on Windows (thanks to knighty!):

  1. remove any old msys2.
  2. Downloaded latest version of msys2 (msys2​-x86_64​-20161025​.exe). This is the 64 bit version. msys2​-i686​-20161025​.exe is the 32 bit version.
  3. after running it, it installs msys2. At the end the msys2 shell is launched.
  4. In the msys2 shell, invoke pacman:
    pacman -Syuu
    This have to be done until is says there is nothing to do anymore.
  5. close the msys2 shell:
  6. reopen msys2 shell (from startup menu).
  7. Install mingw/gcc 64 bit:
    pacman -S mingw-w64-x86_64-toolchain
    (one can also install 32 bit version by: pacman -S mingw-w64-i686-toolchain)
  8. Install Boost
    pacman -S mingw-w64-x86_64-boost
    from msys shell
  9. close msys2 shell then open "msys2 mingw 64 bit" shell (in order to have all the environment variables properly set)
  10. change directory to the kalles fraktaler sources (where Makefile resides).
  11. compile
    mingw32-make WINDRES=windres
    (if this doesn't work edit the Makefile to replace the line
    WINDRES ?= x86_64-w64-mingw32-windres
    WINDRES ?= windres
    and run mingw32-make without arguments)
  12. execute it this way from (msys2 mingw 64 bit) command line:
    ./fraktal_sft64    # for the claude branch
    ./kf.exe           # for the claude-gmp branch
    because it is linked dynamically to some libraries. In order to execute it from the explorer one needs to copy libgmp-10.dll and libwinpthread-1.dll from msys64/mingw64/bin next to the generated executable.

You also need xsltproc to build the formulas branch.

Cross-compiling on GNU/Linux with MINGW64

(out of date) Build instructions for cross-compiling from GNU/Linux require about 3.5GB of disk space and good internet download speed (or patience). About 410MB of downloads after the chroot debootstrap step. If you have recent Debian you can skip the chroot step and install natively.

  1. Setup Debian Stretch chroot:
    mkdir ./vm
    sudo debootstrap stretch ./vm/
    sudo mount proc ./vm/proc -t proc
    sudo mount sysfs ./vm/sys -t sysfs
    sudo cp /etc/hosts ./vm/etc/hosts
    sudo chroot ./vm /bin/bash
  2. Install dependencies (inside the chroot if you made one):
    apt-get install \
      build-essential \
      cabal-install \
      ghc \
      git \
      libtool \
      lzip \
      m4 \
      mingw-w64 \
      p7zip \
      wine64 \
      wine-binfmt \
      xsltproc \
  3. Prepare non-root build user:
    adduser build
    # enter and confirm password
    su - build
    mkdir -p ~/win64/src
  4. Download sources: visit boost.org and download the latest 7z archive to ./vm/home/build/win64/src/, then download the latest GMP (which is at time of writing version 6.1.2) and clone kf git sources:
    cd ~/win64/src
    wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz
    git clone https://code.mathr.co.uk/kalles-fraktaler-2.git
    Internet access is no longer required after this step.
  5. Build GMP
    cd ~/win64/src
    tar xf gmp-6.1.2.tar.lz
    cd gmp-6.1.2
    ./configure --host=x86_64-w64-mingw32 --prefix=$HOME/win64
    make -j 8
    make install
    make check
  6. Prepare Boost headers:
    cd ~/win64/src
    7zr x boost*.7z
    cd ~/win64/include
    ln -s ../src/boost*/boost/
  7. Finally, build Kalles Fraktaler 2 + GMP
    cd ~/win64/src
    cd kalles-fraktaler-2
    git checkout claude-gmp
    make -j 8
    ./kf.exe  # test to see if it works
  8. To cut a release bundle, use the script:
    export VERSION=2.whatever
    git tag -s kf-${VERSION}
    ./release.sh ${VERSION}


WINE Benchmarks

 upstream2.11.1​+gmpadditional notes type
evol​ution-of-trees.kfr 3m43.3 3m58.9 2m26.7 e227 double
Sssss​sssss.kfr 8.363 6.403 5.414 e533 scaled double
e1000.kfr w/ dll 7.370 1.289 0.752 e1000 long double
e1000.kfr w/o dll 7.905 2.480 1.116 e1000 floatexp
glitch33.kfr w/ dll 9.551 1.580 0.940 e1277 long double
glitch33.kfr w/o dll 10.185 2.626 1.431 e1277 floatexp
htile​-pistil.kfr w/ dll 3h01 27m10 18m24 e2293 long double
N/R zoom (glitch33.kfr) 4m18 0m17 2.337 N/R zoom center pixel
N/R zoom (newton-e3198.kfr) 11h40m30 12m53 3m20 N/R zoom center pixel

Windows Benchmarks

TODO, perhaps you want to send me some...

(back to top)