aboutsummaryrefslogtreecommitdiff
path: root/INSTALL
blob: 4efd0ca1e5c1fa7a048a6097be296bb806b8b631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
In this document we use <database> to refer to the name of the database
system you would like to use. Valid values for <database> are:

  'mysql'  - The MySQL database system
  'sqlite' - The SQLite database system

Prerequisites
=============

  - odb                     http://www.codesynthesis.com/products/odb/
  - libodb                  http://www.codesynthesis.com/products/odb/
  - libodb-tracer           http://www.codesynthesis.com/products/odb/
  - libodb-<database>       http://www.codesynthesis.com/products/odb/
  - libodb-boost (optional) http://www.codesynthesis.com/products/odb/
  - boost (optional)        http://www.boost.org

Building on UNIX
================

The following build instructions are for the Linux/UNIX/Mac OS X
operating systems as well as for Cygwin and MinGW on Windows.

The standard autotools-based build system is used on these platforms.
After unpacking the source code archive, change to the odb-tests
package directory (referred to as odb-tests/ from now on) and run
the configure script, for example:

./configure --database <database>

To see the available configuration options run configure with --help:

./configure --help

The required --database option specifies the database system you would
like to use.

The configure script expects the directory where the ODB compiler
binary is installed to be in the executable search path (the PATH
environment variable). If that's not the case, you can use the ODB
configure variable to specify the path to the ODB compiler, for
example:

./configure ODB=/opt/odb/bin/odb

If the ODB compiler is not installed and you would like to run it
from its build directory instead, you can use the --with-odb configure
option to specify the build directory, for example:

./configure --with-odb=/tmp/odb

The configure script also expects the libodb, libodb-tracer,
libodb-<database>, and, if you would like to build the boost profile tests,
libodb-boost and boost headers and libraries to be installed in a directory
where the C++ compiler and linker will search for them by default (normally
/usr and /usr/local). If these libraries are installed in other directories,
you can use the CPPFLAGS and LDFLAGS configure variables to specify their
locations, for example:

./configure CPPFLAGS=-I/opt/libodb/include LDFLAGS=-L/opt/libodb/lib

If these libraries are not installed and you would like to use their
build directories instead, you can use the --with-libodb,
--with-libodb-tracer, --with-libodb-<database>, --with-libodb-boost, and
--with-boost configure options to specify their locations, for example:

./configure --with-libodb=/tmp/libodb

For the boost build directory the configure script expects to find the
boost libraries in the stage/lib/ subdirectory.

For each <database> value the configure script has a set of options in
the form --with-<database>-* that allow you to specify various database
system parameters, such as the login name, password, and database name,
that should be used when running the tests. Run configure with
--help to see the available options for your database.

As another example, the following configure command uses the specified
C++ compiler and compiles with optimization and without debug information:

./configure CXX=g++-4.5 CXXFLAGS=-O3

Once configuration is complete, run make to build the tests:

make

Once the build is completed successfully you can run the tests using
the check target:

make check


Building on Windows
===================

The following build instructions are for Windows using Microsoft Visual
Studio. If you would like to build odb-tests with GCC either using
Cygwin or MinGW, refer to the "Building on UNIX" section above.

The standard Visual Studio project and solution files are used on this
platform. The provided project files expect the directory where the ODB
compiler binary is installed to be in the executable search path (the
PATH environment variable). They also expect the libodb, libodb-tracer,
libodb-<database>, and, if you would like to build the boost profile tests,
libodb-boost and boost header and import library directories to be in the
VC++ Directories Include and Library search lists. See the INSTALL files
in the ODB library packages for more information on how to setup their
VC++ Directories. For boost, refer to the boost documentation.

There are two ways to build the tests with Visual Studio. After unpacking
the source code archive, you can manually open solution files located in
the tracer\, common\, <database>\, boost\common\, and boost\<database>\
directories in the odb-tests package directory (referred to as odb-tests\
from now on). In the tracer\ directory the solution file is named
tracer-vc<N>.sln. In the common\ and boost\common\ directories they are
named common-<database>-vc<N>.sln. And in the <database>\ and boost\<database>\
directories they are named <database>-vc<N>.sln. Here <N> is the version of
Visual Studio that you are using. Once each solution is open, select the
desired build configuration (Debug or Release) and platform (Win32 or x64)
and build the solution.

Alternatively, you can use the build.bat batch files located in the odb-tests\
and odb-tests\boost\ directories to build all the solutions, for all the
configurations and for all the platforms automatically. The build.bat file
has the following command line interface:

build.bat <database> <N> <conf> <plat> [/Build|/Clean|/Rebuild]

Where <N> is the version of Visual Studio that you are using, <conf> is the
desired configuration (e.g., Debug or Release), and <plat> is the desired
platform (e.g., Win32 or x64). For <conf> and <plat> arguments you can specify
several configurations or platforms. You can also use the 'all' value to build
all configurations and/or all platforms. If no action is specified, the
default is /Build.

Once the build is completed successfully, you can run all the tests using
the test.bat batch file located in the odb-tests\ directory.

Before you can run test.bat, you may need to adjust the database system
parameters, such as the login name, password, and database name, that
should be used when running the tests. To do this, edit the
<database>.options and <database>-driver.bat files located in the
odb-tests\ directory. Once this is, done you can run the tests by
executing the following command from the command prompt:

test.bat <database>