Logo by Sockratease - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. January 17, 2018, 10:13:02 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2 3 ... 10   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: compiling Kalles Fraktaler with mingw  (Read 5668 times)
Description: success report
0 Members and 1 Guest are viewing this topic.
claude
Fractal Bachius
*
Posts: 563



WWW
« on: March 05, 2017, 12:58:26 PM »

I finally managed to cross-compile Kalles Fraktaler 2.9.3 with mingw64 on Linux (Debian Stretch).  I uploaded a git repository with my modifications here: https://code.mathr.co.uk/kalles-fraktaler-2

Unfortunately it's about 50% slower than the binary of 2.9.4 from the upstream site, at least in one benchmark (which was quite heavy on the reference computations, light on per-pixel iterations).

EDIT I made a simple page about this project with downloads of binaries and sources, and compilation instrucctions, benchmarks, etc: https://mathr.co.uk/kf/kf.html

« Last Edit: April 06, 2017, 01:33:53 PM by claude, Reason: update topic title » Logged
zebastian
Conqueror
*******
Posts: 121



« Reply #1 on: March 05, 2017, 02:05:59 PM »

hi claude,

well done! you may try to use
-msse2 -ffast-math
as additional cxx flags in the makefile: https://code.mathr.co.uk/kalles-fraktaler-2/blob/81653f04efbad9ff34f08d9af7dc721c55707cc5:/Makefile
These are more aggressive performance steps which will
- take longer to compile
- produce bigger binaries
- make the binary bound to the CPU you are running on
+ But the runtime will be much better.
When i am compiling Mandelbulber on my machine for rendering i use these flags to compile a "production" binary.
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #2 on: March 06, 2017, 12:37:44 AM »

Excellent achievement claude!  joy

I guess the hardest point was the CFixedFloat class, in which I heavily relied on MSVC perhaps non-standard non-strict overloaded functions?

I have some issues uploading the latest code, but will do as soon as the issues are solved smiley
Logged

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 http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #3 on: March 07, 2017, 12:08:56 PM »

I have uploaded the lastest code on http://www.chillheimer.de/kallesfraktaler/
Direct link: http://www.chillheimer.de/kallesfraktaler/fractal_src_2.11.1.zip
Logged

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 http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #4 on: March 07, 2017, 08:14:27 PM »

Major thanks for the updated code - lots of changes!

But there is a small problem, the sources for the ldbl64.dll are out of date, 2014 in my file listing, and the resulting compiled dll is incompatible with the main program...


Anyway, I've been hacking away, here's source:

https://code.mathr.co.uk/kalles-fraktaler-2

this branch tracks kalles source zips, no changes
https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/master

this branch makes kalles source compileable with mingw, plus some bug fixes
https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/claude
(the 2.11.1 zip commit is mislabeled as 2.9.3, oops)

this branch allows building with GMP mpf_t or MPFR mpfr_t instead of custom code - in my benchmarks mpf_t is faster at deeper zooms (e1000 or so), plus less code to maintain
https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/claude-gmp
(the 2.11.1 zip commit is mislabeled as 2.9.3, oops)
no instructions yet on how to install GMP for usage by mingw, possibly mightymandel has some relevant docs; also the C++ bindings from boost::multiprecision are needed, that can just be unpacked and symlinked so that the C++ #include find the right files..

here are some binaries (64bit, tested in wine on linux):

first version forked from 2.9.3, mostly working fine in my tests (just regular mandelbrot so far):
https://mathr.co.uk/mandelbrot/kf-2.9.3%2Bgmp.20170307.zip
https://mathr.co.uk/mandelbrot/kf-2.9.3%2Bgmp.20170307.zip.sig

second version forked from 2.11.1, crashes if long double is needed (workaround is to menu -> special -> use floatexp always), not tested as much:
https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170307.zip
https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170307.zip.sig

both binaries have corresponding tags in the git repository, so you can find out which sources were used

some crude timing results:

Code:
benchmarks              upstream exes   cross-mingw 2.9.3 fork  additional notes
                        2.9.4   2.11.1  custom  gmp     mpfr    zoom    delta type
