Compiling the sources

From World Wind Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 09:54, 15 February 2007 (edit)
220.101.91.159 (Talk)
(Compiling using Visual Studio)
← Previous diff
Revision as of 11:24, 15 February 2007 (edit) (undo)
Mkpl (Talk | contribs)
m (updated for 1.4)
Next diff →
Line 6: Line 6:
The following software must be installed before starting. The following software must be installed before starting.
See [[Development Tools]] for download locations. See [[Development Tools]] for download locations.
-*.NET Framework SDK 1.1 ([http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&DisplayLang=en] Note: If you have already installed Microsoft Visual Studio .NET 2003, you do not need to install the .NET Framework SDK separately. Visual Studio .NET 2003 includes the SDK.)+*.NET Framework SDK 2.0 ([http://www.microsoft.com/downloads/details.aspx?familyid=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en NET Framework 2.0 Software Development Kit (SDK) (x86)])
-*DirectX SDK ([http://www.microsoft.com/downloads/details.aspx?FamilyID=edb98ffa-a59c-4c23-9b92-ba304f188314&DisplayLang=en 9.0 SDK February 2006])+:Note: If you have already installed Microsoft Visual Studio .NET 2005, you do not need to install the .NET Framework SDK separately. Visual Studio .NET 2005 includes the SDK.
 +*Managed DirectX ([http://www.microsoft.com/downloads/details.aspx?FamilyID=4B1F5D0C-5E44-4864-93CD-464EF59DA050&displaylang=en DirectX 9.0c Redistributable (February 2007)])
 +:Note: Above is the latest version. World Wind should compile with [http://www.microsoft.com/downloads/details.aspx?FamilyID=9930efa6-9f7b-4c8a-aea2-97dd6ab307a2&DisplayLang=en October 2005 version]
*A SVN client (e.g. [http://tortoisesvn.tigris.org/ TortoiseSVN]) *A SVN client (e.g. [http://tortoisesvn.tigris.org/ TortoiseSVN])
-*A .NET 'make' style utility (e.g. Visual Studio.NET or [http://nant.sourceforge.net/ NAnt])+*Visual Studio 2005 (free Visual C# Express version available from [http://msdn.microsoft.com/vstudio/express/visualcsharp/default.aspx Microsoft])
-Note: with VS.NET you will be loading the project(s) into a GUI and compiling, with Nant you will be compiling from the command line+
===Get the Source Code=== ===Get the Source Code===
Line 25: Line 26:
==Compile the Source Code== ==Compile the Source Code==
- 
-===Compiling using NAnt=== 
-#Open a Command Prompt and cd to your work directory (<code>cd \wwdev\WorldWind</code>) 
-#<span>Type "<code>c:\nant-0.85-rc2\bin\nant</code>" (change the path to reflect where you installed Nant)<br>or "<code>c:\nant-0.85-rc2\bin\nant -buildfile:default.release.build</code>" for non-debug binaries</span> 
-If all goes well, you should get <tt>BUILD SUCCEEDED</tt> in the end 
===Compiling using Visual Studio=== ===Compiling using Visual Studio===
-Note: This is out of date or broken (Feb 15th 2007). It doesn't work with VS2003 at least, I think the project might have been upgraded to 2005. To get a working version I downloaded the source from sourceforge, opened worldwindow\worldwindow.csproj in the unpacked dir, then set the build to Debug. Then I downloaded SharpZipLib from (http://optusnet.dl.sourceforge.net/sourceforge/sharpdevelop/0851_ICSharpCode.SharpZipLib_11.zip) unpacked it, registered it and then added a reference to the SharpZipLib DLL to the WorldWind project. Then it all compiled perfectly. Then take all the generated DLLs and .exe from your bin\debug directory and copy them to the bin\debug directory of the version you take from the SVN site and it should all work fine. Works perfectly. Simple, eh ? 
-====Compile within Studio====+====Compile within Visual C# Express====
-Replace C:\wwdev\WorldWind\ with your source directory:+Replace C:\wwdev\ with your source directory:
#Navigate to the following file and double click it: #Navigate to the following file and double click it:
##C:\wwdev\WorldWind\WorldWindow.csproj ##C:\wwdev\WorldWind\WorldWindow.csproj
-##If using MS VS 2005 it will ask to convert the file, NEXT->NEXT->FINISH+##or C:\wwdev\WorldWind.sln
-##From the Build menu, select Build WorldWindow, and in the Output window you should get a message that the build succeeded+#From the Build menu, select Build Solution, and in the Output window you should get a message that the build succeeded.
-##Close Visual Studio+#Close Visual Studio
 +:You may choose 'Debug' or 'Release' from the Build->Configuration Manager menu.
====Compile from the commandline==== ====Compile from the commandline====
-# Launch the 'Visual Studio .NET 2003 Command Prompt' (under Start / Programs / Visual Studio .NET / Visual Studio .NET Tools)+# Launch the 'Visual Studio .NET 2005 Command Prompt' (under Start / Programs / Visual Studio .NET / Visual Studio .NET Tools)
# CD to the WorldWind source root. # CD to the WorldWind source root.
# Run 'Devenv.exe WorldWindow.sln /build Debug' # Run 'Devenv.exe WorldWindow.sln /build Debug'
# Run 'Devenv.exe WorldWind.sln /build Debug' # Run 'Devenv.exe WorldWind.sln /build Debug'
-* Replace 'Debug' with 'Release' as desired+:Replace 'Debug' with 'Release' as desired
-* As of 1.3.0 the references in the Release build point to /Debug dll's. So to /rebuild a release, /rebuild debug first.+:As of 1.3.0 the references in the Release build point to /Debug dll's. So to /rebuild a release, /rebuild debug first.
==Data Setup== ==Data Setup==
Line 55: Line 51:
#If you already have a version of World Wind installed, and you already have files on your PC's harddisk that you want to make use of: #If you already have a version of World Wind installed, and you already have files on your PC's harddisk that you want to make use of:
##Cache files - use either of the following: ##Cache files - use either of the following:
-###Copy your existing Cache directory (e.g. C:\Program FIles\NASA\World Wind\Cache) to be a subdirectory of the directory containing your compiled source code's executable file (e.g. C:\wwdev\WorldWind\Cache)+###Copy your existing Cache directory (e.g. C:\Program FIles\NASA\World Wind\Cache) to be a subdirectory of the directory containing your compiled source code's executable file (e.g. C:\wwdev\bin\debug\Cache)
-###If you already have a version of World Wind installed, and you already have files cached on your PC's harddisk that you want to make use of, then you can change your compiled version of World Wind to point to that existing directory. Following the instructions above, open WorldWind.sln, then edit the App.Config file key "CacheDirectory" to point to your exisiting Cache directory, save the change, then compile WorldWind.+###If you already have a version of World Wind installed, and you already have files cached on your PC's harddisk that you want to make use of, then you can change your compiled version of World Wind to point to that existing directory. Run World Wind, press Alt+Q, then change the Cache path to point to your exisiting Cache directory, close the window, then restart World Wind.
-##Blue Marble files:+
-###The following is subject to the resolution of [http://issues.worldwind.arc.nasa.gov/browse/WW-196 Issue WW-196].+
-###There should be two DDS files in your C:\wwdev\WorldWind\bin\Debug\Data\Earth\BlueMarbleTextures directory+
-###In the \Data\Earth\BlueMarbleTextures directory located in the program directory for your existing copy of World Wind, there should be directories named 0, 1, 2, 3. Copy these directories to your C:\wwdev\WorldWind\bin\Debug\Data\Earth\BlueMarbleTextures directory+
-###Edit the C:\wwdev\WorldWind\bin\Debug\Config\Earth\Images.xml file:+
-####On the line immediately above <code><Name>Blue Marble Tiled (1km per pixel) Local</Name></code> change ShowAtStartup="false" to ShowAtStartup="true"+
-####On the line immediately above <code><Name>Blue Marble Tiled (1km per pixel) Online</Name></code> change ShowAtStartup="true" to ShowAtStartup="false"+
-####Save the changes to Images.xml+
==Run Your Compiled Code== ==Run Your Compiled Code==
-Your newly built WorldWind should now be ready to go. Double click on WorldWind.exe (e.g. C:\wwdev\WorldWind\WorldWind.exe) and it should start.+Your newly built World Wind should now be ready to go. Double click on WorldWind.exe (e.g. C:\wwdev\bin\Debug\WorldWind.exe) and it should start.
If you make changes to the source files that you would like to compile, just follow the [[#Compile the Code|Compile the Code]] instructions again to recompile, and after the compile, make sure to save the changes. If you make changes to the source files that you would like to compile, just follow the [[#Compile the Code|Compile the Code]] instructions again to recompile, and after the compile, make sure to save the changes.
[[Category:Dev]] [[Category:Dev]]

Revision as of 11:24, 15 February 2007

Compiling the sources allows you to create executables from modified code. The instructions below show you how to compile the lastest code from the SVN repositories.

Contents

Preparation

Install Software

The following software must be installed before starting. See Development Tools for download locations.

Note: If you have already installed Microsoft Visual Studio .NET 2005, you do not need to install the .NET Framework SDK separately. Visual Studio .NET 2005 includes the SDK.
Note: Above is the latest version. World Wind should compile with October 2005 version
  • A SVN client (e.g. TortoiseSVN)
  • Visual Studio 2005 (free Visual C# Express version available from Microsoft)

Get the Source Code

See source code for more information.

Using TortoiseSVN

  1. Create a directory on your drive where you'd like to develop from (eg C:\wwdev)
  2. Right-click in that directory and select "SVN Checkout"
    1. Repository:
      1. URL of repository = https://svn.sourceforge.net/svnroot/nasa-exp/trunk/WorldWind
    2. Revision: if you want to use anything other than SVN HEAD revision, you'll have to select "Revision" radio button, then click the "Show log" button, then select the revision from the list
    3. Click OK, and the source code should be downloaded
    4. Click OK to close the TortoiseSVN window

Compile the Source Code

Compiling using Visual Studio

Compile within Visual C# Express

Replace C:\wwdev\ with your source directory:

  1. Navigate to the following file and double click it:
    1. C:\wwdev\WorldWind\WorldWindow.csproj
    2. or C:\wwdev\WorldWind.sln
  2. From the Build menu, select Build Solution, and in the Output window you should get a message that the build succeeded.
  3. Close Visual Studio
You may choose 'Debug' or 'Release' from the Build->Configuration Manager menu.

Compile from the commandline

  1. Launch the 'Visual Studio .NET 2005 Command Prompt' (under Start / Programs / Visual Studio .NET / Visual Studio .NET Tools)
  2. CD to the WorldWind source root.
  3. Run 'Devenv.exe WorldWindow.sln /build Debug'
  4. Run 'Devenv.exe WorldWind.sln /build Debug'
Replace 'Debug' with 'Release' as desired
As of 1.3.0 the references in the Release build point to /Debug dll's. So to /rebuild a release, /rebuild debug first.

Data Setup

Select one of the following options:

  1. Use a fresh copy of imagery and terrain data - just proceed to the next section to run the compiled code
  2. If you already have a version of World Wind installed, and you already have files on your PC's harddisk that you want to make use of:
    1. Cache files - use either of the following:
      1. Copy your existing Cache directory (e.g. C:\Program FIles\NASA\World Wind\Cache) to be a subdirectory of the directory containing your compiled source code's executable file (e.g. C:\wwdev\bin\debug\Cache)
      2. If you already have a version of World Wind installed, and you already have files cached on your PC's harddisk that you want to make use of, then you can change your compiled version of World Wind to point to that existing directory. Run World Wind, press Alt+Q, then change the Cache path to point to your exisiting Cache directory, close the window, then restart World Wind.

Run Your Compiled Code

Your newly built World Wind should now be ready to go. Double click on WorldWind.exe (e.g. C:\wwdev\bin\Debug\WorldWind.exe) and it should start.

If you make changes to the source files that you would like to compile, just follow the Compile the Code instructions again to recompile, and after the compile, make sure to save the changes.

Personal tools