WINE + Win32 build = WOW!

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

WINE + Win32 build = WOW!

Post by mchs3d » Mon Jul 03, 2006 3:35 am

Well, so I tested my latest SSE2 build on Windows and my test render scene gave 31.73 seconds. Pretty good, I think. However, I run the exact same build of Blender in Kubuntu 6.06 in WINE and the scene renders in 16.67 seconds (I think, something within 16 seconds). How do you explain that? And that's not even native linux. Do you think native Linux builds would be even faster? That would be real cool. :D
"It is the eternal struggle between these two principles — right and wrong — throughout the world."
- Abraham Lincoln

blendix
Posts: 51
Joined: Wed Oct 16, 2002 1:00 pm

Post by blendix » Mon Jul 03, 2006 4:37 am

WINE doesn't do any emulation, so it should be near native speed for rendering. What would be interesting to compare is the timing for command line rendering. This might be a graphics driver issue causing a slowdown on windows.

Marty_D
Posts: 0
Joined: Mon Jun 09, 2003 11:16 pm

Post by Marty_D » Sun Jul 09, 2006 10:10 pm

hmm, that is impressive. Very good news. Thanks for putting that up m. Microsoft's compiler seems to manage some serious optimizing and Linux has a very fast pipe so couple that with blendix' also very good news regarding wine and it explains why your speeds are so impressive. Native Linux builds tend to outperform windows builds anyway so having professional quality optimization running in the OS makes, apparently, for a very attractive option.

Are you using VC Express? Or are you using the full version. I'd like to be able to get the kind of speed you're putting together with the Express version but still learning how to use the soft.

Actually I just don't even know where to begin as far as optimization goes. Any tips?

And right now the builds are failing when building blender.lib and blender.exp. Something to do with "unresolved external symbol __imp__RegCloseKey@4 referenced in function _RegisterBlendExtension".

Just so frustratingly complex. At any rate, congrats with that wine test. Nice.

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d » Mon Jul 10, 2006 12:09 am

Thanks! Yes, I am using the full version. I'm not sure, but I think that the compiler is the same across all versions of VS. The flags I use the most are the following:

/arch:SSE2 - this one tells the compiler to use methods with SSE2: great speed increase!
fp:fast - this tells the compiler to calculate floating point values quickly

Those are the most important compiler flags, I believe, that should make you r build faster. I haven't gotten a native Linux build to perform as fast.
"It is the eternal struggle between these two principles — right and wrong — throughout the world."
- Abraham Lincoln

Lynx3d
Posts: 0
Joined: Tue Jan 24, 2006 5:09 pm

Post by Lynx3d » Mon Jul 10, 2006 11:48 am

May i ask how much slower a native Linux build (with comparable flags, i.e. -ffast-math -mfpmath=sse -msse2) is? I don't think MSVC does any vectorization-magic like ICC so i can hardly believe it makes a tremendouse difference...

Also note that -ffast-math and /fp:fast affect precision of floating point code (in a negative way), so this can cause render errors!

And what CPU are we talking about anyway?

@Marty_D: Are you sure you have everything installed correctly? Windows Platform SDK especially...

-edit-
oh and the proper -march makes easily 20-30% with gcc compared to i386 code, so use e.g. k8 or pentium4

Marty_D
Posts: 0
Joined: Mon Jun 09, 2003 11:16 pm

Post by Marty_D » Mon Jul 10, 2006 1:37 pm

Lynx3d: VC Express is set up on a Win 2000 box right now. The SDK that Microsoft insists on making available is the Windows Server 2003 R2 version. Would that be the problem do you suppose? Maybe I should set up an XP box and see how it goes. (Is there a Vista kit available? hmm)

mchs3d: Where exactly are you setting flags? It kind of sounds like you're using a command line interface. If I right click on the blender solution in the blender project there's an option for Custom Build Rules. Is that where the SSE2 stuff goes? What is the format for that? I wonder if there's a site on the web somewhere that might have some kind of tutorial for setting optimizing flags. I've looked around but didn't see anything concrete.