evolution-of-trees.kfr  3:58.7  3:43.3  6:10.3  4:16.7  4:41.6  e227    double
Ssssssssss.kfr          7.537   8.363   9.041   6.605   6.731   e533    scaled double
e1000.kfr w/  dll       7.279   7.370   8.674   6.343   6.510   e1000   long double
e1000.kfr w/o dll       7.752   7.905   fail    6.737   6.782   e1000   floatexp
glitch33.kfr w/  dll    9.483   9.551   11.170  7.448   7.691   e1277   long double
glitch33.kfr w/o dll    10.112  10.185  fail    7.982   8.033   e1277   floatexp
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #5 on: March 07, 2017, 08:48:52 PM »

Thanks claude
Yes you are right it was an old version, sorry for that.
I have updated fractal_src_2.11.1.zip on the site, and if there is a cache problem, I uploaded it separately as well, http://www.chillheimer.de/kallesfraktaler/ldbl.cpp

Will your changes make it possible to compile the whole program in gcc now?
If so, no need to put ldbl in a separate dll, because the reason for that is that I compile ldbl with gcc.

Looks like some locations you tested are faster with gmp/mpfr!? smiley
Logged

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 http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #6 on: March 08, 2017, 05:10:27 PM »

Thanks claude
Yes you are right it was an old version, sorry for that.
I have updated fractal_src_2.11.1.zip on the site, and if there is a cache problem, I uploaded it separately as well, http://www.chillheimer.de/kallesfraktaler/ldbl.cpp

Will your changes make it possible to compile the whole program in gcc now?
If so, no need to put ldbl in a separate dll, because the reason for that is that I compile ldbl with gcc.

Looks like some locations you tested are faster with gmp/mpfr!? smiley

Thanks for the code.

Yes it can all be compiled with gcc now, so it could be merged without a separate dll.

I haven't got Windows to test compiling there, but mingw/msys might be able to do it with appropriate changes to the Makefile.

GMP and MPFR are faster at higher precisions, it seems.
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #7 on: March 08, 2017, 05:24:35 PM »

gmp/mpfr is explicitly vectorized, which shows the most noticeable performance boost with larger mantissas
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #8 on: March 13, 2017, 05:24:05 AM »

some small changes in my claude-gmp branch:

* fixed the crash at long double (which turned out to be a stack overflow) by increasing stack size to 64MB (from 32MB)
* long double code updated to kalles upstream
* compiled into one exe, no need for separate dll for long double any more
* no -msse2 (should be enabled by default on x86_64/amd64 anyway)
* no -march=native (not suitable for distributing binaries)
* does use -ffast-math, though I didn't benchmark its effect

fresh binary:
https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.zip
https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.zip.sig

additional benchmarks:
* Newton-Raphson zooming is significantly faster with GMP: zooming into center pixel of glitch33.kfr (e1277) calculates new location in 18 seconds as opposed to over 4 minutes with kf-2.11.1
* rendering is significantly faster with GMP at deep enough zooms: Dinkydau's hyperbolic tiling pistil location (e2293, 640x360) takes 3 hours with upstream kf-2.11.1, with GMP it takes 1 hour 18 minutes, plus an additional 10 minutes if compiled to use MPFR instead of GMP.

EDITED to add: there are some warnings that are concerning with respect to 64bit safety - it seems to work, but chances are some address space layout changes could make it explode?  I don't know what Microsoft Windows guarantees, but there exist functions like SetClassLongPtr which should be used instead of SetClassLong for pointers (which are 64bit on 64bit...).  Here's the warning dump:

Code:
fraktal_sft/listbox.cpp: In function ‘int SubclassListProc(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/listbox.cpp:14:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA);
                                                              ^
fraktal_sft/listbox.cpp:19:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA);
                                                              ^
fraktal_sft/listbox.cpp:24:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA);
                                                              ^
fraktal_sft/listbox.cpp:28:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam);
                                                              ^
fraktal_sft/listbox.cpp: In constructor ‘CListBox::CListBox(HWND, HWND, char*, int, COLORREF, COLORREF, BOOL)’:
fraktal_sft/listbox.cpp:108:44: warning: cast from ‘CListBox*’ to ‘LONG {aka long int}’ loses precision [-fpermissive]
  SetWindowLong(m_hwList,GWL_USERDATA,(LONG)this);
                                            ^~~~
fraktal_sft/listbox.cpp:109:43: warning: cast from ‘int (*)(HWND, UINT, WPARAM, LPARAM) {aka int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive]
  SetWindowLong(m_hwList,GWL_WNDPROC,(LONG)SubclassListProc);
                                           ^~~~~~~~~~~~~~~~
