Simplified builds on Win32

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Simplified builds on Win32

Post #1by chris » 10.07.2009, 18:44

In version 1.6.0, the process for building Celestia on Windows is greatly simplified. All the libraries required to build Celestia are now in the SVN repository, and the project file has been cleaned up and updated for MSVC 2008. To build Celestia now, all that you need to do is download the free compiler and SVN client, checkout the Celestia source code, load the project file in MSVC, and build. No more messing with libraries or compiler settings is required. The WikiBook has details on the new build process and where to get the necessary tools:

http://en.wikibooks.org/wiki/Celestia/D ... 2_platform

--Chris

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Simplified builds on Win32

Post #2by t00fri » 10.07.2009, 18:54

Yeah! ;-)

Come on, guys, just try it!

Fridger
Image

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 3 months
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Post #3by abramson » 10.07.2009, 20:02

Right. I have been doing it for my last builds, which I continue to provide for the lazy bunch. But everybody should do it by themselves, everybody, it's so easy.

Thanks, Chris,

Guillermo

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #4by piellepi » 13.07.2009, 11:54

Hi Chris!
Thanks a lot! :D
I succeded in compiling and creating MY celestia, following your instructions!!!! The only problems I had were due to M$oft: I was not able to download neither the compiler nor the SDK in my home notebook... :evil:
Here at office I succeeded! :wink:
I checked out and updated to the current revision 4757: Guillermo could you please compile this version so I can double check "my" version with your "official" one?
Grazie!!
Pierluigi

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 3 months
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Post #5by abramson » 13.07.2009, 12:14

Done 4757, Pierluigi.

(I do not upload every SVN version because many of them involve only changes in data files, not source files, and then no changes in the executable. I am about to travel to Spain for a month so my builds will stop for some time, but with 1.6.0 out nobody should get excessively anxious.)

G

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #6by piellepi » 13.07.2009, 13:01

Thanks Guillermo for the fast reply!!
I'm a skilled programmer, but I never worked with VC2008: the release version I obtain is a little different from yours. I compared them with Beyond Compare... a crude but intelligent bitwise compare... and it says there are important differences.
I suppose that you build your version with a series of optimizations and with a particular setup: would it be possible to duplicate your build options? :oops:
Experience says that I'll be happy only when I'll obtain the same executable as yours!! :D :oops:
Starting from that version, then I'll begin my study of the code... 8)

BTW "my" version runs perfectly, so differences in size (my version is 2 835 968 bytes vs 2 821 632bytes) are only matter of setup and build conditions and optimizations...
Thanks again!
Ciao
Pierluigi

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 3 months
Location: Bariloche, Argentina

Re: Simplified builds on Win32

Post #7by abramson » 13.07.2009, 13:33

I'm sure it's a difference in compiler options. As to optimizations, I'm using:

/O2 /Oi /Ot /Oy /GT /GL, and Inline function expansion: default. All these set through the right-click command over the "celestia solution" (in the left-hand side tree view of VC++2008) > Properties > Configuration Properties > C/C++ > Optimization. I doubt I have changed anything else from the defaults. Oh, and build "release".

Guillermo

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Simplified builds on Win32

Post #8by t00fri » 13.07.2009, 14:31

abramson wrote:I'm sure it's a difference in compiler options. As to optimizations, I'm using:

/O2 /Oi /Ot /Oy /GT /GL, and Inline function expansion: default. All these set through the right-click command over the "celestia solution" (in the left-hand side tree view of VC++2008) > Properties > Configuration Properties > C/C++ > Optimization. I doubt I have changed anything else from the defaults. Oh, and build "release".

Guillermo

These optimizations will be automatically set if one opens the solution file celestia.sln which is now for VC++2008. All which needs to be done is switching to 'Release'.

Let me add that we spent quite a few thoughts to picking a "good" set of optimizations. In particular, since some of us have plenty of experience with the MS IDE. ;-)

Note that before using the Eigen library etc later, SSE2 gives NO improvements. Later it will, however. Note also that for more extreme optimizations one should also recompile all libraries in the windows/ subdirectory with the same optimizations...

I think all this would be a pretty bad strategy, since the advantages of everyone compiling with a well thought-off reference configuration are way preferrable.

That would be my advice to piellepi. Another one perhaps: Vc++2008 requires at least .Net 2.0, otherwise there will be NO download. I hope this was taken into account by piellepi above... I never encountered any problems downloading any MS compiler. Certainly not Vc++2008. It is also crucial to make sure to download the latest service packs for the various components. Note, there are service packs for ALL of them and there might be a bug wrto particular optimizations in VC++2008 SP1

Fridger
Image

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #9by piellepi » 13.07.2009, 17:11

