ODB 下载与安装 (Linux)
http://www.codesynthesis.com/products/odb/download.xhtml
Introduction
This guide presents step-by-step instructions for installing the ODB system on UNIX-like operating systems, such as GNU/Linux, Mac OS X, Solaris, etc.
Before you can start using ODB in your applications, you will need to install three essential packages: the ODB compiler (odb
), the common runtime library (libodb
), and the database-specific runtime library (libodb-<database>
). The database runtime library is specific to the database system you are planning to use. For example, if you are going to use MySQL, then the the database runtime will be libodb-mysql
. If you would like to use several database systems, install the corresponding runtime libraries for each of them.
You may also choose to install optional ODB packages such as ODB profile libraries, the ODB examples (odb-examples
) and the test suite (odb-tests
). You only need to install a profile library if you are planning to use the corresponding profile in your application. Similarly, you only need the examples and test suite if you are interested in building the examples or running the tests.
Prerequisites
In order to build ODB source packages you will need a C++ compiler. You will also most likely need a client library for the database system of your choice. For example, for MySQL you need the libmysqlclient
library. The INSTALL
file accompanying each database runtime library has more information on the database-specific prerequisites.
If you plan to build the ODB compiler from source, you will also need the GCC compiler with plugin support enabled. Alternatively, you can use one of the pre-compiled binary packages in which case a private copy of the GCC compiler is included in the ODB compiler distribution.
Installing the ODB Compiler from a Binary Package
If you would like to use the pre-compiled binary package for the ODB compiler, then you have two options: If you are using Debian/Ubuntu or one of the RedHat or derivative distributions (Fedora, RHEL, CentOS, etc.), then the easiest way to install the ODB compiler is to download the .deb
or .rpm
package for your CPU architecture. For example, for Debian/Ubuntu:
sudo dpkg -i odb_x.y.z-n_<arch>.deb
For RedHat:
sudo rpm -i odb-x.y.z-n.<arch>.rpm
Otherwise, simply download the plain archive for your operating system and CPU architecture and unpack it into a directory of your choice, for example /opt/
. The ODB compiler binary will be in the bin/
directory inside the package directory, for example /opt/odb-x.y.z-<arch>-linux-gnu/bin/
. You can run the ODB compiler by either using the absolute path, for example:
/opt/odb-x.y.z-<arch>-linux-gnu/bin/odb --version
Or you can add the bin/
directory to the PATH
environment variable, for example:
export PATH=/opt/odb-x.y.z-<arch>-linux-gnu/bin:$PATH odb --version
Note also that while you can move the ODB compiler directory around, you cannot move individual sub-directories or files inside it. For example, copying or linking the ODB compiler executable to /usr/local/bin/
will not work.
Installing the ODB Compiler from a Source Package
If you would like to build the ODB compiler yourself, you can download the source package and use the standard autotools build system to compile and install it on your machine. The INSTALL
file in the ODB compiler source package contains more information on the prerequisites and the build procedure.
Installing the Common Runtime Library
To install the common runtime library, download the libodb
source package and use the standard autotools build system to compile and install it on your machine. Normally, the following commands are sufficient:
./configure make make install
The INSTALL
file in the libodb
package contains more detailed build and installation instructions.
Installing the Database Runtime Library
To install the database-specific runtime library, download the libodb-<database>
source package and use the standard autotools build system to compile and install it on your machine. Normally, the following commands are sufficient:
./configure make make install
The INSTALL
file in the libodb-<database>
package contains information on database-specific prerequisites as well as more detailed build and installation instructions.
Installing Profile Libraries
If you would like to install a profile library, download the corresponding source package (libodb-<profile>
) and use the standard autotools build system to compile and install it on your machine. Normally, the following commands are sufficient:
./configure make make install
The INSTALL
file in the libodb-<profile>
package contains information on profile-specific prerequisites as well as more detailed build and installation instructions.
Building and Running the Examples
If you would like to build and run the ODB examples, download the odb-examples
package and use the standard autotools build system to compile it on your machine. Normally, the following commands are sufficient:
./configure --with-database <database> make
Alternatively, you can build each example manually from the command line. The README files accompanying each example contain instructions on how to do this.
Once the build is completed, you can run each example manually from the command line. See the README files accompanying each example for more information on how to do this. Alternatively, you can run all of the examples automatically using the makecheck
target, for example:
make check
In the default configuration and when run automatically, the examples will try to connect to the database system on the local host and use odb_test
as both the login name and the database name. Note that by running the examples you will overwrite any existing data that may be stored in the odb_test
database.
The INSTALL
file in the odb-examples
package contains more detailed information on how to configure, build, and run the examples.
Building and Running the Tests
If you would like to build and run the ODB test suite, download the odb-tests
package and use the standard autotools build system to compile it on your machine. Normally, the following commands are sufficient:
./configure --with-database <database> make
To run the tests use the make check
target, for example:
make check
In the default configuration the tests will try to connect to the database system on the local host and use odb_test
as both the login name and the database name. Note that by running the test suite you will overwrite any existing data that may be stored in the odb_test
database.
The INSTALL
file in the odb-tests
package contains more detailed information on how to configure, build, and run the test suite.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人