Windows: Difference between revisions

From NEOSYS Dev Wiki
Jump to navigationJump to search
No edit summary
Line 1: Line 1:
== Downloading and Installing Exodus ==
http://code.google.com/p/exodusdb/downloads
== C++ Compiler ==
== C++ Compiler ==


If you want to develop programs in Exodus, as opposed to just using the Exodus database or running prepackaged Exodus programs, you need a C++ compiler.
If you want to write or compile Exodus programs on Windows you need a Microsoft C++ compiler. You don't need a C++ compiler to just used the Exodus command line to access the database or run prepackaged Exodus programs.


=== MSVC ===
=== MSVC ===


VS C++ 2003/2005/2008 will all work. A standard install of the free VS Express C++ (2008 currently) preferably in the default location on C: or parallel default location but on the same drive as Exodus. No need for any SQL or options.
*Visual Studio 2003 Professional
*Visual Studio 2005 Professional
*Visual Studio 2005 Express (Requires Platform SDK)
*Visual Studio 2008 Express (works)
*Visual Studio 2010 Express (not known)
 
A standard install of the free VS Express C++ preferably in the default location on C: or parallel default location but on the same drive as Exodus. No need for any SQL or options.


http://www.microsoft.com/Express/vc/
http://www.microsoft.com/Express/vc/


=== Mingw ===
== Postgresql ==


The smallest and quickest command line compiler.
If you want to use Exodus to provide multivalue database functionality then you must already have or install a PostgreSQL database.


http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
http://www.postgresql.org/download/windows


<pre>
Postgres does not have to be on the same server as Exodus but if not, you will not be able to use dictionary entries that are written in Exodus code.
rem path to mingw bin
path c:\mingw\bin;%path%


rem path to exodus runtime dll
=== Windows Postgres plugin ===
path C:\Program Files\Exodus\9.6\bin;%PATH%


rem path to postgres runtime dll
At the moment the Windows installer does not install the pgexodus.dll plugin for postgres automatically and you must copy pgexodus.dll from the installed exodus bin directory to the postgres lib directory (for example).
path C:\Program Files\PostgreSQL\8.3\bin;%path%


rem name and location of exodus link-time library
copy "C:\Program Files\Exodus\10.10\lib\pgexodus-8.dll" "C:\Program Files\PostgreSQL\8.4\lib"
set cc=-lexodus_mingw -L"C:/Program Files/Exodus/9.6/lib/"


rem location of exodus include files like exodus.h
copy "C:\Program Files\Exodus\10.10\lib\pgexodus-9.dll" "C:\Program Files\PostgreSQL\9.0\lib"
set cc= %cc% -I"C:/Program Files/PostgreSQL/8.3/bin/include/"


rem create an exodus program
=== Postgres configuration ===
notepad test.cpp
#include <exodus.h>
program() { println("Hello") }


rem build the program
By default, Exodus assumes the following postgres configuration. This of course is not secure and should only be used for testing purposes.
g++ test.cpp %cc%


rem run the program (needs path to exodus_mingw.dll libpq.dll and mingwm10.dll)
host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10
a.exe
Hello
</pre>
 
=== Qt Creator (mingw) ===
 
Amazing free cross platform IDE. 176Mb
 
http://www.qtsoftware.com/products/developer-tools
 
Add the following to your project file:
 
INCLUDEPATH += "C:\Program Files\Exodus\9.6\include"
LIBS += -L"C:/Program Files\Exodus\9.6\lib" -lexodus_mingw


You also need a path to exodus_mingqw.dll and postgres's pqlib.dll set in your windows environment variables or somehow in qt creator.
The following Exodus command prompts for a postgres admin user and password and creates the default database and password.


  C:\Program Files\Exodus\9.6\bin
  configexodus
C:\Program Files\Postgres\8.3\bin


== Postgres ==
Alternatively, you can use any Postgres utility to create an initial database and user. The user should have database creation rights if you wish to be able to create and drop databases from Exodus but there is no need for the user to have admin rights.


If you want to use Exodus to operate a Pick-style database then you must already have or install a postgres database.
notepad %USERPROFILE%\.exodus
 
If you need calculated dictionary entries or are not prepared to do the simple installation of the postgres exodus plugin yourself then the postgres server needs to run on the same host as exodus, otherwise you can use any remote postgres server version 8+ on any os.
 
If you need to install Postgres then do a standard install of the current version (8.3) preferably in the default location on C: or parallel default location but on the same drive as Exodus.
 
Exodus needs to be granted a postgres username, password and database to work in - and preferably rights to create databases and users. By default, Exodus uses the following to connect or you can put a file called .exodus containing some similar line in your home directory (%USERPROFILE% on windows).


  host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10
  host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10