fraktal_sft/listbox.cpp: In constructor ‘CListBoxEdit::CListBoxEdit(HWND, HWND, HWND, HWND, HWND, HWND__**, int)’:
fraktal_sft/listbox.cpp:250:35: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   m_stEdits.AddInt((int)phwEdits[i]);
                                   ^
fraktal_sft/listbox.cpp: In member function ‘int CListBoxEdit::ProcessMessage(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/listbox.cpp:259:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1;
                                                      ^
fraktal_sft/listbox.cpp:265:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass));
                                         ^
fraktal_sft/listbox.cpp:267:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10);
                                              ^
fraktal_sft/listbox.cpp:269:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1);
                                            ^
fraktal_sft/listbox.cpp:284:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1;
                                                      ^
fraktal_sft/listbox.cpp:290:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass));
                                         ^
fraktal_sft/listbox.cpp:292:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10);
                                              ^
fraktal_sft/listbox.cpp:294:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1);
                                            ^
fraktal_sft/listbox.cpp:322:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass));
                                          ^
fraktal_sft/listbox.cpp:324:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       SendMessage((HWND)atoi(m_stEdits[i]),BM_SETCHECK,atoi(stT[0][i+1]),0);
                                          ^
fraktal_sft/listbox.cpp:326:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       SetWindowTextA((HWND)atoi(m_stEdits[i]),stT[0][i+1]);
                                             ^
fraktal_sft/main.cpp: In function ‘long int ShowProc(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/main.cpp:754:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,lParam,wParam);
                                                              ^
fraktal_sft/main.cpp: In function ‘int CustomZoomSize(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/main.cpp:3157:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    char *szTmp = (char*)GetWindowLong(hWnd,GWL_USERDATA);
                                                        ^
fraktal_sft/main.cpp: In function ‘int SkewProc(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/main.cpp:3455:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA);
                                                         ^
fraktal_sft/main.cpp:3666:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA);
                                                        ^
common/FolderBrowser.cpp: In function ‘int lpfnEdit(HWND, UINT, WPARAM, LPARAM)’:
common/FolderBrowser.cpp:66:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam);
                                                              ^
common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int)’:
common/FolderBrowser.cpp:102:40: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive]
  int nRet = (int)SHBrowseForFolderA(&bi);
                                        ^
common/FolderBrowser.cpp: In function ‘long int FilterProc(HWND, UINT, WPARAM, LPARAM)’:
common/FolderBrowser.cpp:114:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam);
                                                              ^
common/FolderBrowser.cpp: In function ‘int lpfnCallBack2(HWND, UINT, WPARAM, LPARAM)’:
common/FolderBrowser.cpp:132:41: warning: cast from ‘long int (*)(HWND, UINT, WPARAM, LPARAM) {aka long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive]
   SetWindowLong(hEdit,GWL_WNDPROC,(LONG)FilterProc);
                                         ^~~~~~~~~~
common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int, char*, char*, int)’:
common/FolderBrowser.cpp:160:39: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive]
  int nRet = (int)SHBrowseForFolder(&bi);
                                       ^
common/StringVector.cpp: In member function ‘char* CStringVektor::GetString(int, int*)’:
common/StringVector.cpp:439:29: warning: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
  return m_pszStrings[nIndex]?m_pszStrings[nIndex]:"";
         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
common/tooltip.cpp: In function ‘long int ToolTipProc(HWND, UINT, WPARAM, LPARAM)’:
common/tooltip.cpp:153:28: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   wsprintf(szTmp,"%d",(int)hw);
                            ^~
common/tooltip.cpp: In function ‘void CollectObjects(HWND, HWND, LPARAM)’:
common/tooltip.cpp:226:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwNext);
                                                    ^~~~~~
common/tooltip.cpp:227:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwParent);
                                                    ^~~~~~~~
common/tooltip.cpp: In function ‘void ExitToolTip(HWND)’:
common/tooltip.cpp:283:36: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   if(atoi(g_stWindows[i][1])==(int)hWnd)
                                    ^~~~
« Last Edit: March 13, 2017, 06:57:11 AM by claude, Reason: warnings » Logged
Dinkydau
Fractal Senior
******
Posts: 1616



WWW
« Reply #9 on: March 14, 2017, 02:06:11 AM »

Thanks for these great speedups. This will be useful.

I just noticed the coordinates are written in scientific notation. I assume that's something unintentional?
Logged

claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #10 on: March 14, 2017, 03:22:30 PM »

I just noticed the coordinates are written in scientific notation. I assume that's something unintentional?

