• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
wood_brian

Build problem with VS 11

11 posts in this topic

I'm in the process of updating this [url="http://webEbenezer.net/comparison.html"]performance comparison page[/url] using the latest version of Boost and newer compilers. I've updated the Linux results already but am having a problem getting a test case to build on Windows. Previously with VS 10 I used:

[code]
cl -O2 -I /Users/Store/boost_1_50_0_beta1/ -EHsc bser.cc /link /nodefaultlib:msvcprt /nodefaultlib:libcmt libboost_serialization-vc110-1_50.lib
[/code]

The include directory was different of course with an earlier version of Boost. When I use that command with VS 11 I get errors like this:
libboost_serialization-vc110-1_50.lib(basic_archive.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in bser.obj

I built the serialization library with this command:
bjam variant=release link=static

This is on Windows 7. Thanks in advance. Edited by wood_brian
0

Share this post


Link to post
Share on other sites
The error message says you are trying to link something using the dynamic (MD) crt with something using the static (MT) one.

[url="http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.110).aspx"]link[/url]

Either change your project to use the static crt or (better) build a version of boost dynamically linking the crt. Edited by mrbastard
0

Share this post


Link to post
Share on other sites
[quote name='mrbastard' timestamp='1342303558' post='4959142']
The error message says you are trying to link something using the dynamic (MD) crt with something using the static (MT) one.

[url="http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.110).aspx"]link[/url]

Either change your project to use the static crt or (better) build a version of boost dynamically linking the crt.
[/quote]

I'm using the command line and makefiles. I added /MT when compiling the test case (bser.cc) but got the same errors.

I've always been able to get the tests to build using the static version of the Boost library in the past...
0

Share this post


Link to post
Share on other sites
link=static in your bjam command will build Boost as a static library, but by default I believe it will still use the dynamic CRT library. If you are using the /MT switch in your project, you need to add runtime-link=static to your bjam command so that your boost libraries reference the static version of the CRT.
1

Share this post


Link to post
Share on other sites
And [url="http://msdn.microsoft.com/en-us/library/abx4dbyh(v=vs.110)"]here[/url] is a bit more information on the choice of crt, in case you're still lost.
1

Share this post


Link to post
Share on other sites
[quote name='krippy2k8' timestamp='1342328180' post='4959188']
link=static in your bjam command will build Boost as a static library, but by default I believe it will still use the dynamic CRT library. If you are using the /MT switch in your project, you need to add runtime-link=static to your bjam command so that your boost libraries reference the static version of the CRT.
[/quote]

I got my testcase to build by rebuilding the boost library with runtime-link=static and then using this command:

[code]
cl -O2 -I /Users/Store/boost_1_50_0 -EHsc bser.cc /link libcpmt.lib libboost_serialization-vc110-s-1_50.lib
[/code]

However, the executable is 306176 bytes. The testcase hasn't changed and previously using VC 10, the executable was 160768 bytes. The new executable is also slower than the older version was. On the other hand, the Ebenezer testcase is faster when built with VC 11 than it was with VC 10. Should I do something differently? Why?
1

Share this post


Link to post
Share on other sites
In the days of 1TB+ hard disks a ~160k increase in executable size hardly seems worth worrying about, but...

The key difference is that you're now statically linking boost with the CRT. That's going to pull in a whole lot more object code and link it into your executable, so hence you get a bigger executable.

As regards performance, VC11 is more than just a different compiler - it adds new headers, new libs, new everything. This happened before with the jump from 9 to 10 where libcmt.lib (x86 version, for example) went from ~9mb to ~16mb, which means a lot more code, a lot more happening, and consequently different performance characteristics are to be expected.

There's also the matter of VC11 still being pre-release software, so oddities are also to be expected.
2

Share this post


Link to post
Share on other sites
[quote name='mhagain' timestamp='1342440690' post='4959561']
In the days of 1TB+ hard disks a ~160k increase in executable size hardly seems worth worrying about, but...

The key difference is that you're now statically linking boost with the CRT. That's going to pull in a whole lot more object code and link it into your executable, so hence you get a bigger executable.
[/quote]

Well, the Boost testcase is now between 2.8 and 3.0 times slower than the equivalent Ebenezer test. The link I referenced in the OP (as of today, still) says the Boost test was between 1.7 and 1.8 times slower than the Ebenezer using Boost 1.48 and VC 10. The testcase hasn't changed and from doing some diffs between Boost 1.48, 1.49 and 1.50, I haven't noticed any changes that would affect the performance of this test.

Iiuc, the way I used to build the boost testcase wasn't by dynamically linking anything, but isn't the same as what I did here either. I'm wondering if there's another way to build things that might yield better results for Boost. I'd like to avoid publishing flawed numbers here. If someone would like to check the numbers -- either on Linux or Windows -- that would be appreciated. I'll be happy to provide an archive of the tests and assistance in getting going.
0

Share this post


Link to post
Share on other sites
FWIW I did a quick test with boost 1.50 on VS10 and VS11 on the same machine using the first Boost test code on your page, with the same settings.

I ran each version several times with a command line of 5000000 (500000 was too close and too small).

VS10
------
File size: 270,336
Clock range: 213-215

VS11
------
File size: 316,416
Clock range: 238-243


So VS11 is roughly 10% slower than VS10 for that test case. Can't say for sure why, but the fact that it is pre-release software as mentioned is likely to have something to do with it. Edited by krippy2k8
1

Share this post


Link to post
Share on other sites
[quote name='krippy2k8' timestamp='1342482272' post='4959806']
So VS11 is roughly 10% slower than VS10 for that test case. Can't say for sure why, but the fact that it is pre-release software as mentioned is likely to have something to do with it.
[/quote]


Thanks. Here VS11 is over 15% slower than VS10 with 5 million for input. The point about the pre-release software may have something to do with it, but I'd like to point out again that the numbers are reversed on the Ebenezer side -- the Ebenezer test with VS10 is over 20% slower than when built with VS11. Edited by wood_brian
0

Share this post


Link to post
Share on other sites
Obviously you're using different C++ language features and/or library functions. Boost tends to reach into the deeper, darker recesses of C++ metaprogramming, which while inherently fast, typically gets less developer time for optimizations. Edited by krippy2k8
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0