Use the installed PGAdminIII or your preferred postgres client to create the chosen user and database. If you prefer SQL, use the following:
The following environment variables can override default and .exodus parameters on a one by one basis.
 
CREATE ROLE exodus LOGIN PASSWORD 'somesillysecret' CREATEDB CREATEROLE;
CREATE DATABASE exodus WITH ENCODING='UTF8' OWNER=exodus;
 
Sorry but just at the moment you have to install the pgexodus.dll plugin for postgres manually.
 
copy pg exodus.dll from the exodus bin directory to the postgres lib directory \Program Files\8.3\lib and then using PGAdminIII as postgres superuser run the following SQL
 
[[Installing_%26_Building_all_Components_for_Exodus_on_Windows#Building_and_installing_pgexodus|Installing pgexodus.dll for postgres]]
 
== Downloading and Installing Exodus ==


[http://www.neosys.com/support/exodus.msi http://www.neosys.com/support/exodus.msi]
set EXODUS_HOST=127.0.0.1
set EXODUS_PORT=5432
set EXODUS_DBNAME=exodus
set EXODUS_USER=exodus
set EXODUS_PASSWORD=somesillysecret
set EXODUS_TIMEOUT=10


== Using Exodus ==
== Using Exodus ==


Start, Run, All Programs, Exodus, Exodus Command Prompt
Start, All Programs, Exodus, Exodus Console


Try the following commands.
Try the following commands.
Line 95: Line 68:
{|
{|
!Command !!Comment
!Command !!Comment
|-
|configexodus          ||One time setup of default database and user in postgres (exodus and exodus)
|-
|-
|<U>EDITING AND COMPILING</U>
|<U>EDITING AND COMPILING</U>
|-
|-
|edit test ||Creates a skeleton test.cpp file using nano editor with exodus. edit will compile on exit if saved, so make some change before you exit.
|edic test ||Creates a skeleton test.cpp file using nano editor with exodus. edit will compile on exit if saved, so make some change before you exit.
|-
|-
|test ||Run it
|test ||Run it
Line 104: Line 79:
|compile test ||compile without editing
|compile test ||compile without editing
|-
|-
|edit testsort ||Browse a sample exodus program showing all fundamental database operations including dictionaries and list.
|edic testsort ||Browse a sample exodus program showing all fundamental database operations including dictionaries and list.
|-
|-
|<U>DATABASE OPERATIONS</U>
|<U>DATABASE OPERATIONS</U>
Line 122: Line 97:
|list dict_voc ||if you understand this then you understand your pick
|list dict_voc ||if you understand this then you understand your pick
|-
|-
|edit test_clients SB001 ||you can edit data or dictionaries directly
|edir test_clients SB001 ||you can edit data or dictionaries directly
|-
|-
|delete test_clients SB001 ||useful command line tool
|delete test_clients SB001 ||useful command line tool
Line 139: Line 114:
PGRES_FATAL_ERROR: ERROR:  function exodus_extract_text(bytea, integer, integer, integer) does not exist
PGRES_FATAL_ERROR: ERROR:  function exodus_extract_text(bytea, integer, integer, integer) does not exist


If you have Visual Studio installed try the test project (VS2005+).
== Documentation how to program in Exodus ==
 
No programming manual yet but there is a list of functions in wiki at


Start, Run, All Programs, Exodus, Blank Visual Studio Solution. To run and avoid the "cannot find exodus.dll" message, you have to set the project configuration properties, Debugging, Environment to PATH=..\..\bin.
http://code.google.com/p/exodusdb
[[Unorganised notes about programming in Exodus]]


== Documentation how to program in Exodus ==
== Source code and Exodus development environment ==


Sorry nothing yet but you might be able to work out what functions are available from the following:
http://code.google.com/p/exodusdb has latest full source code and tools to build exodus from scratch on all supported platforms.


include\exodusfuncs.h lists the functions that simulates pickish syntax as close as can be achieved. The functionality however should be identical.
include\exodusfuncs.h lists the functions that simulates pickish syntax as close as can be achieved. The functionality however should be identical.
Line 153: Line 131:
include\mv.h lists the massive var class definition that defines how to write pick in oo object.method() style syntax.
include\mv.h lists the massive var class definition that defines how to write pick in oo object.method() style syntax.


[[Unorganised notes about programming in Exodus]]
Following is not up to date but still informative.
 
== Source code and Exodus development environment ==
 
http://svn.neosys.com/svn/trunk has full source code and tools build exodus from scratch. Also a script make.sh for a basic build and install on linux (redhat but probably works with minor tweaks anywhere).


This devwiki site was initially written more in mind with BUILDING exodus. It will now be updated to reflect USING exodus.
http://devwiki.neosys.com/dox

Revision as of 19:30, 17 October 2010

Downloading and Installing Exodus

http://code.google.com/p/exodusdb/downloads

C++ Compiler

If you want to write or compile Exodus programs on Windows you need a Microsoft C++ compiler. You don't need a C++ compiler to just used the Exodus command line to access the database or run prepackaged Exodus programs.

MSVC

  • Visual Studio 2003 Professional
  • Visual Studio 2005 Professional
  • Visual Studio 2005 Express (Requires Platform SDK)
  • Visual Studio 2008 Express (works)
  • Visual Studio 2010 Express (not known)

A standard install of the free VS Express C++ preferably in the default location on C: or parallel default location but on the same drive as Exodus. No need for any SQL or options.

http://www.microsoft.com/Express/vc/

Postgresql

If you want to use Exodus to provide multivalue database functionality then you must already have or install a PostgreSQL database.

http://www.postgresql.org/download/windows

Postgres does not have to be on the same server as Exodus but if not, you will not be able to use dictionary entries that are written in Exodus code.

Windows Postgres plugin

At the moment the Windows installer does not install the pgexodus.dll plugin for postgres automatically and you must copy pgexodus.dll from the installed exodus bin directory to the postgres lib directory (for example).

copy "C:\Program Files\Exodus\10.10\lib\pgexodus-8.dll" "C:\Program Files\PostgreSQL\8.4\lib"
copy "C:\Program Files\Exodus\10.10\lib\pgexodus-9.dll" "C:\Program Files\PostgreSQL\9.0\lib"

Postgres configuration

By default, Exodus assumes the following postgres configuration. This of course is not secure and should only be used for testing purposes.

host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10

The following Exodus command prompts for a postgres admin user and password and creates the default database and password.

configexodus

Alternatively, you can use any Postgres utility to create an initial database and user. The user should have database creation rights if you wish to be able to create and drop databases from Exodus but there is no need for the user to have admin rights.

notepad %USERPROFILE%\.exodus
host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10

The following environment variables can override default and .exodus parameters on a one by one basis.

set EXODUS_HOST=127.0.0.1
set EXODUS_PORT=5432
set EXODUS_DBNAME=exodus
set EXODUS_USER=exodus
set EXODUS_PASSWORD=somesillysecret
set EXODUS_TIMEOUT=10

Using Exodus

Start, All Programs, Exodus, Exodus Console

Try the following commands.

Command Comment
configexodus One time setup of default database and user in postgres (exodus and exodus)
EDITING AND COMPILING
edic test Creates a skeleton test.cpp file using nano editor with exodus. edit will compile on exit if saved, so make some change before you exit.
test Run it
compile test compile without editing
edic testsort Browse a sample exodus program showing all fundamental database operations including dictionaries and list.
DATABASE OPERATIONS
compile testsort compile the preinstalled test program
testsort Run it to generate some data and inspect the output
listfiles quick tool avoiding need to use any database client
list test_clients text output - no page/column headers just yet sorry
list test_clients (H) html output (port of a LIST replacement in heave use since 2000)
list dict_test_clients nb the underscore after "dict" is required - dict(space)voc wont work
list dict_voc if you understand this then you understand your pick
edir test_clients SB001 you can edit data or dictionaries directly
delete test_clients SB001 useful command line tool
createfile tempfile ditto
deletefile tempfile ditto
createindex test_clients CLIENT_TYPE speeds up select commands on the indexed fields in the traditional way
deleteindex test_clients CLIENT_TYPE filenames are case insensitive, keys and fieldnames are not

If you get the following error then you have not completed the installation of pgexodus.dll function in postgres as described in the section on postgres above.

PGRES_FATAL_ERROR: ERROR: function exodus_extract_text(bytea, integer, integer, integer) does not exist

Documentation how to program in Exodus

No programming manual yet but there is a list of functions in wiki at

http://code.google.com/p/exodusdb Unorganised notes about programming in Exodus

Source code and Exodus development environment

http://code.google.com/p/exodusdb has latest full source code and tools to build exodus from scratch on all supported platforms.

include\exodusfuncs.h lists the functions that simulates pickish syntax as close as can be achieved. The functionality however should be identical.

include\exodusmacros.h lists a few keywords to simplify programming for application programmers not interested in the raw power of c++.

include\mv.h lists the massive var class definition that defines how to write pick in oo object.method() style syntax.

Following is not up to date but still informative.

http://devwiki.neosys.com/dox