Yes unintentional, just using the default string format of the underlying libraries - I'll see if it's an easy fix, but I don't think it will cause many problems?
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #11 on: March 14, 2017, 05:04:46 PM »

some small changes in my claude-gmp branch:

* fixed the crash at long double (which turned out to be a stack overflow) by increasing stack size to 64MB (from 32MB)
* long double code updated to kalles upstream
* compiled into one exe, no need for separate dll for long double any more
* no -msse2 (should be enabled by default on x86_64/amd64 anyway)
* no -march=native (not suitable for distributing binaries)
* does use -ffast-math, though I didn't benchmark its effect

fresh binary:
https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.zip
https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.zip.sig

additional benchmarks:
* Newton-Raphson zooming is significantly faster with GMP: zooming into center pixel of glitch33.kfr (e1277) calculates new location in 18 seconds as opposed to over 4 minutes with kf-2.11.1
* rendering is significantly faster with GMP at deep enough zooms: Dinkydau's hyperbolic tiling pistil location (e2293, 640x360) takes 3 hours with upstream kf-2.11.1, with GMP it takes 1 hour 18 minutes, plus an additional 10 minutes if compiled to use MPFR instead of GMP.

EDITED to add: there are some warnings that are concerning with respect to 64bit safety - it seems to work, but chances are some address space layout changes could make it explode?  I don't know what Microsoft Windows guarantees, but there exist functions like SetClassLongPtr which should be used instead of SetClassLong for pointers (which are 64bit on 64bit...).  Here's the warning dump:

Code:
fraktal_sft/listbox.cpp: In function ‘int SubclassListProc(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/listbox.cpp:14:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA);
                                                              ^
fraktal_sft/listbox.cpp:19:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA);
                                                              ^
fraktal_sft/listbox.cpp:24:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA);
                                                              ^
fraktal_sft/listbox.cpp:28:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam);
                                                              ^
fraktal_sft/listbox.cpp: In constructor ‘CListBox::CListBox(HWND, HWND, char*, int, COLORREF, COLORREF, BOOL)’:
fraktal_sft/listbox.cpp:108:44: warning: cast from ‘CListBox*’ to ‘LONG {aka long int}’ loses precision [-fpermissive]
  SetWindowLong(m_hwList,GWL_USERDATA,(LONG)this);
                                            ^~~~
fraktal_sft/listbox.cpp:109:43: warning: cast from ‘int (*)(HWND, UINT, WPARAM, LPARAM) {aka int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive]
  SetWindowLong(m_hwList,GWL_WNDPROC,(LONG)SubclassListProc);
                                           ^~~~~~~~~~~~~~~~
fraktal_sft/listbox.cpp: In constructor ‘CListBoxEdit::CListBoxEdit(HWND, HWND, HWND, HWND, HWND, HWND__**, int)’:
fraktal_sft/listbox.cpp:250:35: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   m_stEdits.AddInt((int)phwEdits[i]);
                                   ^
fraktal_sft/listbox.cpp: In member function ‘int CListBoxEdit::ProcessMessage(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/listbox.cpp:259:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1;
                                                      ^
fraktal_sft/listbox.cpp:265:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass));
                                         ^
fraktal_sft/listbox.cpp:267:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10);
                                              ^
fraktal_sft/listbox.cpp:269:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1);
                                            ^
fraktal_sft/listbox.cpp:284:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1;
                                                      ^
fraktal_sft/listbox.cpp:290:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass));
                                         ^
fraktal_sft/listbox.cpp:292:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10);
                                              ^
fraktal_sft/listbox.cpp:294:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1);
                                            ^
fraktal_sft/listbox.cpp:322:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass));
                                          ^
fraktal_sft/listbox.cpp:324:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       SendMessage((HWND)atoi(m_stEdits[i]),BM_SETCHECK,atoi(stT[0][i+1]),0);
                                          ^
fraktal_sft/listbox.cpp:326:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       SetWindowTextA((HWND)atoi(m_stEdits[i]),stT[0][i+1]);
                                             ^
fraktal_sft/main.cpp: In function ‘long int ShowProc(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/main.cpp:754:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,lParam,wParam);
                                                              ^
fraktal_sft/main.cpp: In function ‘int CustomZoomSize(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/main.cpp:3157:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    char *szTmp = (char*)GetWindowLong(hWnd,GWL_USERDATA);
                                                        ^
fraktal_sft/main.cpp: In function ‘int SkewProc(HWND, UINT, WPARAM, LPARAM)’:
fraktal_sft/main.cpp:3455:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA);
                                                         ^
