0.63.05 failing to build under windows

Question and answers on how to build Synfig. We encourage you to document your findings on the build instructions page of the website
User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

0.63.05 failing to build under windows

Postby pixelgeek » Sat Apr 14, 2012 7:26 pm

Hi Genete,
Synfig core is building OK, but it doesn't seem to be able to render the splash screen, crashing instead. If I run it from the command line, it looks like I'm running into stack issues.

Code: Select all

C:\msys\1.0\home\cnorman\synfig\build\synfig-studio\win32build\images>c:\msys\1.
0\home\cnorman\synfig\temp\synfig-devel\bin\synfig.exe --version
synfig 0.63.05

C:\msys\1.0\home\cnorman\synfig\build\synfig-studio\win32build\images>c:\msys\1.
0\home\cnorman\synfig\temp\synfig-devel\bin\synfig.exe -q ..\..\images\splash_sc
reen-0.63.05.sif -o splash_screen.png --time 0
synfig(2808) [10:45:10 PM] info: Loading modules from C:/msys/1.0/home/cnorman/s
ynfig/temp/synfig-devel/etc/synfig_modules.cfg
      0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x0, BaseAddress 0x68540000, RegionSize 0x80000, State 0x10000
c:\msys\1.0\home\cnorman\synfig\temp\synfig-devel\bin\synfig.exe: *** Couldn't r
eserve space for cygwin's heap, Win32 error 6

C:\msys\1.0\home\cnorman\synfig\build\synfig-studio\win32build\images>


Any ideas?

Chris

User avatar
Genete
Site Admin
Posts: 4871
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: 0.63.05 failing to build under windows

Postby Genete » Sun Apr 15, 2012 4:47 am

It is possible that you didn't fully rebuild synfig-core and there are mixed libraries?
Did you rebuild ETL too? It has upgraded.
Other sifz files show the same? Try pirates.sifz our beast crasher file.
Other than that I just can suggest clean all the .dll and other configuration files created and start it over.
Maybe change the build installation path to other place on the build script.

Alternatively, can you rewind to 0.63.04 and try to rebuild. Is it possible to try to rebuild on intermediate commits to see which is the one which is causing the bad synfig-core?

Good Luck!
-G
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D

User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

Re: 0.63.05 failing to build under windows

Postby pixelgeek » Sun Apr 15, 2012 9:15 pm

This was a clean build. I'm regressing back to earlier versions to see if I can find out where it broke.
I have another idea I can try when I find out where that is...

Maybe it's time to bite the bullet and figure out what it will take to move to MS VC.

Chris

User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

Re: 0.63.05 failing to build under windows

Postby pixelgeek » Sun Apr 15, 2012 10:47 pm

0.63.04 still builds. Moving forwards to tag 'genete key events'

I don't know if it's relevant, but on 0.63.05, every time vector.h is included, I see

Code: Select all

> ../../../src/synfig/vector.h:56:1: warning: "isnan" redefined
> ../../../src/synfig/vector.h:42:1: warning: this is the location of the previous definition


Looks like the fix for Mac is being applied under Win32 too.

User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

Re: 0.63.05 failing to build under windows

Postby pixelgeek » Mon Apr 16, 2012 12:10 am

tag 'genete key events' works. Now checking tag 'eldruin clang fixes'

User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

Re: 0.63.05 failing to build under windows

Postby pixelgeek » Mon Apr 16, 2012 12:59 am

tag 'eldruin clang fixes' works too. Bedtime.

User avatar
Genete
Site Admin
Posts: 4871
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: 0.63.05 failing to build under windows

Postby Genete » Mon Apr 16, 2012 2:55 am

pixelgeek wrote:tag 'eldruin clang fixes' works too. Bedtime.

This is the branch that touches the vector.h file for clang fixes.
In any case the re definition is clear.

Code: Select all

  38 #ifdef WIN32
  39 #include <float.h>
  40 #ifndef isnan
  41 extern "C" { int _isnan(double x); }
  42 #define isnan _isnan
  43 #endif
  44 #endif
  45
  46 // For some reason isnan() isn't working on macosx any more.
  47 // This is a quick fix.
  48 #if defined(__APPLE__) && !defined(SYNFIG_ISNAN_FIX)
  49 #ifdef isnan
  50 #undef isnan
  51 #endif
  52 inline bool isnan(double x) { return x != x; }
  53 inline bool isnan(float x) { return x != x; }
  54 #define SYNFIG_ISNAN_FIX 1
  55 #else
  56 #define isnan std::isnan
  57 #endif


This code is included in color.h too. When one of them is included first then the second redefines isnan for Windows because SYNFIG_ISNAN_FIX is already defined and so it enters the else condition at line 55 which redefine isnan in any platform.

This must be changed by a nested definition like this (or similar):

Code: Select all

#ifdef WIN32
    #include <float.h>
    #ifndef isnan
        extern "C" { int _isnan(double x); }
        #define isnan _isnan
    #endif
