Chinaunix首页 | 论坛 | 博客
  • 博客访问: 24459
  • 博文数量: 15
  • 博客积分: 26
  • 博客等级: 民兵
  • 技术积分: 155
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-21 11:21
文章分类

全部博文(15)

文章存档

2015年(10)

2014年(5)

我的朋友

分类: 数据库开发技术

2015-04-07 00:25:50

VxWorks examples

VxWorks应用程序中采用传统常规的内存数据库需要如下的链接:

-lmcolib -lmcovtmem -lmcomem -lmcoseri -lmcosvxn
-lmcomconv -lmcotmursiw -lmcolib -lmcouwrt

VxWorks应用程序中采用共享内存和混合版数据库需要如下链接:

一个Vxworks应用使用eXtremeDB混合版建立共享内存数据库,需要如下的链接:
-lmcolib -lmcovtdsk -lmcomem -lmcofuni -lmcoseri
-lmcosvxshm -lmcompsx -lmcotmursiw -lmcolib -lmcouwrt

以上两个示例都使用的是MURSIW的事务管理器。如果采用MVCC事务管理则需要改为如下链接:

-lmcolib -lmcovtmem -lmcomem -lmcoseri -lmcosvxn
-lmcomconv -lmcotmvcc -lmcolib -lmcouwrt

(请参阅以上不同需求的示例项目应用于不同的应用中)

为便于参考,以下列表标明了库之间的依赖性和在链接表里如何指定:
-lmcolib ... -lmcotmursiw -lmcolib ...
-lmcolib ... -lmcotmvcc -lmcolib ...
-lmcolib ... -lmcotexcl -lmcolib ...
... -lmcoapi -lmcosql -lmcoapi ...
... -lmcoapi -lmcosql -lmcoapi -lmcorsql ...
... -lmcohv -lmcoews_cgi_cud -lmcouda ...
... -lmcohv_sql -lmcoews_cgi_cud -lmcouda -lmcoapi
-lmcosql -lmcoapi -lmcoseridsk

... -lmcohv_sql -lmcoews_cgi_cud -lmcouda -lmcoapi
-lmcosql -lmcoapi -lmcoseri

Source code configurations
源代码许可可以针对用户不同的应用功能对数据库重新编译,这样将会减少运行时库的足迹 (执行路径) 和应用程序的程序段和数据段的大小。通过在include/mcotarget.h文件中通过#define指定对索引的支持进行编译。
    /* support for indexes */
  #define MCO_CFG_HASH_SUPPORT

  #define MCO_CFG_KDTREE_SUPPORT
  #define MCO_CFG_RTREE_SUPPORT
  #define MCO_CFG_PATRICIA_SUPPORT
 
/* pattern search support */
  #define MCO_CFG_PATTERN_SEARCH
 /*
 * choose to support custom string
    collations in indices

  */
   #define MCO_CFG_COLLATION_SUPPORT
此外,在target/mcolib/mcocfg.h目录里可用指定定义#define
对事件和备份/读取(mco_dv_save()/mco_db_load())进行编译。

#define
MCO_CFG_EVENTS_SUPPORTED
#define  MCO_CFG_SAVELOAD_SUPPORTED

Building eXtremeDB runtime and SDK samples

编译指南的变化取决于你主机平台是类linuxmakefile或其他我们支持的IDEs。这一节主要概述Unix系统、Microsoft Visual Studio, WindRiver’s Tornado IDE and MULTI
IDE for INTEGRITY OS的编译选项。如果需要用在其他环境的,请联系McObject公司。

你所收到的包包含有target/bin目录下目标平台预编译运行库,host/bin目录下的平台编译工具。你可以使用预安装的schema编译器编译eXtremeDB示例,然后你可以在根目录下执行make命令编译eXtremeDB 库。对于单独对象的目录,如下选项描述是不可用的。(比如:不能重新编译数据库运行时库)

UNIX platforms (cygwin included)

如果你决定重新编译运行库或者需要指定命令行参数(如优化选项等),最好是通过命令行选择合适的选项编译eXtremeDB子系统。也可以手动编辑生成子系统makefile文件“/include/header.mak”。有时也有必要在header.mak做一些改变。例如,你需要重新建立共同的事件(工具)(如cprm, mkdir,等)或者设置共同的编译标记(-c,-o,-fPIC等),然而,通常不需要在makefile里做任何改变。