fraktal_sft/main.cpp:3666:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA);
                                                        ^
common/FolderBrowser.cpp: In function ‘int lpfnEdit(HWND, UINT, WPARAM, LPARAM)’:
common/FolderBrowser.cpp:66:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam);
                                                              ^
common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int)’:
common/FolderBrowser.cpp:102:40: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive]
  int nRet = (int)SHBrowseForFolderA(&bi);
                                        ^
common/FolderBrowser.cpp: In function ‘long int FilterProc(HWND, UINT, WPARAM, LPARAM)’:
common/FolderBrowser.cpp:114:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam);
                                                              ^
common/FolderBrowser.cpp: In function ‘int lpfnCallBack2(HWND, UINT, WPARAM, LPARAM)’:
common/FolderBrowser.cpp:132:41: warning: cast from ‘long int (*)(HWND, UINT, WPARAM, LPARAM) {aka long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive]
   SetWindowLong(hEdit,GWL_WNDPROC,(LONG)FilterProc);
                                         ^~~~~~~~~~
common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int, char*, char*, int)’:
common/FolderBrowser.cpp:160:39: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive]
  int nRet = (int)SHBrowseForFolder(&bi);
                                       ^
common/StringVector.cpp: In member function ‘char* CStringVektor::GetString(int, int*)’:
common/StringVector.cpp:439:29: warning: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
  return m_pszStrings[nIndex]?m_pszStrings[nIndex]:"";
         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
common/tooltip.cpp: In function ‘long int ToolTipProc(HWND, UINT, WPARAM, LPARAM)’:
common/tooltip.cpp:153:28: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   wsprintf(szTmp,"%d",(int)hw);
                            ^~
common/tooltip.cpp: In function ‘void CollectObjects(HWND, HWND, LPARAM)’:
common/tooltip.cpp:226:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwNext);
                                                    ^~~~~~
common/tooltip.cpp:227:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwParent);
                                                    ^~~~~~~~
common/tooltip.cpp: In function ‘void ExitToolTip(HWND)’:
common/tooltip.cpp:283:36: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive]
   if(atoi(g_stWindows[i][1])==(int)hWnd)
                                    ^~~~

Very cool indeed, thanks a lot.
I don't recall these warnings occur when compiling in VS.

What is the difference between MPFR and GMP?
GMP seems preferable if it is faster smiley
Logged

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 http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #12 on: March 14, 2017, 06:55:19 PM »

What is the difference between MPFR and GMP?
GMP seems preferable if it is faster smiley

MPFR is correctly-rounded to the desired precision, supports infinity and NaN, and has many special functions (trigonometry etc).  GMP's mpf_t floating point is quick and dirty, with only bare minimum of operations and only approximate precision.
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #13 on: March 16, 2017, 12:55:11 PM »

It seems the reference is calculated faster in KF CFixedFloat class up to e300, then GMP is faster, and there is a very big difference at e10000.
Perhaps GMP are using other method than simple school-book multiplication on high precision?
Logged

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 http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #14 on: March 16, 2017, 01:35:17 PM »

Perhaps GMP are using other method than simple school-book multiplication on high precision?
Yep, see: https://gmplib.org/manual/Multiplication-Algorithms.html
Logged
Pages: [1] 2 3 ... 10   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Kalles Fraktaler 2.7.4 available Kalles Fraktaler Kalles Fraktaler 10 806 Last post November 30, 2014, 01:40:48 PM
by ratcat65
Kalles Fraktaler 2.7.6 available Kalles Fraktaler Kalles Fraktaler 14 2399 Last post December 15, 2014, 03:15:31 AM
by quaz0r
Kalles Fraktaler 2.7.7 available Kalles Fraktaler Kalles Fraktaler 7 1015 Last post January 23, 2015, 12:39:28 PM
by Chillheimer
compiling Kalles Fraktaler 2.7.3 on Linux with mingw Kalles Fraktaler « 1 2 » claude 24 1534 Last post December 31, 2014, 12:42:33 PM
by Kalles Fraktaler
compiling Kalles Fraktaler with GCC Kalles Fraktaler 3dickulus 0 464 Last post January 03, 2015, 09:13:24 PM
by 3dickulus

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.258 seconds with 29 queries. (Pretty URLs adds 0.019s, 2q)