#else
    // For some reason isnan() isn't working on macosx any more.
    // This is a quick fix.
    #if defined(__APPLE__) && !defined(SYNFIG_ISNAN_FIX)
        #ifdef isnan
            #undef isnan
        #endif
    inline bool isnan(double x) { return x != x; }
    inline bool isnan(float x) { return x != x; }
    #define SYNFIG_ISNAN_FIX 1
    #else
        #define isnan std::isnan
    #endif
#endif
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D

Zelgadis
Site Admin
Posts: 958
Joined: Thu Jan 10, 2008 2:16 am
Location: Russia
Contact:

Re: 0.63.05 failing to build under windows

Postby Zelgadis » Mon Apr 16, 2012 3:54 am

pixelgeek wrote:Maybe it's time to bite the bullet and figure out what it will take to move to MS VC.

In my opinion moving to MS VC looks like a really bad idea, as it might be even less compatible ==> more issues.
If I'm not mistaken, mingw gcc is more compatible with linux gcc than MS VC...
Morevna project:
Recently completed tasks: Demo released
Top priority tasks: Synfig Development, Website reorganization

User avatar
eldruin
Posts: 87
Joined: Tue Feb 16, 2010 11:08 pm
Location: Germany
Contact:

Re: 0.63.05 failing to build under windows

Postby eldruin » Mon Apr 16, 2012 11:11 am

I'm sorry, I introduced the bug when applying htodd patches. I didn't noticed, and compiling in Linux didn't bring up the issue.
My apologies.

I started trying the CMake building sytem transition yesterday and so far I'm able to compile libsynfig, synfig-tool and some modules but I'll need some time to support everything our current building system does.
I hope, after this the multi-platform compilation will go somewhat better so we can check every platform beforehand.
Wish me luck!

User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

Re: 0.63.05 failing to build under windows

Postby pixelgeek » Wed Apr 18, 2012 12:50 am

'eldruin master' works too.

User avatar
pixelgeek
Site Admin
Posts: 988
Joined: Sat Dec 01, 2007 7:23 pm
Location: West Coast USA

Re: 0.63.05 failing to build under windows

Postby pixelgeek » Mon Apr 30, 2012 12:02 am

Well, the good news is that I have a working build of 0.63.05. The bad news is that I had to build it by hand.

The build was failing because when trying to build 0.63.05 splash screen under msys, there's a stack overflow. I got round it by reverting back to the 0.63.04 splash, manually tweaking the version number, and substituting it. Synfig can render that when running under msys just fine. There's something about the new feature of outline grow that causes synfig to trigger a stack overflow in msys.

Code: Select all

Compare: (<)C:\msys\1.0\home\cnorman\synfig\build\synfig-studio\images\splash_screen-0.63.05bad.sif (173079 bytes)
   with: (>)C:\msys\1.0\home\cnorman\synfig\build\synfig-studio\images\splash_screen-0.63.05good.sif (172233 bytes)

1359,1361d1359
<           <param name="outline_grow">
<             <real value="0.0000000000"/>
<           </param>
2356,2358d2353
<           <param name="outline_grow">
<             <real value="0.0000000000"/>
<           </param>
3353,3355d3347
<           <param name="outline_grow">
<             <real value="0.0000000000"/>
<           </param>
4350,4352d4341
<           <param name="outline_grow">
<             <real value="0.0000000000"/>
<           </param>
4371,4373d4359
<     <param name="outline_grow">
<       <real value="0.0000000000"/>
<     </param>
4407,4409d4392
<     <param name="outline_grow">
<       <real value="0.0000000000"/>
<     </param>
4655,4657d4637
<                 <param name="outline_grow">
<                   <real value="0.0000000000"/>
<                 </param>
4664c4643
<                   <real value="1.5000000000"/>
---
>                   <real value="1.0000000000"/>
4721,4723d4700
<           <param name="outline_grow">
<             <real value="0.0000000000"/>
<           </param>
4761,4763d4737
<     <param name="outline_grow">
<       <real value="0.0000000000"/>
<     </param>


Strangely, the resulting Synfigstudio is happy to render 0.63.05 splash screen when running native under Windows.

Thoughts?
Chris

User avatar
Genete
Site Admin
Posts: 4871
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: 0.63.05 failing to build under windows

Postby Genete » Mon Apr 30, 2012 3:21 am

We intentionally included the outline grow feature in the new splash screen apart of change the bottom text.
If you failed to render that splash, it means that the synfig libraries were not build properly before build synfigsytudio.
Maybe it was still using the path of the already installed synfig CLI (previous version) and not the newly build libraries. It is worth to review the paths used during build time of synfigstudio to verify that it is using the current latest version of synfig libraries.

In linux/unix it is made this way:

Code: Select all

#!/bin/sh
CPUS=4
prefix=$(pwd)/install
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH
export CXX="/usr/bin/ccache /usr/bin/g++"

...


The interesting part is this one:
export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH

Notice that the .libs folder is added to the PATH. It is where the tool libraries are stored temporarily after make. You should do the similar in your build scripts.

I hope it helps
-G
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D


Return to “Building synfig”

Who is online

Users browsing this forum: No registered users and 1 guest