2013/12/25
INFOBRIGHT安装方法:
编译Boost1.46 Windows(静态连接,调试模式,不编译MPI等包):
1、运行bootstrap.bat
2、Bjam.exe install --exec-prefix="D:\GAVA\boost\bin\vc9" --toolset=msvc-9.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave runtime-link=static threading=multi debug
编译:Infobright Windows
1、编译Boost1.46,
2、修改infobright-4.0.7\mysql-5.1.40-comm\CMakeList.txt
加入一行变量设置:
SET(MYSQL_DIR "D:/Gava/infobright-4.0.7/vendor/mysql-5.1.40-comm")
把
# Infobright WINPORT
ADD_SUBDIRECTORY(../../src/storage/brighthouse/win ../../src/storage/brighthouse/win)
根据实际目录结构修改如:
# Infobright WINPORT
ADD_SUBDIRECTORY(../../src/storage/brighthouse/ ../../src/storage/brighthouse/)
3、运行configure.js生成configure.data
cd vendor\mysql-5.1.40-comm\;
cscript win\configure.js
4、打开sql/sql_locale.cc 并另存为utf8格式,把变量MY_LOCALE *my_locales[]除第一行&my_locale_en_US和最后一行NULL外全部注视掉。
5、修改infobright-4.0.7\src\下相关CMakeList.txt
5.1
把infobright-4.0.7\src\storage\brighthouse\win下的CMakeList.txt移动到infobright-4.0.7\src\storage\brighthouse\
给brighthouse\CMakeList.txt增加如下设置
SET(EDITION "community")
SET(BOOST_DIR "D:/Gava/boost_x64/include/boost-1_46")
SET(SOURCE_DIR "D:/Gava/infobright-4.0.7/src/storage/brighthouse")
SET(IB_CPPEXTRAFLAG "/GX")
把
“# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS "-DUSE_SYS_STL")
SET(CMAKE_C_FLAGS "-DUSE_SYS_STL")”
替换为
# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS "-DUSE_SYS_STL -D__BH_COMMUNITY__")
SET(CMAKE_C_FLAGS "-DUSE_SYS_STL -D__BH_COMMUNITY__")
把
“ADD_SUBDIRECTORY(compress)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(system)
ADD_SUBDIRECTORY(memmngr)
ADD_SUBDIRECTORY(handler)
ADD_SUBDIRECTORY(loader)
ADD_SUBDIRECTORY(engine)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(vc)
ADD_SUBDIRECTORY(domaininject)”
替换为
ADD_SUBDIRECTORY(compress)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(system)
ADD_SUBDIRECTORY(handler)
ADD_SUBDIRECTORY(loader)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(vc)
ADD_SUBDIRECTORY(domaininject)
ADD_SUBDIRECTORY(exporter)
ADD_SUBDIRECTORY(types)
ADD_SUBDIRECTORY(util) “
”
5.2把infobright-4.0.7\src\storage\brighthouse\win\下的common-CMakeLists.txt移动到infobright-4.0.7\src\storage\brighthouse\common\下并改名为CMakeList.txt 并修改语法错误,如{SOURCE_DIR}应改为${SOURCE_DIR},{MYSQL_DIR}应改为${MYSQL_DIR},{IB_CPPEXTRAFLAG}应改为${IB_CPPEXTRAFLAG}.
5.3 把brighthouse\win\下其他CMakeList.txt也移动到相应上一级目录的子文件夹(community,win除外;一个文件夹对应一个库)中,如果有些子文件夹在win\下没有对应的CMakeList.txt,则照样子新建。并且,如果有的子文件夹如system还有子文件夹,也要把子文件夹下的那些文件加入。
6、以mysql-5.1.40-comm\CMakeList.txt运行CMake,生成vc2008项目文件MySql.sln
7、打开项目文件,为mysqld子项目增加如下连接库:
“
D:\Gava\src\storage\brighthouse\common\Debug\bh-common.lib
D:\Gava\src\storage\brighthouse\compress\Debug\bh-compress.lib
D:\Gava\src\storage\brighthouse\core\Debug\bh-core.lib
D:\Gava\src\storage\brighthouse\domaininject\Debug\bh-domaininject.lib
D:\Gava\src\storage\brighthouse\exporter\Debug\bh-exporter.lib
D:\Gava\src\storage\brighthouse\handler\Debug\bh-handler.lib
D:\Gava\src\storage\brighthouse\loader\Debug\bh-loader-lib.lib
D:\Gava\src\storage\brighthouse\system\Debug\bh-system.lib
D:\Gava\src\storage\brighthouse\types\Debug\bh-types.lib
D:\Gava\src\storage\brighthouse\util\Debug\bh-util.lib
D:\Gava\src\storage\brighthouse\vc\Debug\bh-vc.lib
“
注意,这些库由MySql.sln的infobright相关子项目生成,文件路径请根据实际情况修改。
如果出现连接不到brighthouse引擎相关函数的情况,请查询相关bh-***子项目,是否已经把这些函数相关的cpp文件加入到该项目。
8、生成mysqld后,如果mysqld --standalone不能运行,请运行mysqld –help查看相关错误情况。同时可以查看日志:D:\mysqld.trace 和infobright-4.0.7\build\sql\data\***.err.
如果运行报如下错误
“open the mysql.plugin table. Please run ...”
请安装Infobright Community Edition 二进制安装版,把安装版的data share两个文件夹拷贝到infobright-4.0.7\build\sql\下
Infobright 优化查询引擎不支持的SQL查询语句
select *from aaa where (a,b)=(1,5);