如下命令行选项是可用的:

make
[x64=on|off] [TARGET_PLATFORM=] [TARGET_FLAGS=]
[HOST_PLATFORM=] [HOST_FLAGS=] [DEBUG=on|off]
[SHOW_BUILD_LOG=on] [TARGET_OS_HINT=]





 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 


 
 

 

TARGET_PLATFORM=]
 


 

 

The
  toolchain name for your target platform. If the option is set, the toolchain
  name is used as a prefix when the appropriate toolchain compiler is invoked


 


 

For
  example if the target platform is:


 

TARGET_PLATFORM=mipsel-linux


 


 

The
  compler is invoked as follows:


 


 

gcc


 

mipsel-linux-gcc ... -c file.c -o file.o


 


 

g++


 

mipsel-linux-g++
  ... -c file.cpp -o file.o


 


 


 

 

[HOST_PLATFORM=]


 

 

The
  toolchain name for the host platform (used to rebuild host tools)


 

 

TARGET_FLAGS=


 

 

Additional
  options passed to the target compiler or linker. For example


 


 

TARGET_FLAGS=-m5307


 


 

mipsel-linux-gcc  -m5307 ... -c file.c -o file.o


 


 

To pass
  multiple options (flags), they should be enclosed in quotes:


 


 

TARGET_FLAGS="-mcpu=603e
  -mbig"


 


 


 

 

HOST_FLAGS=
 


 

 

Additional
  options passed to the host compiler or linker


 


 

 

TARGET_OS_HINT


 

 

This
  option is used when it is necessary to pass additional target operating
  system options into the build subsystem. Available options are:


 

uCLinux,
  LynxOS, eCos, OS21


 


 

For
  example, to build uCLinux targets:


 


 

TARGET_OS_HINT=uCLinux


 


 

 

SHOW_BUILD_LOG=on


 

 

Displays
  the build log


 


 

 

DEBUG=on


 

 

Debug
  build (compiler’s debug information)


 


 

 

x64=on
  or x64=off


 

 

Change
  the default compiler behavior and force building either 64-bit or 32-bit
  binaries (only if possible with the toolchain)


 


 

 

OPTIMIZE=size
  or OPTIMIZE=speed


 


 

 

Speed
  or size optimization flags are passed to the compiler


 

 

MCO_LIB_DYNAMIC=disabled
  or MCO_LIB_DYNAMIC=enabled


 

 

Enable/disable
  building of the database runtime in the form of dynamic libraries. Only if
  the target platform allows for dynamic linking


 


 

 

MCO_LIB_STATIC=disabled
  or MCO_LIB_STATIC=enabled


 

 

Enable/disable
  building of the database runtime in the form of static libraries.


 


 

 

STATIC=on


 

 

Force
  building static executables (for example mcocomp).


 


 

 

MCO_USE_ARCH_SFX=on


 

 

Allows
  choosing the target binaries directory. The toolchain name is used as a
  suffix in the directory name,  This
  option is useful when building different targets out of the same source-base
  For example:


 


 

MCO_USE_ARCH_SFX=on 
  TARGET_PLATFORM=mipsel-linux


 


 

The
  target directory would be:


 


 

target/bin-mips
  (instead of the target/bin)


 


 


 

 

Platform-specific
  combinations


 

 

Linux:


 

Supported
  hints are uCLinux, LynxOS, eCos


 


 

CYGWIN_NT-5.1:


 

-mno-cygwin mode, supported target os hints: OS21


 


 

QNX:


 

HOST_PLATFORM
  and TARGET_PLATFORM should include the 
 
platform name as a parameter. Make system generates the compiler names
  as follows according to the QNX naming convention:


 


 

CC =
  nto-gcc


 


 

Sun
  Solaris:


 

HOST_PLATFORM=cc
  and/or TARGET_PLATFORM=cc to use the default compiler/linker instead of gcc.


 


 

 


 

 


 




WindRiver Tornado IDE (Microsoft Windows host)

在你的Vxworks版本的eXtremeDB包里,在目录target/bin下,包含了已经建立好的eXtremeDB运行时库。

这个目录结构反映了目标平台和编译器的使用。

target/bin//
target/bin//
For example:
target/bin/PENTIUMDiab/
target/bin/PENTIUMDiab_Debug/

