Simplified builds on Win32

The place to discuss creating, porting and modifying Celestia's source code.

Moderator: selden

Re: Simplified builds on Win32

Postby piellepi » Tue Jul 14, 2009 4:28 am

hi friends!
the solution file has not all the optimization that Guillermo indicated.
I had to add manually /Ot /Oy /GT and /GL from "properties/C++/optimization"
The configuration is always "Release".
After a rebuild, "my" celestia.exe is 2 819 584 byte, while Guillermo official one is 2 821 632 byte: now the difference is a mere 2kbytes, but still exists!
still investigating... 8O
ciao
Pierluigi
User avatar
piellepi
 
Posts: 124
Joined: Thu Sep 25, 2003 6:33 am
Location: Rome, Italy

Re: Simplified builds on Win32

Postby piellepi » Tue Jul 14, 2009 4:43 am

I'm again here! :roll:
right clicking the solution file, in "properties/C++/Command Line" I suppose there is the complete list of optimizations and compile switches!!
My list is the following (obtained with cut and paste)
--------------------------------------------------------------------------------------------------------------------------
/O2 /Oi /Ot /Oy /GT /GL /I ".\src" /I ".\windows\inc" /I ".\windows\inc\libintl" /I ".\windows\inc\libpng" /I ".\windows\inc\libz" /I ".\windows\inc\spice" /I ".\windows\inc\lua-5.1" /I ".\windows\inc\libjpeg" /D "CELX" /D "LUA_VER=0x050100" /D "USE_SPICE" /D "WINVER=0x0400" /D "_WIN32_WINNT=0x0400" /D "_CRT_SECURE_NO_DEPRECATE" /FD /EHsc /MD /Fo"Release\\" /Fd"Release\vc90.pdb" /nologo /c /TP /errorReport:prompt
--------------------------------------------------------------------------------------------------------------------------
I think a quick comparison with Guillermo's list will give the solution!!!
Pierluigi
User avatar
piellepi
 
Posts: 124
Joined: Thu Sep 25, 2003 6:33 am
Location: Rome, Italy

Re: Simplified builds on Win32

Postby t00fri » Tue Jul 14, 2009 5:09 am

Vincent wrote:
t00fri wrote:To get the above optimizations, you just need to click celestia.sln in the celestia root dir from within the VC++2008 IDE. That's all.

I'm not sure wether this is wanted or not, but celestia.sln is configured to build a debug version...
To build a release, right-click on 'celestia' solution > Property > Configuration and switch from 'Debug' to 'Release'.


The Debug version is usually the default. But I (we) wrote earlier that one has to switch to Release after clicking.

Fridger
Image
User avatar
t00fri
 
Posts: 8782
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

Re: Simplified builds on Win32

Postby t00fri » Tue Jul 14, 2009 5:22 am

piellepi wrote:I'm again here! :roll:
right clicking the solution file, in "properties/C++/Command Line" I suppose there is the complete list of optimizations and compile switches!!
My list is the following (obtained with cut and paste)
--------------------------------------------------------------------------------------------------------------------------
/O2 /Oi /Ot /Oy /GT /GL /I ".\src" /I ".\windows\inc" /I ".\windows\inc\libintl" /I ".\windows\inc\libpng" /I ".\windows\inc\libz" /I ".\windows\inc\spice" /I ".\windows\inc\lua-5.1" /I ".\windows\inc\libjpeg" /D "CELX" /D "LUA_VER=0x050100" /D "USE_SPICE" /D "WINVER=0x0400" /D "_WIN32_WINNT=0x0400" /D "_CRT_SECURE_NO_DEPRECATE" /FD /EHsc /MD /Fo"Release\\" /Fd"Release\vc90.pdb" /nologo /c /TP /errorReport:prompt
--------------------------------------------------------------------------------------------------------------------------
I think a quick comparison with Guillermo's list will give the solution!!!
Pierluigi


Please note that we made a number of last minute changes to the optimizations after extensive discussions in the Dev list. Guillermo may not have these implemented.

I advise to be careful here, since some of the matter is tricky:

-- ChrisL is/was using VC++2008 without service pack when this discussion took place
-- I am using since a while VC++2008 SP1
-- it was discussed in the net/MS that there seems to be a bug in SP1 that makes some optimizations uneffective!

