Introduction

This guide presents step-by-step instructions for installing the ODB system on UNIX-like operating systems, such as GNU/Linux, Solaris, etc. For Mac OS X, first see Installing ODB on Mac OS X. For MinGW/MinGW64 (either directly as past of an IDE such as Qt Creator), first see Installing ODB on MinGW.

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 make check 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.

linux 下 一步一步安装odb的更多相关文章

  1. linux下各安装包的安装方法

    <转>linux下各安装包的安装方法   一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root ...

  2. linux下搭建lamp环境以及安装swoole扩展

    linux下搭建lamp环境以及安装swoole扩展   一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源  我安装的环境是:apache2.2.15+mysql5 ...

  3. (转)linux下weblogic12c集群的安装部署

    本文介绍linux下weblogic12c集群的安装部署,版本12c,其他版本操作会有所不同,但其大体操作基本都是一样的 关于weblogic的集群,在此就不多做介绍了,如果有不了解的朋友可以百度搜索 ...

  4. Linux下通过源码编译安装程序

    本文简单的记录了下,在linux下如何通过源码安装程序,以及相关的知识.(大神勿喷^_^) 一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 库文件: ...

  5. Linux下非root用户如何安装软件

    Linux下非root用户如何安装软件 从windows转移到Linux的用户最开始总会有各种不适,因为这种不适最终放弃linux的不在少数.对于这类人只能说可惜,还没有领略到linux的美好就过早放 ...

  6. linux下Redis与phpredis扩展安装

    ++++++++++++++++++++++++++++++++++++++++++++++linux下Redis与phpredis扩展安装++++++++++++++++++++++++++++++ ...

  7. LINUX下中文语言包的安装(转)

    在安装盘上已经有各种语言包了,我们只需要找到他们,并安装就可以了.中文的是fonts-chinese-3.02-9.6.el5.noarch.rpmfonts-ISO8859-2-75dpi-1.0- ...

  8. linux下使用非root账号安装zabbix-client

    linux下使用非root账号安装zabbix-client使用非root账号rusky登录:[rusky@testServer]#tar zxvf zabbix-2.4.5.tar.gz #cd z ...

  9. [转]在linux下如何判断是否已经安装某个软件?软件安装在哪个目录

    <1>在linux下如何判断是否已经安装某个软件? ++++++++++++++++++++++++++++++++++++++++++ rpm -qa|grep 软件包 ++++++++ ...

  10. Linux下批量管理工具pssh安装和使用

    Linux下批量管理工具pssh安装和使用 pssh工具包 安装:yum -y install pssh pssh:在多个主机上并行地运行命令 pscp:把文件并行地复制到多个主机上 prsync:通 ...

随机推荐

  1. dubbo中拦截生产者或消费者服务方法调用

    比如当前有个需求,需要拦截dubbo的服务提供方或者服务消费方的方法,判断参数中是否包含某个关键字进行拦截阻止执行,那么我们可以通过使用dubbo的SPI机制通过实现Filter类来拦截,话不多说直接 ...

  2. Redis 内存满了怎么办……

    我们知道Redis是基于内存的key-value数据库,因为系统的内存大小有限,所以我们在使用Redis的时候可以配置Redis能使用的最大的内存大小. 1.通过配置文件配置 通过在Redis安装目录 ...

  3. python3—廖雪峰之练习(三)

    列表生成式练习 请修改列表生成式,通过添加if语句保证列表生成式能正确执行: L1 = ['Hello', 'World', 18, 'Apple', None] L2 = [] for x in L ...

  4. Python 入门之流程控制语句

    Python 入门之流程控制语句 1.if判断 (1) 单 if if –-如果 if 条件: 缩进 结果 (官方推荐4个空格,或者一个tab 不能空格和tab混合使用) money = 10 pri ...

  5. Django验证码实现

    1.点击验证码更换新的验证码 2.验证码必须是图片形式的 3.验证码实现的流程 服务端: a. session中保存随机验证码,如:87fs b.把验证码写到一个白板里面制作成图片 c. 在页面中显示 ...

  6. 1-ES简单介绍

    一.ES简单介绍 ES:Elastic Search,一个分布式.高扩展.高实时的搜索与数据分析引警.它可以准实时地快速存储.搜索.分析海量的数据. 1.ES实现原理 a.用户数据提交到ES数据库中 ...

  7. django基础篇06-ModelForm操作及验证

    本文内容主要来自银角大王的博客 学习大纲: 一.ModelForm 二.Ajax - 原生(jQuery) - 伪Ajax操作 三.文件上传(预览) - Form提交 - Ajax文件上传 四. 图片 ...

  8. 划水日记之大哥带我走渗透I

    5/24/19 周五 access注入 先测试是否有漏洞 or nor and 1=1 and 1=2 2. Order by 猜字表端,发现一共有22个 3..然后使用 union select 1 ...

  9. P4513 最大连续字段和 (线段树+区间合并)

    题目链接:https://www.luogu.org/problem/P4513 题目大意:单点修改和求区间最大连续字段和 解题思路:很容易想到是用线段树来做,但是如何进行维护呢? 每个维护区间 [L ...

  10. 039:模版结构优化之include标签详解

    引入模版: 有时候一些代码是在许多模版中都用到的.如果我们每次都重复的去拷贝代码那肯定不符合项目的规范.一般我们可以把这些重复性的代码抽取出来,就类似于Python中的函数一样,以后想要使用这些代码的 ...