建立SDK 示例之前,你需要安装WindRiver Workbench IDEWindRiver环境。请参考合适的VxWorks文档。

你的包包含Workbench工程文件,你能将它加载到IDE里。这些工程文件被指定在如下的目录里:

samples/core    (core samples)

samples/sql      (eXtremeSQL samples)

samples/ha       (High Availability
Edition samples)

samples/tl        (Transaction Logging
Addition samples)

为了重新编译运行时库,请使用在/target/bin目录里的workbench工程文件。

请注意,你的包不包含编译SDK例子和运行时库的命令行工具。如果你需要将eXtremeDB建立到你的命令行应用程序构建系统,请联系McObject.


Microsoft Windows (Visual Studio 2008/2010/2012/2013)

Windows版本eXtremeDB包包含预编译eXtremeDB运行时库二进制文件和Microsoft Visual
Studio 2005, 20082010的工程文件。为了使用
这些工程文件,请确保你已安装好了IDE,并加载适合的解决方案文件进IDE。这个工程文件放置在eXtremeDB的第一级目录。

此外,你会发现一个安装在顶层安装目录里的make.bat批处理文件。使用这个文件你可以不使用IDE工具而编译eXtremeDB SDK组件。请确保你已经设置好了你的开发环境。如下有几个参数可供make.bat编译。







 
 


 


 
 


 
 


 
 


 
 


 
 


 

make.bat


 

 

Builds
  samples


 

 

make.bat
  tools


 

 

Builds
  host tools and target libraries


 

 

make.bat
  all


 

 

Builds
  sample and tools


 

 

BUILD_PLT
  switch


 

 

Identifies
  your build platform:


 

WIN32
  or X64


 

 

BUILD_TYPE


 

 

Identifies
  your build tool, provided that you have several installed:


 


 

VC60,
  VS2005 or VS2008


 

 

REBUILD


 

 

Indicates
  whether the binaries should be rebuilt:


 


 

REBUILD=on/off
  (the default value is on)


 

 

SHOW_BUILD_LOG


 

 

Displays
  the build log


 





INTERGITY OS (Multi IDE, Linux
host)
你的根目录包含一个default.gpj文件。确保你的MULTI环境已经配置和加载文件进IDE里。这个default.gpj里包含你所申请的eXtremeDB版本所有可用的工程(例子和运行时库)。比如源代码可以重建数据库运行时,而工程代码却不可以。这有可能是通过Edit/Set build target菜单项改变了编译目标。你也可以为MULTI/INTEGRITY安装改变缺省的位置。

该软件包包含先生成的所有SDK本模式文件。重新生成SDK 示例施文件。使用/samples下的comple-schema.sh文件。

也可以使用命令行编译。如

# cd
eXtremeDB

# /usr/ghs/multi/linux86/gbuild


 Note on “lock” files on Unix systems
Linux(和其他大多数Unix-es)上使用共享内存数据库 eXtremeDB 使用SysV原始同步(同步原语)和共享内存API这两种(这些)API需要在现有文件的名称上来标示同步原语和记忆片段(内存分段)。这些名字由内存段名和数据库名构成。eXtremeDB在用户Home目录生成了如下这些文件名:

.lock” for sync. primitives,

“eXtremeDB.” for memory segments,
“eXtremeDB_registry” for the registry.

通常eXtremeDB在关闭数据库的时会删除所有这些文件。但是如果程序运行失败它将没有机会(被)删除。因此(在这种情况下)开发人员必须采取其他方法来清楚这些文件。

可以通过设置,导出环境变量EXTREMEDB_DIR的值来设置Lock文件生成的路径,从而代替默认的用户目录。例如,在下面的例子中,在命令行中,通过设置,导出环境变量EXTREMEDB_DIR的值,更改samples的应用程序Lock文件生成路径。

export EXTREMEDB_DIR=/tmp ./sample”
保持此目录路径只为在程序执行期间或者
上面的命令使Lock文件生成目录/tmpsamples运行期间有效。或者下面的命令

export EXTREMEDB_DIR=/tmp”
./sample”
保持此目录路径可用直到下次运行“export”或者“unset”命令。

可以保持Lock文件生成目录/tmp在再次设置、导出EXTREMEDB_DIR之前或者在重置EXTREMEDB_DIR值之前有效。

阅读(957) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~