To cope with these issues both for no SP and SP1, we have deactivated some optimizations at the very end, just before the release version. However, we made sure by many benchmark runs that with the present celestia.sln, users get optimal performance of celestia.exe.

Presumably, Guillermo was unaware of these subtleties, since he is not a member of the Dev team. Clearly, there may be already small differences in code size due to these facts and the differences between no SP and SP1 compilations.

In general, I would advice to use the optimization flags that we recommend. As I mentioned already, they were carefully chosen...

Fridger
Image
User avatar
t00fri
 
Posts: 8782
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

Re: Simplified builds on Win32

Postby piellepi » Tue Jul 14, 2009 8:23 am

so, Fridger, what is "your" list of options, as discussed among you developers?
I don't want to change your choices, obviously!! :wink:
All I want is to be consistent with the current version of Celestia in order to build the same executable!!!
Thanks
Pierluigi
User avatar
piellepi
 
Posts: 124
Joined: Thu Sep 25, 2003 6:33 am
Location: Rome, Italy

Re: Simplified builds on Win32

Postby t00fri » Tue Jul 14, 2009 9:40 am

piellepi wrote:so, Fridger, what is "your" list of options, as discussed among you developers?
I don't want to change your choices, obviously!! :wink:
All I want is to be consistent with the current version of Celestia in order to build the same executable!!!
Thanks
Pierluigi


Pierluigi,

as I wrote, it's what you get when clicking on celestia.sln. As far as I remember, it was

/O2, /Oy and /Oi

Note that /Ox does not work in VC++2009 SP1. Hence we used /O2 which gives the same sort of performance. Also there is often some partial redoubling when you activate all optimizations.

Fridger
Image
User avatar
t00fri
 
Posts: 8782
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

Re: Simplified builds on Win32

Postby abramson » Wed Jul 15, 2009 10:13 am

Indeed, I have not benchmarked my optimizations, so I would recommend the ones used by the development team.

