Building on Windows: Difference between revisions

From NEOSYS Dev Wiki
Jump to navigationJump to search
 
(133 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==Software to install:==
== Setting up Exodus Build Environment on Windows ==


{|cellpadding="5" cellspacing="0" border="1" width="60%"
|Install and configure MS VC++
|[[Step_by_step_instructions#INSTALL_COMPILER]]<BR>You need SDK *and* Visual Studio
|*Ignore the section to "test Exodus compilation - you haven't built it yet!"
|-
|Install and configure Postgresql
|[[Step_by_step_instructions#INSTALL_DATABASE]]
|Ignore any configuration "for Exodus"
|-
|Install Subversion client
|http://tortoisesvn.net/downloads.html
|Ignore its suggestion to reboot after installation.
|-
|Install NSIS Installer Builder
|http://sourceforge.net/projects/nsis/files/
|
|-
|Install Python
|http://python.org/download/
|Only needed to upload binaries to Google Code
|}


# WinRAR.
== Get Boost Libraries ==
# PostgresSQL.
# TortoiseSVN 9(32 bit).
# Boost c++ libraries 1.34.0 .
# Visual Studio C++ Express Edition.
# Downloading & Installing Platform SDK.


==Downloading & Installing WinRAR:==
Install or build Boost 1_46_1 binary libraries and header/include source files.


# Go to www.download.com.
If you are simply building Exodus for packaging and release then you need only the release versions of Boost. You only need Boost debug libraries o develop/debug Exodus itself.
# In the the search engine, type WinRAR.
# Look for WinRAR 3.7, its would normally be first of the download list.
# Click on the big button saying Download WinRAR.
# You come to another web page, wait for a moment, and a little window pop up asking whether to save or run. It would be advisable to save it in a folder called Downloads.<br> (If you haven't already done so).
# There should be a few moments of downloading, depending on your internet connection. Then click Run, then click Run again.
# Click Install.
# A window should pop up called WinRAR set-up, click Ok.
# Done.


==Downloading and Installing PostgresSQL:==
=== Source 1 - build them from source ===


===Part 1: Downloading & Installing PostgresSQL===
[[Building Boost 32/64 on Windows]]


=== Source 2 - download from Exodus project ===


# Go to http://www.postgresql.org/
Header/Includes: [[Building_Boost_32/64_on_Windows#Get_Boost_Source]]
# In the search engine at the top right hand corner copy & paste <B>postgresql-8.1.9-1.zip</b> and press enter.
# Click the one pointed to you by the red arrow<br>[[Image:getpgSQL1.jpg]]<br>if not included, look for something similar, keeping in mind you need the <B>postgresql-8.1.9-1.zip</b>)
# Click on the link shown to you by the red arrow <br>[[Image:FTPbrowser.JPG]]
# Click the link "Win32"
# Click the link "postgresql-8.2.5-1.zip"
# Now a window will pop up asking whether you want to save or run the installation program. Save it in your download folder, if you haven't created one do so. The purpose of having a Download file is that every time you download a big file you save it so that you don't have to waste your time downloading it again. However with small files, there is no point in saving them because of the small amount of time they take to download.
# Look in your download folder for postgresql-8.1.9-1.zip
# Right click on postgresql-8.1.9-1.zip click Extract to postgresql-v8.1.9-1.zip\ 
# Go to the folder you just extracted to in your download folder.
# Double click on the file postgresql-8.1.msi, and to check whether you have the right version, look at the size, is it 134Kb.
# A window should have popped up, saying what language you want to use in the installation. Select your preferred language. (if you have any other windows close them down and SAVE your work)
# This window is important, so don't miss any thing out. Scroll down to Database drivers, and click on the small triangle pointing downwards, a small list of options will appear click "Entire feature will be unavailable".
# Scroll to the very bottom to Development, now just like the other one click on the small triangle pointing downwards and again the options will appear, this time click "Entire feature will be installed on your local driver". Click Next.
# In the next window type into the User name field any random name, as you will not have to remember it. Then click Next. Click Yes. Click Ok.
# In the current window there are some drop down menus you MUST change:
#* The field next to Encoding, use the drop down menu to find UTF-8.
#* The field next to Locale, use the drop down menu to find your language.
# Type in a password and take a note of it and click Next.
# Then you come to a window called Enable contrib modules, tick Tsearch2 near the right hand side and click Next.
# Then to start the Installation click Next.


===Part 2: Set-up & Configuration===
Binaries: http://exodusdb.googlecode.com/files/boost1461-vc100-x86x64-rd.zip


# Go to your start menu, all programs, PostgreSQL 8.1, pgadmin III. Click the close button for the tips.
Unzip the binaries into the main boost source/header/includes like this:
# Double click on PostgreSQL database server 8.1 (Localhost:5432), and it will ask you for the password you took note of in Part1 of the exercise. Type it in.
# On the right hand side of the window there are the files of the SQL Server. To make a new database right click on Database(1)and click the New Database option. Type in NEOSYS into the name field and click Ok.
# On the right hand side of the window look for Login Roles (1), at the bottom of the list.
# Right click it and click the New Login Role.
# Type in NEOSYS into the name field<br>[[Image:loginrole.JPG]]<br>
# Type in a pass and make a note of it.


==Downloading & Installing Tortoise SVN (32bit):==
boost_1_46_1\stage32
boost_1_46_1\stage64


# Go to your browser, copy and paste the web address into your URL "http://subversion.tigris.org/project_packages.html".
=== Source 3 - download from BoostPro (but no x64! and no Unicode regex(?)) ===


# The web page should have a title of "Subversion packets", and have a dark green theme.
Installs includes and binaries.
# Scroll down the page, and look for Windows NT, 2000, XP and 2003.
# Look through the text for "If you want a pretty Win32 GUI, TortoiseSVN integrates nicely with the Window Explorer.", near the bottom. Click on the link highlight in blue (tortoiseSVN).
# Look for "Latest Version" in a green bar and underneath that, in the text look for "download page" and click it.
# You should be looking at a web page with a blue tortoise. The title should also be "TortoiseSVN".
# Look for the subheading "Download Application"
# Click on "TortoiseSVN-1.4.5.10425-win32-svn-1.4.5.msi 32 bit.
# You come to a web page with a URL starting with "http://sourseforge.net/............./",either a window automatically pops up asking whether to save or run, or you right click on a beige horizontal bar at the top of the web browser window, and select "Download file".
# Click Save, and save the file into your download folder. (make a folder named download, if you haven't already done so) then click Run, and click Run again.
# When the TortoiseSVN window set-up pops up, click next.
# Accept the terms, and click next.
# Click next again, then click Install.
# Then installation program will ask you to restart.


See [[Installing_Boost]] but get:
*Version 1_46_1
*Visual Studio 2010
*mt and mt-debug version


===Getting Project Exodus onto your Computer:===
== Checkout Exodus ==


# Go to your desktop, and create a new folder.
To commit any bug fixes or developments, send your gmail address [http://code.google.com/p/exodusdb/people/list here] to get a password.
# Right click on the folder, and got to TortoiseSVN, export.
# This window should pop up:<br>[[Image:tortoiseSVN.JPG]]<br>
# In the URL field type in (or copy and paste) http://svn.neosys.com/svn/trunk and click Ok.
# Another window will pop up, and start listing the files you are importing onto your pc.
# Click Ok, once loading is finished.


For help on how to use: http://devwiki.neosys.com/index.php/Installing_and_Using_Tortoise_Subversion
=== GUI  ===


==Boost C++ Libraries 1.34.0==
#Create a folder called "exodus" F:\exodus
#Right exodus click and choose "SVN checkout"
#url of respository: HTTPS://exodusdb.googlecode.com/svn/trunk/


# Go to http://www.boost-consulting.com/products/free
=== TUI ===
# Click the 2nd download, Boost 1.34.0 Installer.
# Click Run and again.
# Agree to the licenses.
# Click Next.
# Tick the Visual C++ 8.0 (Visual studio 2005).
# Tick the first two Variants.
# Now untick every box except:
#* Boost Header files<br>
#* Boost Start menu shortcut<br>
#* Boost Source and Documentation<br>
#* Tools<br>
#* Boost DateTime<br>
#* Boost FileSystem<br>
#* Boost IOstream<br>
#* Boost ProgramOptions<br>
#* Boost Regex<br>
#* Boost Thread<br>


[[Image:choosingcomp.jpg]] <br>
svn co HTTPS://exodusdb.googlecode.com/svn/trunk/ c:\exodus
9. Click Next, Install. (take note of where you saved boost).


==Downloading & Installing Visual Studio C++ Express Edition:==
You can use all the power of subversion to keep your build directory up to date, select previous versions of Exodus and generally be in control.


# Go to http://msdn2.microsoft.com/en-gb/express/aa700735.aspx
NB always use HTTPS not http for the subversion link below - just in case you need to commit any changes back up into the subversion repository.
# Click on the download button near the top right hand of your screen.
# Scroll down the web page till you see 6 different downloads e.g. Visual Basic, SQL Server and Visual C++.
# Select your language for Visual C++ 2005 Express Edition, as soon as you select your language a "File download" window will pop up, click Run.
# There should be a bit of loading, once finished click Run and again.
# There should be a minute or two of loading, click Next in the Visual Studio C++ set-up.
# Accept the terms and click Yes.
# Tick the Graphical IDE if it hasn't been ticked already and click Next.
# Browse for a location in where you would like Visual Studio C++ (although, it would be best to keep the default location in case something need to find the Visual Studio C++ folder and cannot find it in its default location) then click Next.
# If you have any minor jobs to do, I suggest you do so now as it will take a while, but keep checking on how the installation is coming.
# Then reboot your computer.
# Once your pc is ready look for Visual Studio C++ on icon your desktop, if its not there go to start, all programs in the start menu and look for Visual Studio C++ Edition as shown in the example: <br>[[Image:whereVSC++.jpg]]
# The window below will pop up, telling you that you need to register your copy of Visual Studio C++ Express Edition.
[[Image:registerVSC++.jpg]]


==Downloading & Installing Platform SDK:==
== Configure Exodus for Developing, Building, Packing, Uploading ==


===Part 1: Installing Platform SDK===
copy the configlocalEXAMPLE.cmd to configlocal.cmd and edit it to reflect your configuration. Only configure those stages that you plan to do.


# Go to http://www.microsoft.com/downloads/details.aspx?familyid=0baf2b35-c656-4969-ace8-e4c0c0716adb&displaylang=en.
If you are only building x64 then you don't need to set the x32 variables. Note that BOOST32 and BOOST64 may point to the same folder since the headers/includes are the same and the binaries are in different libs eg stage64 or lib64 etc.
# Click on the <b>Continue</b> button.
# Depending on your internet browser, you might have to install a plug-in. IF not, scroll down the web page and click on the <B>Continue</B> button.
# Click on the link called "Download Files Below" or you can just find the subheading <b>Files in this Download</b>
# There will be list of different types of files, depending on your processor to download. <br>
#* If you have a 64 bit Intel processor download <b>PSDK-ia64.exe</b>
#* If you have a 64 bit AMD processor download <b>PSDK-amd64.exe</b>
#* If you have another processor type, and it's listed on the web site but not here choose that Download.
#* If you have another processor type which is not included in the list on the web page download <b>PSDK-x86.exe</b><br><br>
<br>Extra: If your on a virtual computer, then check the version on windows you are using.
# Save the file into your download folder.
# Then click Run, Then click Run again.
# At the next window, with two button, click Cancel.
# Click Next.
# Agree to the terms, and click Next.
# Do a custom installation, and click Next.
# You come to a stage in the set-up where it asks "In which driver do you want to save you files to?". Pick the drive you prefer. To change from drive to drive you change the beginning of the location. So if you want to save SDK in the C drive, leave it as it is and if you want to save SDK to the D drive, change C to D. Or click browse. Then click Next.
# Click Next again, and wait for the loading.
# Then continue the download, till the end.


===Part 2 Configuring & Compiling===
You can run clean, dev, make, pack, upload etc by just clicking on them without opening a command prompt.


# Run Microsoft Visual Studio C++ Express Edition.
[[configlocalEXAMPLE.cmd]] as at 2010/5/20
# Now go to File, Open, File, Desktop, Exodus, agency, agency.sln and then open.
# You should see:<br>[[Image:newsolutionExplor.JPG]]<br>
# Open agency pointed to you by the red arrow, by clicking on the + sign.
# Remove Market and schedule.
# In the agency folder, open Main then double click on main.cpp
# You should now have C++ code to the right side of the Visual Studio program window.
# Go to Tools, Options, open Project and Solutions and go to VC++ Directoies
# Your window should look like this:<br>[[Image:VSC++EEoptions.JPG]]
# Do the following:
#* Click the drop down menu for Show directories for: and click Include Files, now click the button that looks like a yellow folder and in the field were the cursor is blinking copy an paste the following path, and then press Enter: <b>C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin</b> 
#* Click the drop down menu for Show directories for: and click Include Files, now click the button that looks like a yellow folder and in the field were the cursor is blinking copy an paste the following path, and then press Enter: <b>C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include</b>
#* Click the drop down menu for Show directories for: and click Library files, now click the button that looks like a yellow folder and in the field were the cursor is blinking copy an paste the following path, and then press Enter: <b>C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib</b>
# Then click Ok.
[[Image:errormessage.JPG]]
# Check whether libpq.lib is in C:\Program Files\PostgreSQL\8.1\lib\ms, if not there then change project properties to reflect version on location in where you installed postgreSQL.
# Right click on My computer, properties, advanced, environment variables, system variables, scroll down and find Path, double click it. variable value, go to the end of the path and type a semi-colon, then copy and paste the following path after the semi-colon:<br><b>C:\Program Files\PostgreSQL\8.1\lib\ms</b> and close Visual Studio C++ Express Edition, and then open again.
[[Image:PCconfig.JPG]]


===Update the corewin_express.vsprops file.===
for packing, you need to edit version.cmd, for example
<br>One more step is needed to make the Win32 template work in Visual C++ Express. You need to edit the corewin_express.vsprops file (found in C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults) and<br>
Change the string that reads:<br>
<br>AdditionalDependencies=<b>"kernel32.lib"</b>
<br>to
<br>AdditionalDependencies=<b>"kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"</b><br><br>


===Generate and build a Win32 application to test your paths.===
set EXO_MAJOR_VER=11
<br>In Visual C++ Express, the Win32 Windows Application type is disabled in the Win32 Application Wizard. To enable that type, you need to edit the file AppSettings.htm file located in the folder %ProgramFiles%\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\".
set EXO_MINOR_VER=5
<br>In a text editor comment out lines 441 - 444 by putting a // in front of them as shown here:<br>
set EXO_MICRO_VER=28
<br>// WIN_APP.disabled = true;
set EXO_BUILD_VER=0
<br>// WIN_APP_LABEL.disabled = true;
<br>// DLL_APP.disabled = true;
<br>// DLL_APP_LABEL.disabled = true;<br>
<br> Save and close the file and open Visual C++ Express. <br>


From the File menu, click New Project. In the New Project dialog box, expand the Visual C++ node in the Product Types tree and then click Win32. Click on the Win32 Console Application template and then give your project a name and click OK. In the Win32 Application Wizard dialog box, make sure that Windows application is selected as the Application type and the ATL is not selected. Click the Finish button to generate the project.<br>
== Either Build/Develop Using Visual Studio ==
Compile by pressing F5.<br>
Win32 application should build and run.
<br><br>
BY GREG BUSH 19/10/2007


==Helpful Websites==
The exodus_all.sln relies on environment variables to identify location of boost, postgresql. All the necessary environment variables are set in the fixed config.cmd and your local configlocal.cmd.


# For help on Microsoft Visual Studio C++ Express Edition go to http://msdn2.microsoft.com/en-gb/express/aa700755.aspx
To open visual studio with all the right environment variables set you must run dev.cmd which calls config.cmd and then opens your solution
# For help on Boost go to http://www.boost.org
 
# For help on PostgeSQL go to http://www.postgresql.org/
dev.cmd
# For help on WinRAR go to http://www.win-rar.com/winrarsupport.html
 
# For help on TortoiseSVN go to http://tortoisesvn.tigris.org/
#Select Configuration: Release or Debug
# For how to use tortoiseSVN go to http://devwiki.neosys.com/index.php/Installing_and_Using_Tortoise_Subversion
#Select Platform: x64 or Win32
#Build the solution
#Check the startup project is exodus_cli
#Debug/Run the solution. You should get an exodus/cmd command console.
#Type testsort, edic etc. configexodus may require adminstrator access to install pgexodus.dll into Postgresql's bin directory.
 
== Or Build Using Scripts or Command Line ==
 
Once configlocal.cmd is setup then making is a completely automatic process. Currently configlocal.cmd only supports one configuration/platform (e.g. Release/x64) at a time.
 
make.cmd
clean.cmd
 
== Packaging Exodus ==
 
Once configlocal.cmd is setup then packing is a completely automatic process. Look for output files like exodus-x86-11.5.3.exe.
 
pack.cmd
 
== Uploading Exodus ==
 
Once configlocal.cmd is setup then uploading new versions is a completely automatic process.
 
upload.cmd
 
== Old Info ==
 
[[Building on Windows - Old Version]]

Latest revision as of 14:24, 18 February 2012

Setting up Exodus Build Environment on Windows

Install and configure MS VC++ Step_by_step_instructions#INSTALL_COMPILER
You need SDK *and* Visual Studio
*Ignore the section to "test Exodus compilation - you haven't built it yet!"
Install and configure Postgresql Step_by_step_instructions#INSTALL_DATABASE Ignore any configuration "for Exodus"
Install Subversion client http://tortoisesvn.net/downloads.html Ignore its suggestion to reboot after installation.
Install NSIS Installer Builder http://sourceforge.net/projects/nsis/files/
Install Python http://python.org/download/ Only needed to upload binaries to Google Code

Get Boost Libraries

Install or build Boost 1_46_1 binary libraries and header/include source files.

If you are simply building Exodus for packaging and release then you need only the release versions of Boost. You only need Boost debug libraries o develop/debug Exodus itself.

Source 1 - build them from source

Building Boost 32/64 on Windows

Source 2 - download from Exodus project

Header/Includes: Building_Boost_32/64_on_Windows#Get_Boost_Source

Binaries: http://exodusdb.googlecode.com/files/boost1461-vc100-x86x64-rd.zip

Unzip the binaries into the main boost source/header/includes like this:

boost_1_46_1\stage32
boost_1_46_1\stage64

Source 3 - download from BoostPro (but no x64! and no Unicode regex(?))

Installs includes and binaries.

See Installing_Boost but get:

  • Version 1_46_1
  • Visual Studio 2010
  • mt and mt-debug version

Checkout Exodus

To commit any bug fixes or developments, send your gmail address here to get a password.

GUI

  1. Create a folder called "exodus" F:\exodus
  2. Right exodus click and choose "SVN checkout"
  3. url of respository: HTTPS://exodusdb.googlecode.com/svn/trunk/

TUI

svn co HTTPS://exodusdb.googlecode.com/svn/trunk/ c:\exodus

You can use all the power of subversion to keep your build directory up to date, select previous versions of Exodus and generally be in control.

NB always use HTTPS not http for the subversion link below - just in case you need to commit any changes back up into the subversion repository.

Configure Exodus for Developing, Building, Packing, Uploading

copy the configlocalEXAMPLE.cmd to configlocal.cmd and edit it to reflect your configuration. Only configure those stages that you plan to do.

If you are only building x64 then you don't need to set the x32 variables. Note that BOOST32 and BOOST64 may point to the same folder since the headers/includes are the same and the binaries are in different libs eg stage64 or lib64 etc.

You can run clean, dev, make, pack, upload etc by just clicking on them without opening a command prompt.

configlocalEXAMPLE.cmd as at 2010/5/20

for packing, you need to edit version.cmd, for example

set EXO_MAJOR_VER=11
set EXO_MINOR_VER=5
set EXO_MICRO_VER=28
set EXO_BUILD_VER=0

Either Build/Develop Using Visual Studio

The exodus_all.sln relies on environment variables to identify location of boost, postgresql. All the necessary environment variables are set in the fixed config.cmd and your local configlocal.cmd.

To open visual studio with all the right environment variables set you must run dev.cmd which calls config.cmd and then opens your solution

dev.cmd
  1. Select Configuration: Release or Debug
  2. Select Platform: x64 or Win32
  3. Build the solution
  4. Check the startup project is exodus_cli
  5. Debug/Run the solution. You should get an exodus/cmd command console.
  6. Type testsort, edic etc. configexodus may require adminstrator access to install pgexodus.dll into Postgresql's bin directory.

Or Build Using Scripts or Command Line

Once configlocal.cmd is setup then making is a completely automatic process. Currently configlocal.cmd only supports one configuration/platform (e.g. Release/x64) at a time.

make.cmd
clean.cmd

Packaging Exodus

Once configlocal.cmd is setup then packing is a completely automatic process. Look for output files like exodus-x86-11.5.3.exe.

pack.cmd

Uploading Exodus

Once configlocal.cmd is setup then uploading new versions is a completely automatic process.

upload.cmd

Old Info

Building on Windows - Old Version