Blender's Cygwin configuration is successfully building with make these days, but even with the architecture, sse2, etc. flags that setup still only delivers a binary that is perhaps two thirds as fast as the Microsoft build in Windows.

Lynx3d
Posts: 0
Joined: Tue Jan 24, 2006 5:09 pm

Post by Lynx3d » Mon Jul 10, 2006 7:22 pm

About the platform SDK: so did you install it or not?
There is only one for all 2000/XP/2003 variants AFAIR...
I think DirectX is also needed.

Don't know about Cygwin, for me MinGW with gcc 3.3 was able to slightly outperform MSVC 7.1 on the stuff i tried (e.g. YafRay, haven't tried with Blender) however 3.4 produced for some reason quite a bit slower binaries... but of course there's MSVC 8.0 now...

For compiling i'd use scons and create a user-config.py where you can set custom CCFLAGS, REL_CFLAGS and REL_CCFLAGS. See config/win32-vc-config.py for their default values.
But the project files should work too of course, but i can't tell you the menus off the top of my head...only know Visual Studio 2003 anyway.

Marty_D
Posts: 0
Joined: Mon Jun 09, 2003 11:16 pm

Post by Marty_D » Tue Jul 11, 2006 4:24 pm

Lynx3d wrote:About the platform SDK: so did you install it or not?
Yes, of course. :)
Lynx3d wrote: There is only one for all 2000/XP/2003 variants AFAIR...
I think DirectX is also needed.
Yes, DirectX 9 also installed.

To now, I've been building the project files from within the graphical interface. Successfully building external and internal projects and all solutions for blender. Failures are showing when linking begins, I think, at the very end of the proccess.

I was messing around with the path's statements in environment variables since microsoft adds statements in both the current configuration and the global configuration. Thought maybe that was messed up but after reinstalling the Platfrom SDK, DirectX 9, and .net 2 the same errors are showing. The .net framework is supposed to be included with VC Express. I was going to update to the latest stand-alone version, but when the intallation routine tries to start the .net optimization service the files it needs are locked and an error is returned insufficient privileges. Does .net have anything to do with linking the libraries?
Lynx3d wrote:For compiling i'd use scons and create a user-config.py where you can set custom CCFLAGS, REL_CFLAGS and REL_CCFLAGS. See config/win32-vc-config.py for their default values.
But the project files should work too of course, but i can't tell you the menus off the top of my head...only know Visual Studio 2003 anyway.


I wonder if another reason microsoft build doesn't work so well isn't because the libraries are built with optimization as well. It's a thought. Does scons script build the dlls? I think Make only uses the pre-built variety.

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d » Tue Jul 11, 2006 9:20 pm

I too build inside the gui and that gives me the most optimization (I use VS 2005 Pro). I just go to properties and under C/C++ -> Optimizations I can set most optimizations. Also, you can set SSE2 under C/C++ -> Code Generation. I'm not sure if you can do this under the express versions. Also, with the /fp:fast optimization, it's true that it alters the floating point code in a negative way, but I still have not found to date a visible error caused by that optimization.
"It is the eternal struggle between these two principles — right and wrong — throughout the world."
- Abraham Lincoln

Marty_D
Posts: 0
Joined: Mon Jun 09, 2003 11:16 pm

Post by Marty_D » Tue Jul 11, 2006 11:32 pm

Excellent. Yes the options are all there. SSE2 is under "Enable Enhanced Instruction Set." Thanks. Now if only the linking weren't falling apart.

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d » Wed Jul 12, 2006 5:56 am

The linking has nothing to do with code optimizations, though. There are other problems with your linker. You're probably missing a module or something.
"It is the eternal struggle between these two principles — right and wrong — throughout the world."
- Abraham Lincoln

Marty_D
Posts: 0
Joined: Mon Jun 09, 2003 11:16 pm

Post by Marty_D » Wed Jul 12, 2006 4:46 pm

