Building on Windows: Difference between revisions

From NEOSYS Dev Wiki
Jump to navigationJump to search
 
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
== New Stuff ==
== Setting up Exodus Build Environment on Windows ==


[[Building ICU 32/64 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
|}


[[Building Boost 32/64 on Windows]]
== Get Boost Libraries ==


==Software to install==
Install or build Boost 1_46_1 binary libraries and header/include source files.


Boost library binaries installer can be obtained from http://code.google.com/p/exodusdb/downloads or boost.org.
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.


# PostgresSQL 8.3
=== Source 1 - build them from source ===
# TortoiseSVN 1.6.10 (but any version should do)
# Boost C++ libraries 1.38.0
# MSVC2005 or MSVS C++ Express Edition 2005 or 2008
# Windows Platform SDK (only if using Express 2005).


or
[[Building Boost 32/64 on Windows]]
 
# PostgresSQL 9.0
# TortoiseSVN 1.6
# Boost C++ libraries 1.43.0
# MSVC 2010 Express
 
== Installation Locations ==
 
If not installing on C: drive, keep everything on the same drive (and with the exception of the exodus source/build folder) in the standard directory tree otherwise you will have to modify the project settings to point to the right include and lib folders.
 
D:\Program Files\boost\boost_1_38_0
D:\Program Files\PostgreSQL\8.3
D:\exodusdb
 
D:\exodusdb could be in your desktop (D:\Documents and settings\steve\Desktop\exodusdb) but harder to operate some console command building commands if put there
 
[[Installing Postgres]]
 
[[Installing Tortoise Subversion]]
 
[[Installing Boost]]
 
[[Installing Visual Studio Express C++]]
 
==Getting Project Exodus onto your Computer:==
 
Using the command console
 
# Get a command console
# c:
# cd \
# EITHER: FOR COMMITTER: "svn checkout https://exodusdb.googlecode.com/svn/trunk/ exodusdb"
# OR: FOR NONE-COMITTER: "svn checkout https://exodusdb.googlecode.com/svn/trunk/ exodusdb --username YOURCOMMITTERACCOUNT@gmail.com"
 
Using Windows
 
Use https and you will be asked for your google account only if and when you commit anything.
 
# Go to your C: (or other drive) root folder desktop, and create a new folder.
# Right click on the folder, and click TortoiseSVN, checkout.
# In the URL field put https://exodusdb.googlecode.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
 
==Building Exodus - All==
 
#Open the exodus_all.sln file in the new folder that you created.
#In the solution view, right click "Solution exodus_all" and select "Build"
 
== Possible Problems During Building ==
 
=== error: postgres.h not found ===
 
Your include folders are not pointing to the postgresql include folder.
 
=== error: "errcode redefinition ... " in elog.h ===


Error 1 error C2365: 'errcode' : redefinition; previous definition was 'typedef' d:\program files\postgresql\8.3\include\server\utils\elog.h 105
=== Source 2 - download from Exodus project ===


then double click the error to open the offending file and comment out the offending line as follows:
Header/Includes: [[Building_Boost_32/64_on_Windows#Get_Boost_Source]]


//extern int errcode(int sqlerrcode);
Binaries: http://exodusdb.googlecode.com/files/boost1461-vc100-x86x64-rd.zip


=== error: Cannot open include file: 'libintl.h' ===
Unzip the binaries into the main boost source/header/includes like this:


  Compiling...
  boost_1_46_1\stage32
pgexodus.c
  boost_1_46_1\stage64
  c:\program files\postgresql\8.3\include\server\c.h(96) : fatal error C1083: Cannot open include file: 'libintl.h': No such file or directory


just make an empty file called libintl.h as follows: (substitute the postgres version that you are using (see postgres.vsprops)
=== Source 3 - download from BoostPro (but no x64! and no Unicode regex(?)) ===


\Program Files\PostgreSQL\8.3\include\server\port\win32\libintl.h
Installs includes and binaries.


=== cannot open file libboost... ===
See [[Installing_Boost]] but get:
*Version 1_46_1
*Visual Studio 2010
*mt and mt-debug version


LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc90-mt-gd-1_38.lib'
== Checkout Exodus ==
LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-gd-1_38.lib'
LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1_38.lib'
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc90-mt-gd-1_38.lib'
LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_38.lib'


Make sure that you have installed the right boost libraries for your version of Visual Studio.
To commit any bug fixes or developments, send your gmail address [http://code.google.com/p/exodusdb/people/list here] to get a password.


1.43 works with all VS versions
=== GUI  ===


up to 1.42 only works with up to VS2008
#Create a folder called "exodus" F:\exodus
#Right exodus click and choose "SVN checkout"
#url of respository: HTTPS://exodusdb.googlecode.com/svn/trunk/


*Compiler: Visual C++ 9.0 (Visual Studio 2008) or
=== TUI ===
*Variants: Multithread and Multithread Debug
*Components: (1)Date and Time (2)Filesystem (3)Regex (4)System (5)Thread


=== Declaring the dll in Postgres ===
svn co HTTPS://exodusdb.googlecode.com/svn/trunk/ c:\exodus


After copying the pgexodus.dll to the postgres library folder you can run configexodus to configure postgres automatically, or perform the following procedure.
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.


You must login as a postgres superuser to do the following since the C language is not trusted.
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.


In pgadmin or some other tool, select the "POSTGRES" database
== Configure Exodus for Developing, Building, Packing, Uploading ==


Run the following as an sql command to create the necessary special functions that exodus requires to perform dictionary extractions for sort/select etc.
copy the configlocalEXAMPLE.cmd to configlocal.cmd and edit it to reflect your configuration. Only configure those stages that you plan to do.


For more info, see Dynamic loading at http://www.postgresql.org/docs/current/static/xfunc-c.html
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.


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


== Granting Exodus access to Postgres ==
[[configlocalEXAMPLE.cmd]] as at 2010/5/20


Use pgadmin to create a user role with whichever role privileges you wish and a database.
for packing, you need to edit version.cmd, for example


Any roles that you do not grant exodus will have to be performed using pgadmin or other postgres management tools.
set EXO_MAJOR_VER=11
set EXO_MINOR_VER=5
set EXO_MICRO_VER=28
set EXO_BUILD_VER=0


CREATE ROLE exodus LOGIN
== Either Build/Develop Using Visual Studio ==
  PASSWORD 'somesillysecret'
  CREATEDB CREATEROLE;


CREATE DATABASE exodus
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.
  WITH ENCODING='UTF8'
      OWNER=exodus;


== Running Exodus ==
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


#In the solution explorer view, right click "exodus_cli"
dev.cmd
#Set as startup project.
#Run Exodus CLI from the menu ... Debug, Start Debugging.


== Possible Problems During Execution ==
#Select Configuration: Release or Debug
#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.


=== libpq.dll ===
== Or Build Using Scripts or Command Line ==


[[Image:errormessage.JPG]]
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.
# Check whether libpq.dll is in C:\Program Files\PostgreSQL\8.3\lib\????, 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.3\lib\ms</b> and close Visual Studio C++ Express Edition, and then open again.
[[Image:PCconfig.JPG]]


=== ssleay32.dll ===
make.cmd
clean.cmd


There are dozens of versions of this open source secure sockets library which are widely used by many vendors some of whom very wrongly install them in the windows\system32 folder which has precedence after the local folder but before the path is searched. postgres requires them and will use the wrong version.
== Packaging Exodus ==


The simplest solution is often to delete them.
Once configlocal.cmd is setup then packing is a completely automatic process. Look for output files like exodus-x86-11.5.3.exe.


del c:\Windows\system32\ssleay32.dll
pack.cmd
del c:\Windows\system32\libeay32.dll


If you cannot delete them then try rebooting. If that doesnt work then find out which program has them open using some dll search facility like sysinternals procexplorer.
== Uploading Exodus ==


Another solution is simply to upgrade them to the latest version of the files that you can find on your computer or on the web or from the postgres bin folder. See properties not the file date.
Once configlocal.cmd is setup then uploading new versions is a completely automatic process.


INITIAL VERSION BY GREG BUSH 19/10/2007
upload.cmd


==Helpful Websites==
== Old Info ==


# For help on Microsoft Visual Studio C++ Express Edition go to http://msdn2.microsoft.com/en-gb/express/aa700755.aspx
[[Building on Windows - Old Version]]
# For help on Boost go to http://www.boost.org
# For help on PostgeSQL go to http://www.postgresql.org/
# For help on WinRAR go to http://www.win-rar.com/winrarsupport.html
# For help on TortoiseSVN go to http://tortoisesvn.tigris.org/
# For how to use tortoiseSVN go to [[Installing_and_Using_Tortoise_Subversion]]

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