CMake/Mingw now works out of the box (r45556)

Hi there, recently a few people have been complaining of MinGW failing to build blender.

While I fire up VirtualBox to test mingw once in a while, I didnt realize the default configuration would fail to build.

This morning I took a look into it and found cycles, libtiff and openexr dont work with Mingw at the moment, these are now disabled by default (for mingw only).

So nothing amazing but noticed people have been loosing time on this stuff so just a heads up you can follow these instructions to get a working windows build.

http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Windows/MinGW/CMake

There are some weird issues new devs reported with Mingw so perhaps our troubleshooting section needs expanding, however someone who has the issues needs to resolve and document steps to fix (which is very much appretiated!).

Very BIG thanks ideasman42 for your support and suggestions, You deserve a Star

Hrmf, not so fast!

Well it seems that some developers can get Mingw working with Cycles/Tiff/Exr, but not me. I get very cryptic linking errors even after clean mingw installs and setting my paths to point to mingw, updating lib/trunk, clearing local changes etc.

This is very strange since we both installed the same, latest mingw version - but I think I lost enough time on this already. (tracking down linking errors is not so hard but very slow on my VM so I will give it a miss for now :S )

My disabling of cycles/tiff/exr has been un-done.

Anyway, result of efforts is.

  • Some compiler warnings quieted.
  • Compiling with mingw older then 4.6 will give an error now
  • We know tiff/exr/cycles CAN cause problems but not yet why :expressionless:

Id really like to have this solved but cant justify spending more time on this so close to release when we have ~200 bugs open.

This is the error log incase anyone has more hints on whats going wrong:

is mingW/scons status the same to mingW/cmake?

@bat3a, not sure - some people use it so its quite possible, but for now I find it enough to check cmake is working properly.

ok, i’ll test and tell :slight_smile:

ok, i dont have gcc 4.6 instead i tested with 4.7, i got this error:


scons: done reading SConscript files.
scons: Building targets ...
Compiling ==> 'avi.c'
In file included from source\blender\avi\intern\avi.c:46:0:
source\blender\blenlib/BLI_winstuff.h:114:14: error: conflicting types for 'ssiz
e_t'
In file included from z:\development\compilers\mingw32\bin\../lib/gcc/i686-w64-m
ingw32/4.7.0/../../../../i686-w64-mingw32/include/stdlib.h:9:0,
                 from source\blender\avi\intern\avi.c:37:
z:\development\compilers\mingw32\bin\../lib/gcc/i686-w64-mingw32/4.7.0/../../../
../i686-w64-mingw32/include/_mingw.h:361:13: note: previous declaration of 'ssiz
e_t' was here

scons: *** [Z:\Development\blender\build\win32-mingw\source\blender\avi\intern\a
vi.o] Error 1
scons: building terminated because of errors.

hope it helps :slight_smile:

i use windows 7 x64, scons, mingw32 with gcc 4.7.0.

Update: Antony Riakiotakis found the cause the issue I was having and its now resolved (Building works out of the box again!)

linking FFMPEG is needed for TIFF/EXR/CYCLES — This makes no sense and must be some strange mingw quirk - but at least its known and CMake gives function build, and unsupported options error out explaining why.

@bat3a, where did you get gcc 4.7 from? I tried the latest from mingw as of ~3 days ago and only got gcc4.6.2.

The error you get is strange and can probably be solved without editing the source by adding…
-D_SSIZE_T_
to your CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
… this is a kludge, but I rather not try to make a patch unless I can test it.

where did you get gcc 4.7 from?
from HERE as the main site,specifically THIS folder, they even provide regular builds from mingw64, and many big project use them, BTW i mentioned this site on bf-commiters list before :slight_smile:

-D_SSIZE_T_ to your CMAKE_C_FLAGS
as i said i tested with scons.

@bat3a, AFAIK mingw64 is not supported, expect minimum 3-5 dependencies need to be built for mingw64 before blender will build.
Your links are to the 64bit dir, in the 32bit dir I cant find gcc4.7, note that building GCC on win isnt so hard but I don’t have time for it atm.

you can add -D_SSIZE_T_ to scons flags too.

you can add -D_SSIZE_T_ to scons flags too.

ok i switched to gcc 4.6.4 from here and added your flag and the error gone, but i got another one, here is the log:
http://www.pasteall.org/30963

Hi Guys,

As of two days ago my build platform isnt working anymore. I am on both a Win XP Pro 32 bit unit and a Win7 Pro 64 bit unit using MSVC 2008 (exp) + Scons. TortoiseSVN also. I am building 32 bit on both units.

My user-config.py:

WITH_BF_FFMPEG = True
WITH_BF_OPENAL = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False
WITH_BF_JACK = True
WITH_BF_SDL = True
WITH_BF_ICONV = True
WITH_BF_COLLADA = True
WITH_BUILDINFO = True
WITH_BF_OPENMP = False
BF_DEBUG = False
BF_NUMJOBS = 1

Here is the error I am getting:

http://www.pasteall.org/pic/show.php?id=30451

Do I need to add/subtract some lines to user-config.py OR change/update mingw, MSVS exp, Tortoise???

Cheers
Aidan

I switched to using MSVC 2008 (exp) + CMake - all is well again.

I used this tute:

http://www.geneome.com/tutorials/blender-tutorials/building-blender-with-msvc-using-cmake/

Not sure how old, but got me through

Aidan

I can confirm these oddities myself. I had to disable Cycles to be able to compile at the base level. I had suspicions about corrupted svn updates but I am not sure since ideasman42 seemed to have similar issues.