Sorry, didn't mean to imply that linking failures were associated optimizing. dur.

All right, getting stoked now. Linking is fixed. Was probably either Direct-x or possibly Quicktime (and possibly SQL Server). Not sure which item fixed the errors. Direct-X was missing from the path statement altogether and Quicktime wasn't placed in the lib folder. dur.

Now there are more errors though. I would imagine these were the last of them and I'll be up to speed.

When building the BL_src solution:
1>..\..\..\source\blender\src\toolbox.c(1472) : error C2275: 'Camera' : illegal use of this type as an expression
1>..\..\..\source\blender\src\toolbox.c(1472) : error C2065: 'ca' : undeclared identifier
1>..\..\..\source\blender\src\toolbox.c(1477) : error C2223: left of '->flag' must point to struct/union
1>..\..\..\source\blender\src\toolbox.c(1478) : error C2223: left of '->flag' must point to struct/union
1>..\..\..\source\blender\src\toolbox.c(1480) : error C2223: left of '->flag' must point to struct/union

And when building the GP_axctl solution
3>c:\blenderdev\blender\source\gameengine\gameplayer\activex\stdafx.h(49) : fatal error C1083: Cannot open include file: 'afxctl.h': No such file or directory

Not too sure if I'll be able to verify the wine test. I do have Ubuntu installed on a hard drive but not that much time. I've never actually tried w.i.n.e. either. Maybe. See how things go. Would it be possible to download the test file somewhere?

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d » Wed Jul 12, 2006 8:15 pm

The problems in toolbox.c look like programming errors. Get the latest clean CVS of that file. And for the axctl, don't even try building it. It's way out of date and gives hundreds of errors. You don't need it anyway; it's just for the game player plugin (old version).
"It is the eternal struggle between these two principles — right and wrong — throughout the world."
- Abraham Lincoln

Marty_D
Posts: 0
Joined: Mon Jun 09, 2003 11:16 pm

Post by Marty_D » Wed Jul 12, 2006 10:37 pm

Ah well. Looks like the programming error was halting the build in time to stop the linking. Same errors now. VC++ compile will have to wait for some other time.

The implications of the WINE test though are extensive. If other programs are executed as effectively there would be good reason to migrate to Linux.

Here's a log of the errors that are showing

Code: Select all