Thanks Guillermo and Fridger for your comments!
I think that there should be a common setup for the compiler.
In my 25 years experience in programming (since DOS times) I know that when you work in a team, it's mandatory that everyone has the same setup, the same compiler and ... the same ideas!! :wink:
When I started programming on computers, PCs didn't exist at all, and working in the same project with other people was very difficult, without anything like SVN.
I remember that in order to "check out a file" we had to shout it as voice command: :o people were invited not to open that file!! :?
Now I'll try the optimizations you suggest! :D
Oh no, I'll try tomorrow in my office! :oops:
BTW the problem with my home notebook was not something relate to .NET: I have the version 3.5 installed since its distribution.
M$oft says it's a problem of a service (I don't remember now its name), but this service was obviously started and working!!
I don't trust M$oft very much, but instead I think that Vista is the best OS I've ever worked with... :wink:
Ciao
Pierluigi

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Simplified builds on Win32

Post #10by t00fri » 13.07.2009, 17:21

piellepi wrote:Thanks Guillermo and Fridger for your comments!
I think that there should be a common setup for the compiler.
In my 25 years experience in programming (since DOS times) I know that when you work in a team, it's mandatory that everyone has the same setup, the same compiler and ... the same ideas!! :wink:
When I started programming on computers, PCs didn't exist at all, and working in the same project with other people was very difficult, without anything like SVN.
I remember that in order to "check out a file" we had to shout it as voice command: :o people were invited not to open that file!! :?
Now I'll try the optimizations you suggest! :D
Oh no, I'll try tomorrow in my office! :oops:
BTW the problem with my home notebook was not something relate to .NET: I have the version 3.5 installed since its distribution.
M$oft says it's a problem of a service (I don't remember now its name), but this service was obviously started and working!!
I don't trust M$oft very much, but instead I think that Vista is the best OS I've ever worked with... :wink:
Ciao
Pierluigi

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. We have tried hard to make things simple and unified for everyone! Actually, my professional programming experience dates back quite a bit longer than 25 years ;-)

Fridger
Image

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #11by piellepi » 13.07.2009, 18:55

Fridger,
that's exactly what I did: I clicked celestia.sln, chose "Release" and at the end "Build".
Easy... terribly easy!!
The compiler found two warnings due to redefinition of FAR, but there was no other problem at all...
I never succeded before in compiling Celestia. Some years ago (I don't remember when), I tried to follow the (long and complicated) instructions about compiling Celestia in Windows, but there was always something that went wrong, missing libraries, strange libraries and so on, so I abandoned the idea...
Now everything changed! And I am very happy!
Now, when I have time, I'd consider in changing something here and there: I don't know exactly what! Perhaps I'll start with something I'd liked to change from the first time I used Celestia: the keyboard association to commands... When I worked with an American keyboard I was very satisfied, but that was 5 or 6 keyboards ago! Now and then they broke and I always needed to buy another one: since then I bought only Italian keyboards (just because I write in Italian!).
BTW I'm still wandering why "my" version is different... What is the difference? Just for curiosity!!
I just followed all the instructions...
These are Windows Mysteries!!!
Bye and thanks, my friends! :wink:
Pierluigi

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #12by piellepi » 13.07.2009, 19:03

...forgot to say that 25 years are "working" years...
I started programming on the unforgettable TI-59 (Texas Instruments), with a eclipse prediction program (thanks to Meeus!). If I remember well it was in 1977... :wink:
But I started my passion for Astronomy just 40 years ago, the day after Armstrong and Collins walked on the moon! Then I was 14 years old... :(
Pierluigi

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Simplified builds on Win32

Post #13by t00fri » 13.07.2009, 19:40

Pierluigi,

piellepi wrote:...forgot to say that 25 years are "working" years...
Pierluigi
I started counting from my degree in Computer Science that I hold besides my various Physics degrees.

My inofficial programming started also much earlier with coding the software for a self-built storage oszilloscope in 6502 assembler (~5000 lines) on my Commodore 64 ;-)

Image

Image

Still working today ;-)


Fridger
Image

ranbudzz
Posts: 1
Joined: 14.07.2009
With us: 15 years 4 months

Re: Simplified builds on Win32

Post #14by ranbudzz » 14.07.2009, 03:51

abramson wrote:Done 4757, Pierluigi.

(I do not upload every SVN version because many of them involve only changes in data files, not source files, and then no changes in the executable. I am about to travel to Spain for a month so my builds will stop for some time, but with 1.6.0 out nobody should get excessively anxious.)

G

yeah this same process I did last time to my Win32



_________________
Oklahoma city

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Simplified builds on Win32

Post #15by Vincent » 14.07.2009, 09:40

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'.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #16by piellepi » 14.07.2009, 11:28

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

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #17by piellepi » 14.07.2009, 11:43

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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Simplified builds on Win32

Post #18by t00fri » 14.07.2009, 12:09

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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Simplified builds on Win32

Post #19by t00fri » 14.07.2009, 12:22

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

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Re: Simplified builds on Win32

Post #20by piellepi » 14.07.2009, 15:23

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


Return to “Development”