Linux Next Step installation ODB

Source: Internet
Author: User

Introduction

This guide presents step-by-step instructions for installing the ODB system on unix-like operating systems, such as gnu/li Nux, Solaris, etc. For Mac OS X, first see Installing ODB on Mac OS X. For MINGW/MINGW64 (either directly as past of the IDE such as Qt Creator), first see Installing ODB on MinGW.

Before can start using ODB in your applications, you'll need to install three essential packages:the ODB compile R ( odb ), the Common Runtime library ( Libodb ), and the Database-specific Runtime library ( L Ibodb-<database> ). The Database runtime Library is specific to the database system, planning to use. For example, if is going to use MySQL and then the database runtime would be Libodb-mysql . If you would the several database systems, install the corresponding runtime libraries for each of the them.

Also choose to install optional ODB packages such as ODB profile libraries, the ODB examples () and the odb-examples test Suite ( odb-tests ). You have need to install a profiles library if you is planning to use the corresponding profiles in your application. Similarly, you have need the examples and test suite if you is interested in building the examples or running the tests.

Prerequisites

In order to build ODB source packages you'll need a C + + compiler. You'll also most likely need a client library for the database system of your choice. For example, for MySQL need the libmysqlclient library. The INSTALL file accompanying each database runtime library have more information on the database-specific prerequisites.

If you plan to build the ODB compiler from source, you'll 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 Inc Luded in the ODB compiler distribution.

Installing the ODB Compiler from a Binary package

If you would the same as the pre-compiled binary package for the ODB compiler and then you have both options:if you are using Debian/ubuntu or one of the RedHat or derivative distributions (Fedora, RHEL, CentOS, etc), then the easiest-to Inst All the ODB compiler are to download the .deb or package for .rpm 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'll bin/ is in the 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 bin/ PATH the directory to the environment variable, for example:

Export Path=/opt/odb-x.y.z-<arch>-linux-gnu/bin: $PATHodb--version  

Note also that and you can move the ODB compiler directory around, you cannot move individual sub-directories or files I Nside it. For example, copying or linking the ODB compiler executable to won't work /usr/local/bin/ .

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 B Uild 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 source package and use the standard libodb Autotools build system to Co Mpile and install it on your machine. Normally, the following commands is sufficient:

./configuremakemake Install  

The file in the package INSTALL libodb contains more detailed build and installation instructions.

Installing the Database Runtime Library

To install the Database-specific Runtime Library, download the source package and use the standard libodb-<database> Autotools build s Ystem to compile and install it on your machine. Normally, the following commands is sufficient:

./configuremakemake Install  

The file in the package contains information on database-specific prerequisites as well as more INSTALL libodb-<database> detailed build and installation instructions.

Installing Profile Libraries

If you would as to install a profile library, download the corresponding source package () and use the standard libodb-<profile> aut Otools build system to compile and install it on your machine. Normally, the following commands is sufficient:

./configuremakemake Install  

The file in the package contains information on profile-specific prerequisites as well as more INSTALL libodb-<profile> detailed build and installation instructions.

Building and Running the Examples

If you would like to build and run the ODB examples, download the package and use the standard odb-examples Autotools build Syste m to compile it on your machine. Normally, the following commands is 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 in how to does this.

Once the build is completed and you can run each example manually from the command line. See the README files accompanying each example for more information on how to does this. Alternatively, you can run all of the examples automatically using the Do check target, for example:

Make check  

The default configuration and when run automatically, the examples would try to connect to the database system on the LO Cal host and use as odb_test both the login name and the database name. Note that by running the examples, you'll overwrite any existing data, May is stored in the odb_test database.

INSTALLthe file in the odb-examples "package" contains more detailed information "on" 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 package and use the standard odb-tests autotools build sys TEM to compile it on your machine. Normally, the following commands is sufficient:

./configure--with-database=<database>make  

checkto run the tests with the make target, for example:

Make check  

In the default configuration the tests would try to connect to the database system on the local host and use as odb_test both The login name and the database name. Note that by running the test suite, you'll overwrite any existing data, May is stored in the odb_test database.

The INSTALL file in the "package odb-tests " contains more detailed information the "To configure, build, and run the test suite."

Linux Next Step installation ODB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.