linux 下 一步一步安装odb

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.

时间: 2024-10-07 01:23:27

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

Linux下WebSphereV8.5.5.0 安装详细过程

Linux下WebSphereV8.5.5.0 安装详细过程 自WAS8以后安装包不再区别OS,一份介质可以安装到多个平台.只针对Installation Manager 进行了操作系统的区分 ,Websphere产品介质必须通过专门的工具Install Managere安装.进入IBM的官网http://www.ibm.com/us/en/进行下载.在云盘http://yun.baidu.com/share/linkshareid=2515770728&uk=4252782771 中是Linu

linux下ARM交叉编译器的安装

1.下载arm-linux-gcc编译器. 2.将下载好的编译器压缩文件拷贝到linux中,注意不要在windows中解压,因为RAR解压工具解压gzip压缩工具压缩的文件可能会出问题. 尽量将编译器的压缩文件放置到根目录下(其实也不一定是要根目录,但是我自己使用过程中发现有一个厂家提供的编译器没有安装在指定的位置,编译器提示库找不到),这样做的目的是为了尽量减少麻烦.拷贝好之后,在终端使用: # tar xvzf arm-linux-gcc-4.4.3.tar.gz 解压编译器. 3.解压好了

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

ASK: Linux下通过源码编译安装程序(configure/make/make install的作用) configure Linux 平台有各种不同的配置,安装时需要通过 configure 来确定,如:编译器用的是 cc 还是 gcc.不同库文件所在目录等.执行 configure 后会生成 Makefile,Makefile 规定了用什么编译器.编译参数等信息. make 根据 Makefile 中规定的内容进行编译,生成的可执行文件放在当前目录或某个子目录. make install

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

linux下搭建lamp环境以及安装swoole扩展   一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源 输入下面命令: yum -y update 1.安装Apache [[email protected] ~]# yum -y install httpd # 开机自启动 [[email protected] ~]# chkconfig httpd on # 启动httpd 服务 [[email protected] ~]# service httpd s

linux下python升级 及 pymongo安装

由于需要使用列表统计模块collection.Counter,而Counter模块只有在python2.7以上版本才有支持,所以将python2.6升级到2.7.  在linux下升级python,比如从2.6到2.7,大概需要这么几步:    1. 下载python2.7 从这里下载:http://www.python.org/ftp/python/ ,选择需要的版本 2. 安装pyhon2.7 下载好了以后,解压并安装    $ bzip2 -d Python-2.7.tar.bz2 (-d

Linux下基于源码方式安装MySQL 5.6

MySQL为开源数据库,因此可以基于源码实现安装.基于源码安装有更多的灵活性.也就是说我们可以针对自己的硬件平台选用合适的编译器来优化编译后的二进制代码,根据不同的软件平台环境调整相关的编译参数,选择自身需要选择不同的安装组件,设定需要的字符集等等一些可以根据特定应用场景所作的各种调整.本文描述了如何在源码方式下安装MySQL. 1.安装环境及介质#安装环境SZDB:~ # cat /etc/issueWelcome to SUSE Linux Enterprise Server 10 SP3

Linux下搭建无人执守安装服务器

Linux下搭建无人执守安装服务器 实验概述 原理和概念: 1:什么是PXE ? 严格来说,PXE 并不是一种安装方式,而是一种引导的方式.进行 PXE 安装的必要条件是要安装的计算机中包含一个 PXE 支持的网卡(NIC),即网卡中必须要有 PXE Client.PXE (Pre-bootExecution Environment)协议使计算机可以通过网络启动. 网卡中必须有PXE芯片 协议分为client 和 server 端,PXE client 在网卡的 ROM 中,当计算机引导时,BI

linux下服务器守护进程的安装

一.在服务器上安装rstatd守护进程安装步骤:1. 从网上下载rstatd2. 将该文件放到/home/user目录下3. chmod 777 rpc.rstatd----改变该文件读写的权限,拥有所有权限.4. chmod 777 configure ---同上5. ./configure ---配置6. make ---编译7. make install ---安装8. rpc.rstatd ---启动rstatd进程二.在lr中配置从LR里面add measurement, 填写linu

Linux下用Intel编译器编译安装NetCDF-Fortan库(4.2版本后)

本来这个问题真的没必要写的,可是真的困扰我太久%>_<%,决定还是记录一下. 首先,最权威清晰的安装文档还是官方的: Building the NetCDF-4.2 and later Fortran libraries (写此文时,最近版为4.2) 那这个文档最开始就告诉我们,自NetCDF库4.2版本以后,Fortran的库和C的库就要分开build啦!而且要装Fortran的库必须先装好C的库. 所以先装C的库咯:仍然官方文档: Getting and Building NetCDF-C

数据库学习之--Linux下Mysql源码包安装

数据库学习之--Linux下Mysql源码包安装 系统环境: 操作系统:RedHat EL6 DB Soft:  Mysql 5.6.4-m7     Mysql 在linux下的安装方式有两种版本,一种为Binary(二进制),另外一种为Source(源码包),本文为Source Install方式. 1.安装前的准备 解压安装包 [[email protected] ~]$ ls mysql-5.6.4-m7  mysql-5.6.4-m7.tar.gz  mysql-5.6.4-m7.ta