Additionally, as of today (rev 4766) I cannot build any longer, I started to receive errors from the Eigen packages about missing files, duplicate definitions of Quaternion (celmath and Eigen) and conflict definitions of min and max (with a recommendation for windows builders to add a definition to avoid this, which I haven't tried). I presume Chris is in the process of making some changes which aren't finished in the SVN (such as the use of the Eigen, which is new).

G
User avatar
abramson
 
Posts: 397
Joined: Tue Jul 22, 2003 5:29 am
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Postby t00fri » Wed Jul 15, 2009 10:31 am

abramson wrote:Indeed, I have not benchmarked my optimizations, so I would recommend the ones used by the development team.

Additionally, as of today (rev 4766) I cannot build any longer, I started to receive errors from the Eigen packages about missing files, duplicate definitions of Quaternion (celmath and Eigen) and conflict definitions of min and max (with a recommendation for windows builders to add a definition to avoid this, which I haven't tried). I presume Chris is in the process of making some changes which aren't finished in the SVN (such as the use of the Eigen, which is new).

G


Indeed, Guillermo,

here is the respective mail from the Dev list:

Chris wrote:I've updated the MSVC++ project file to search for headers in thirdparty/Eigen. Unfortunately, the Windows build still isn't working. There are two things causing problems:

1. Eigen uses the std::min and std::max functions. Unfortunately, there are standard Windows header files that define macros named min and max. I've run into this problem before, but it still amazes me that this sort of braindamage ended up in windows.h. The solution is to define the macro NOMINMAX *before* including the Eigen headers. I'll get to this tomorrow.
2. The MSVC compiler complains about Quaternion being multiply defined: once in Eigen, and once in Celestia. g++ doesn't treat this as an ambiguous definition. I will try and get rid of Celestia's quaternion class completely tomorrow.

I hate leaving the Windows build in a broken state. After getting good results with g++, I didn't anticipate so many troubles on Windows. If you are building on Windows, the best thing to do is avoid updating from SVN for the time being.

--Chris


Fridger
Image
User avatar
t00fri
 
Posts: 8782
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

Re: Simplified builds on Win32

Postby abramson » Wed Jul 15, 2009 10:36 am

Chris wrote:If you are building on Windows, the best thing to do is avoid updating from SVN for the time being.

Frak!
User avatar
abramson
 
Posts: 397
Joined: Tue Jul 22, 2003 5:29 am
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Postby chris » Wed Jul 15, 2009 10:56 am

abramson wrote:Additionally, as of today (rev 4766) I cannot build any longer, I started to receive errors from the Eigen packages about missing files, duplicate definitions of Quaternion (celmath and Eigen) and conflict definitions of min and max (with a recommendation for windows builders to add a definition to avoid this, which I haven't tried). I presume Chris is in the process of making some changes which aren't finished in the SVN (such as the use of the Eigen, which is new).


I just committed revision 4767, which fixes compilation on Window of both the Qt version and the native Win32 version of Celestia. The switch to Eigen is a major project, but the benefits for performance and code readability will be worthwhile. I hope to write more on this topic in the Developers forum later today.

--Chris
User avatar
chris
Site Admin
 
Posts: 4218
Joined: Mon Jan 28, 2002 12:21 pm
Location: Seattle, Washington, USA

Re: Simplified builds on Win32

Postby abramson » Wed Jul 15, 2009 11:18 am

Thanks, Chris. Succeeded (VC++2008 SP1, .NET 3.5 SP1). Runs flawlessly. I uploaded the executable to my page.
Guillermo
User avatar
abramson
 
Posts: 397
Joined: Tue Jul 22, 2003 5:29 am
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Postby Chuft-Captain » Wed Jul 15, 2009 11:26 am

abramson wrote:Frak!
Pls forgive the off topic, but don't you think BSG would have been more effective/dramatic if they hadn't sanitised the "F" word? :o (Of course then it wouldn't have been able to be aired in primetime. :lol: )
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

O'NEILL COLONY
LAGRANGE POINTS
User avatar
Chuft-Captain
 
Posts: 1667
Joined: Sun Dec 18, 2005 1:26 am

Re: Simplified builds on Win32

Postby t00fri » Wed Jul 15, 2009 11:41 am

Yes the building of rev 4767 works flawlessly. However my reference benchmarks perform only with half the fps rate (M 74 16' fov). This is compared to the 1.6.0final performance on the same machine.

VC++2008 SP1, Win32 XP SP3, and /O2 /Oi /Oy default optimizations.

Fridger
Last edited by t00fri on Wed Jul 15, 2009 11:42 am, edited 1 time in total.
Image
User avatar
t00fri
 
Posts: 8782
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

Re: Simplified builds on Win32

Postby abramson » Wed Jul 15, 2009 12:07 pm

I cannot confirm Fridger's observation. I am getting the same performance of both the official 1.6.0 and svn 4767:

Following Earth from startup location, watching M 74 at 16' FOV, today (the Moon is near)
Smallish default window: 48fps
Maximized window (1680x1050): 16fps
Fullscreen (1680x1050x32): 20fps

Default optimizations in the sln, release, VC++2008 SP1, XP SP3
Core 2 Duo E6550 @ 2.333 GHz on a DG33BU board. Nvidia 7300LE, PCIE, 512MB.

G
User avatar
abramson
 
Posts: 397
Joined: Tue Jul 22, 2003 5:29 am
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Postby t00fri » Wed Jul 15, 2009 12:36 pm

abramson wrote:I cannot confirm Fridger's observation. I am getting the same performance of both the official 1.6.0 and svn 4767:

Following Earth from startup location, watching M 74 at 16' FOV, today (the Moon is near)
Smallish default window: 48fps
Maximized window (1680x1050): 16fps
Fullscreen (1680x1050x32): 20fps

Default optimizations in the sln, release, VC++2008 SP1, XP SP3
Core 2 Duo E6550 @ 2.333 GHz on a DG33BU board. Nvidia 7300LE, PCIE, 512MB.

G


Guillermo,

sorry, I now discovered that compared to my earllier standard benchmarks there was a leftover 2x AA still active. This costs speed, of course...

Now the rate is higher, but still significantly lower than without Eigen. Sse2 optimization in addition gives these rates (Core2Duo 2.0GHz):

1.6.0final: 72 fps (fullscreen) No SSE2!
Eigen 4767: 53 fps (fullscreen) with SSE2

all with M 74, 16' fov

My rates for Eigen, rev 4767 are quite comparable to yours, but with 1.6.0final, they were significantly higher! You did not show your corresponding rates for comparison.


Fridger

EDIT:. With 2xAA switched off and NO SSE2, now the rates of Eigen 4767 and 1.6.0final are about comparable: ~70 fps in fullscreen for M 74 16' on my Core2Duo 2.0 GHz.
Image
User avatar
t00fri
 
Posts: 8782
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests