GREAT-ER II Linux How-To ======================== Frank Koormann Intevation GmbH, Germany The target platform for GREAT-ER II is Microsoft Windows 2000 (GREAT-ER is also known to run under "Win98", "Win XP" etc). However, the flexible and independent approach for GREAT-ER II and the choice of software tools also allows to run GREAT-ER II under various GNU/Linux Systems. Requirements ============ You need the source packages GREAT-ER, GREAT-ER-DB and GREAT-ERModel, dagreater, sciparam and Thuban (latest version from the greater-ms3 branch). Its suggested to store all packages in parallel under a master directory. In combination the packages have the following requirements: - Python (>= 2.2.1), http://www.python.org - wxPython (>= 2.4.0, this implies a wxWindows of the same version), http://www.wxpython.org - SQLite (2.8), http://www.hwaci.com/sw/sqlite/ - SQLite Python bindings (0.4.1), http://pysqlite.sourceforge.net/ - proj (4.4), http://www.remotesensing.org/proj/ - Python Numeric Package (version 23.0), http://numpy.sourceforge.net - Python Imaging Library (1.14), http://www.pythonware.com/products/pil/ - ReportLab (1.17), http://reportlab.sourceforge.net/ - Twisted (1.0.0), http://twistedmatrix.com/ - Oracle 8.x client libraries. Install the required packages according to their installation documentation. Database ======== Please follow the installation steps which comes with the Oracle Database installation package. GREAT-ER has been tested with Oracle 8.1.7 under Debian GNU/Linux. For the further use please set at least the following system variables (the path names are examples): export ORACLE_BASE=/opt/oracle export ORACLE_HOME=$ORACLE_BASE/oracle8.1.7 export ORAHOME=$ORACLE_BASE/oracle8.1.7 export TNS_ADMIN=$ORAHOME/network/admin/ export PATH=$PATH:$ORAHOME/bin export LD_LIBRARY_PATH=$ORAHOME/lib:$LD_LIBRARY_PATH export ORACLE_SID=greater GREAT-ER API ============ The GREAT-ER API for Oracle under GNU/Linux is build in three steps: 1. Patch the API files (to switch off some DLL specific stuff) 2. Preprocess the API files 3. Build the shared libraries (during GREAT-ER-DB build) 1. Patch the API ---------------- The API header files contain some DLL specific code which has no equivalent under GNU/Linux. This code has to be switched off. The line numbers are refering to dagreater_3.3.3 (-- marks the original, ++ the new version): daexplib.h, line 34: -- #define DllExport __declspec( dllexport ) ++ #define DllExport daimplib.h, line 35: -- #define DllImport __declspec( dllimport ) ++ #define DllImport 2. Preprocess the API files --------------------------- The GREAT-ER API is implemented using the Oracle embedded SQL environment. Hence the sources (dagreater.pc) have to be processed by the Pro*C compiler in a pre-step. For simpliest used put the lines below into a Makefile placed in the same directory as the API sources. If so you can run the preprocessing with a simple make dagreater.c You may have to adapt the path settings (especially for the gcc) and user ids to your system. You shouldn't store userids/passwords of production systems in the Makefile. Read the Oracle documentation for more information on Pro*C. One pitfall if you are not familiar with Oracle's Pro*C: The database must be running and reachable during the preprocessing step. Makefile: # begin CPP_PROJ=-ML -W2 -GX -O2 -I $ORAHOME/precomp/public -I $ORAHOME/rdbms/demo \ -I $ORAHOME/rdbms/public -I . -D "NDEBUG" -D "_CONSOLE" -D "_MBCS" dagreater.c: dagreater.pc proc parse=full INAME=dagreater.pc auto_connect=yes ireclen=255 \ oreclen=255 maxopencursors=200 release_cursor=yes oname=dagreater.c \ INCLUDE=/usr/lib/gcc-lib/i386-linux/2.95.4/include/ \ INCLUDE=${ORAHOME}/precomp/public INCLUDE=${ORAHOME}/rdbms/demo \ INCLUDE=${ORAHOME}/rdbms/public INCLUDE=. \ SQLCHECK=SEMANTICS CHAR_MAP=STRING USERID=greater200/greater200 # end 3. Build the shared libraries ----------------------------- The libraries are build during the setup of GREAT-ER-DB: - Change to the GREAT-ER-DB directory - Build the API wrapper and compile the API: python setup.py build --oracle-interface-file= Model System and Desktop Client =============================== Model System and Desktop Client do not require a special configuration/build and should run out of the box. In a single user installation the modell system is started automatically when a user was successfully authenticated. To start the GREAT-ER Desktop Client: - Make sure that the packages thuban, GREAT-ER-DB, GREAT-ERModel and sciparam are in the PYTHONPATH - In the GREAT-ER package directory run python GREAT-ER.py - GREAT-ER supports also an automatic DB login during start up, e.g.: python GREAT-ER.py /