1>------ Build started: Project: blender, Configuration: Blender Release Win32 ------
1>Linking...
1>buildinfo.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>   Creating library ..\..\bin\blender.lib and object ..\..\bin\blender.exp
1>bli_blenlib.lib(winstuff.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4
1>qtmlClient.lib(QTLoadLibraryUtils.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4
1>bre_yafray.lib(export_File.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4
1>bre_yafray.lib(export_Plugin.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4
1>bli_blenlib.lib(winstuff.obj) : error LNK2001: unresolved external symbol __imp__RegSetValueExA@24
1>bli_blenlib.lib(winstuff.obj) : error LNK2001: unresolved external symbol __imp__RegCreateKeyExA@36
1>bl_src.lib(usiblender.obj) : error LNK2001: unresolved external symbol __imp__SHGetSpecialFolderPathA@16
1>bl_src.lib(drawtext.obj) : error LNK2001: unresolved external symbol __imp__CloseClipboard@0
1>bl_src.lib(drawtext.obj) : error LNK2001: unresolved external symbol __imp__GetClipboardData@4
1>bl_src.lib(drawtext.obj) : error LNK2001: unresolved external symbol __imp__OpenClipboard@4
1>bl_src.lib(drawtext.obj) : error LNK2001: unresolved external symbol __imp__SetClipboardData@8
1>bl_src.lib(drawtext.obj) : error LNK2001: unresolved external symbol __imp__EmptyClipboard@0
1>bl_src.lib(writeavicodec.obj) : error LNK2001: unresolved external symbol __imp__SetRect@20
1>qtmlClient.lib(ClientToolboxAPI.obj) : error LNK2001: unresolved external symbol __imp__wsprintfA
1>qtmlClient.lib(QTLoadLibraryUtils.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24
1>bre_yafray.lib(export_File.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24
1>bre_yafray.lib(export_Plugin.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24
1>qtmlClient.lib(QTLoadLibraryUtils.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20
1>bre_yafray.lib(export_File.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20
1>bre_yafray.lib(export_Plugin.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__DispatchMessageA@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__TranslateMessage@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__PeekMessageA@20
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__GetCursorPos@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__SetCursorPos@8
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__GetKeyState@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__DefWindowProcA@16
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__ValidateRect@8
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__GetWindowLongA@8
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__RegisterClassA@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__GetStockObject@4
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__LoadCursorA@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__LoadCursorA@8
1>libghost.lib(GHOST_SystemWin32.obj) : error LNK2001: unresolved external symbol __imp__LoadIconA@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__UpdateWindow@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ShowWindow@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetDC@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetWindowLongA@12
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__DestroyWindow@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ReleaseDC@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__DestroyCursor@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetWindowTextA@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetWindowTextA@12
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetWindowRect@8
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__GetWindowRect@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetClientRect@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetWindowPos@28
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__IsZoomed@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__IsIconic@4
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__IsIconic@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ScreenToClient@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ClientToScreen@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetWindowPlacement@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetWindowPlacement@8
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__GetWindowPlacement@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SwapBuffers@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__InvalidateRect@12
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ReleaseCapture@0
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetCapture@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetCursor@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ShowCursor@4
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__GetForegroundWindow@0
1>openal_static.lib(ALc.obj) : error LNK2001: unresolved external symbol __imp__GetForegroundWindow@0
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__CreateCursor@28
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__ChoosePixelFormat@8
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__DescribePixelFormat@16
1>libghost.lib(GHOST_WindowWin32.obj) : error LNK2001: unresolved external symbol __imp__SetPixelFormat@12
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__SystemParametersInfoA@16
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__IntersectRect@12
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__OffsetRect@12
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__GetDCOrgEx@8
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__GetClipBox@8
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__EnumDisplaySettingsA@12
1>libghost.lib(GHOST_DisplayManagerWin32.obj) : error LNK2001: unresolved external symbol __imp__ChangeDisplaySettingsA@8
1>ftf_ftfont.lib(FTF_TTFont.obj) : error LNK2001: unresolved external symbol "public: float __thiscall FTFont::Advance(unsigned short const *)" (?Advance@FTFont@@QAEMPBG@Z)
1>ftf_ftfont.lib(FTF_TTFont.obj) : error LNK2001: unresolved external symbol "public: void __thiscall FTFont::BBox(unsigned short const *,float &,float &,float &,float &,float &,float &)" (?BBox@FTFont@@QAEXPBGAAM11111@Z)
1>openal_static.lib(ALc.obj) : error LNK2001: unresolved external symbol __imp__CoCreateInstance@20
1>openal_static.lib(ALc.obj) : error LNK2001: unresolved external symbol __imp__CoInitialize@4
1>openal_static.lib(ALc.obj) : error LNK2001: unresolved external symbol __imp__PostThreadMessageA@16
1>openal_static.lib(ALc.obj) : error LNK2001: unresolved external symbol __imp__CoUninitialize@0
1>openal_static.lib(ALc.obj) : error LNK2001: unresolved external symbol __imp__GetMessageA@16
1>..\..\bin\blender.exe : fatal error LNK1120: 71 unresolved externals
1>Build log was saved at "file://c:\blenderdev\build\msvc_7\source\blender\BuildLog.htm"
1>blender - 86 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 33 up-to-date, 0 skipped ==========
Needing to model a football stadium now. And populate with spectators.

Lazareus
Posts: 0
Joined: Sun Jul 23, 2006 5:24 am

Post by Lazareus » Wed Jul 26, 2006 4:16 am

is the directory containing Advapi32.lib on the library path in your project options?

Post Reply