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 tag -l                # list available release tags

Compiling on Windows with MSYS2

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:
    exit
  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
    to
    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.

Cross-compiling on GNU/Linux with MINGW64

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
    cd
  2. Install dependencies (inside the chroot if you made one):
    apt-get install \
      build-essential \
      git \
      libtool \
      lzip \
      m4 \
      mingw-w64 \
      p7zip \
      wine64 \
      wine-binfmt \
      zip
  3. Prepare non-root build user:
    adduser build
    # enter and confirm password
    su - build
    export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO
    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}

Benchmarks

WINE Benchmarks

 upstreamcross-mingw
2.11.1​+gmp
.20170508
additional notes
2.9.42.11.1zoomdelta type
evol​ution-of-trees.kfr 3m58.7 3m43.3 3m58.9 e227 double
Sssss​sssss.kfr 7.537 8.363 6.403 e533 scaled double
e1000.kfr w/ dll 7.279 7.370 1.289 e1000 long double
e1000.kfr w/o dll 7.752 7.905 2.480 e1000 floatexp
glitch33.kfr w/ dll 9.483 9.551 1.580 e1277 long double
glitch33.kfr w/o dll 10.112 10.185 2.626 e1277 floatexp
htile​-pistil.kfr w/ dll 3h04 3h01 27m10 e2293 long double
N/R zoom (glitch33.kfr) - 4m18 0m17 N/R zoom center pixel

Windows Benchmarks

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


(back to top)