411 REFERENCE · Wikibooks
Fractals/mightymandel
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
mightymandel is Mandelbrot set explorer made by Claude Heiland-Allen. Here one can find unofficial docs about it
Features
draws parameter plane of complex quadratic polynomial with boundary of Mandelbrot set
License GPL3+ License GPL3+
perturbation techniquePerturbation glitches with series approximation.
GPGPUGeneral-purpose computing on graphics processing units in wikipedia based on OpenGL 4 ( "my GPU is much faster than my CPU ")
writen in C ( C99) with full src code availableGit repository
multiprecision
Plane description
Claude Heiland-Allen[4] uses center and radius for the description of parameter plane.
Radius is defined as "the difference in imaginary coordinate between the center and the top of the axis-aligned view rectangle".
So plane is described by 3 numbers:
center_re
center_im
radius
where center = center_re + center_im * i
Installation
Requirements
opengl for GPGPU
version 4.1 (supports 3.3 as fallback without perturbation, limiting zoom depth dramatically)
libraries : gl, glew,The OpenGL Extension Wrangler Library glfw3,OpenGl in C
multiprecision ( library MPFRThe GNU MPFR Library)
rt librt library
programs:
gcc
make
bash
sed
git
pkg-config
ts ( for test suite, see /src/test.sh ) Use in Ubunty : sudo apt-get install moreutils
doxygen ( for doc)
for video :
AVConv - Automatic video converter
FFmpeg
One can check it with ldd :
ldd -d -v ./src/mightymandel
or look at /src/Makefile :
-lGLEW -lGL -lrt -lmpfr -lm
Debian packages
On Debian Jessie, this suffices to install everything you need to compile:README for mightymandel
sudo aptitude install \
build-essential \
git \
libglew-dev \
libglfw3-dev \
libmpfr-dev \
pkg-config
Getting the source
First time :
git clone https://gitorious.org/maximus/mightymandel.git
To update src run ( from program directory):
git pull
Then one can build the program.
Remote repository
git remote show origin
the result :
* remote origin
Fetch URL: https://gitorious.org/maximus/mightymandel.git
Push URL: https://gitorious.org/maximus/mightymandel.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (fast-forwardable)
Version
git describe
Example output :
v14-164-g9cd6fc7
Building
Got to the mightymandel directory :
cd ~/mightymandel
and make :
make -C src clean
make -C src
or, in case of problems :Fractal Forum - mightymandel
make -C src EXTRA_LINK_FLAGS="-lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi"
or edit Makefile and add extra flags, but then you will have problems after updating source.
One can also build and run test suite
Errors
glfw
Package glfw3 was not found in the pkg-config search path.
Download and install glfw:and Ubuntu
cd glfw-3.0.4
hash -r
cmake -G "Unix Makefiles"
make
sudo make install
Ubuntu 14.10 ( utopic ) has packages for glfw3Package: glfw3 (3.0.4-1) [universe] ( but CUDA packages are only for LTS version of Ubuntu , it is now 13.04)
Next error :
LINK mightymandel
/usr/bin/ld: /usr/local/lib/libglfw3.a(x11_clipboard.c.o): undefined reference to symbol 'XConvertSelection'
/usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
add to makefile ( on Ubuntu 13.10 64-bit) :
-lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi \
check
file ./mightymandel
./mightymandel: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x2a424b6dcad8de5e29e3f0b17524dbf34de18aaa, not stripped
Running
Go to the program directory and :
./src/mightymandel
Version
./src/mightymandel—version
example result :
v16-10-gd079448+2015-01-20-16-40-55
Examples
mm
One can run ( from program directory) example parameter file fp32.mm using :
./src/mightymandel ./examples/mm/fp32.mm
par
Now mightymandel does not load native fractint par files. They need to be transformed to ppar files.
How to preprocess Fractint par file ?
Split txt file ( with parameters for many images ) into single image files ( with 7 lines of original file)
splite line with many parameters into lines with one parameter per line ( replace space into newline)
add ppar extension :how-to-add-an-extension-to-all-files-via-terminal
remove all par files without :
"type=mandel" ( mightymandel can draw only mandelbrot set )
"corners=" or "center-mag="
#!/usr/bin/env bash
# chmod +x s.sh
# ./s.sh
for f in *.txt;
do
echo " found "$f " file ";
#split -l 7 $f;
awk '/{/{n++}{print > n".p" }' $f
echo $f "- split when { is found and add p extension " ;
rm $f;
echo " input file " $f " is removed " ;
done
for f in *.p;
do
echo " in "$f " file replace space with newline and add ppar extension"
# tr '{}' '()' < infile > outfile
tr ' ' '\n' < $f >$f"par"
rm $f;
done
for f in *.ppar;
do
echo "remove blank= empty lines"
sed -i '/^$/d' $f
done
Comment : "pre-processing script removes the input without asking, which is a bit rude! And it doesn't support merging lines ending in \ " Claude
Here is split2ppar.sh by Claude
#!/bin/bash
tmp="$(mktemp -d --tmpdir=. split2ppar.XXXXXXXX)"
for file in "${@}"
do
name="$(basename "${file}")"
file="$(readlink -e "${file}")"
pushd "${tmp}"
awk "/{/{n++}{print > \"${name}_\"n\".par\" }" "${file}"
popd
done
pushd "${tmp}"
for file in *.par
do
ident="$(head -n 1 "${file}" | sed 's/ .*$//')"
mv "${file}" "${ident}.par" # rename input
cat < "${ident}.par" | # read input
sed 's/;.*$//' | # delete ; comments
tr '\n' ' ' | # join on one line with spaces
sed 's/\\ *//g' | # merge lines ended with '\'
tr -s ' ' | # compress multiple ' ' to single ' '
sed 's/^.*{\([^}]*\)}.*$/\1/' | # extract the part between { }
tr ' ' '\n' | # split into separate lines
cat > "${ident}.ppar" # write output
done
popd
ls "${tmp}/"*
ppar
Preprocessed par files are in /examples/ppar directory. Use :
./src/mightymandel ./examples/ppar/1_02.ppar
test
One can run test suite :
make -C src test EXTRA_LINK_FLAGS="-lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi"
Example output :
real 56m25.351s
user 33m50.995s
sys 21m38.976s
See also :
content of csv file int test directory
images in test directory
Benchmark
See file BENCHMARKS in program directory for more details
Check hardware
type and version of the Central processing unit ( CPU ) CPU in wikipedia)
type and version of the graphics processing unit ( GPU )GPU in wiki[edia
version of the video cardVideo card in wiki device driverDevice driver in wikipedia ( DRV ) and which version of OpenGlOpenGl in wikipedia it supports
Example output :
cat /proc/cpuinfo | grep model\ name
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 770] (rev a1)
glxinfo | grep OpenGL\ version
OpenGL version string: 4.3.0 NVIDIA 319.32
Run benchmark
time ./src/mightymandel --verbose warn --one-shot --de --weight -1.5 --glitch --size "1280x720" examples/mm/fp32-large-minibrot.mm
fp32-large-minibrot.mm,ok,fp32,322.402263,85.265842,14.734158,,
real 0m0.643s
user 0m0.188s
sys 0m0.236s
Images
Galleries :
in commons there is a category : :commons:Category:Fractals created with Mightymandel
official online doc galleryonline official doc gallery
comment
To extract comment from ppm file :stackexchange question : How to extract comment from ppm file?
identify -format "%c" 1.ppm
or
head -n 2 1.ppm | tail -n 1
example output :
mightymandel -1.8605739600158748e+00 + -9.3437424499999996e-07 i @ 3.5884749956982262e-09
and from png file :
extract k2000.png
colors
white = exterior of Mandelbrot set
black = boundary of Mandebot set ( using DEM )
red = glitches
yellow yellow = RGB(255,178,0) = known interior of Mandelbrot set
blue = uncalculated
Documentation
official onlineofficial online doc
How to make offline doc with doxygen ?
How to contribute ?
git checkout master
git pull # get up to date
git checkout -b new-feature-42 # create a branch for your new feature
# make your changes, check that they compile and run ok
git add your-changed-files
git commit # write a description of your changes
git format-patch master # save your changes to file(s)
If path file was not created try :
git format-patch origin/master # https://eothred.wordpress.com/2011/07/02/git-and-patches/
then email the .patch files to Claude
References
Category:OpenGL Programming