系统要求

我们已经在 linux CentOs 6.2 x86_64 CentOS 6.6 x86_64 系统做了测试。GCC 版本应该为 4.47 或更高。

项目 要求
操作系统 Linux , 例如 CentOS , Ubuntu 等等
架构 x86_64
磁盘容量 取决于数据集大小
内存空间 取决于数据集大小
glibc 版本 >= 2.14
gcc 版本 >= 4.8
g++ 版本 >= 4.8
make 需要安装
boost 版本 >= 1.54
readline 需要安装
readline-devel 需要安装
libcurl-devel 需要安装
openjdk 使用 Java api 时需要
openjdk-devel 使用 Java api 时需要
requests 使用 python http api 时需要
pthreads 使用 php http api 时需要
curl-devel 使用 php http api 时需要
node 使用 nodejs api 时需要,版本 >= 10.9.0
realpath 使用 gconsole 时需要
ccache 可选,可以加速编译过程


注意事项

为了方便环境设置, gstore/scripts/setup 文件夹下为不同的 Linux 发行版本提供了脚本。请在 root (或 sudo )权限下根据你的系统选择相应的安装脚本。(对于 CentOS 系统,你需要自己安装 boost-devel 。)

1. 一些包的名字可能在不同平台上有所不同,只需要安装你自己的操作平台所对应的包

2. 要安装 readline readline-devel ,只需要在 Redhat/CentOS/Fedora 中输入 dnf install readline-devel ,或者在 Debian/Ubuntu 中输入 aptget install libreadline-dev 。请在其他系统中使用对应的指令。如果你
使用的是
ArchLinux ,只要输入 pacman -S readline 就可以安装 readline readline-devel 。(其他包也一样)

3. 使用 gStore 不需要安装 realpath ,但如果你想要使用 gconsole ,请输入 dnf install realpath apt-get install realpath 进行安装。

4. 我们的项目使用了正则表达式,由 GNU/Linux 默认提供。

5. gStore 使用了 ANTLR3.4 生成 SPARQL 查询的语法分析代码。你不需要安装相应的 antlr 库,因为我们已经将 libantlr3.4 融入系统中。

6. 当你在 gStore 项目的根目录下输入 make 时, Java api 也会编译。如果你的系统里没有 JDK ,你可以修改 makefle 。我们建议你在 Linux 系统中安装 openjdk-devel

7. CentOS 系统上你需要添加 epel 源才能安装 ccache ,但在 Ubuntu 系统上可以直接用 apt-get install ccache 命令安装。如果你无法安装 ccache(或者不想安装),请修改 makefle 文件(只需要将 CC 变量改为 g++ 即可)。

8. 如果要使用 gStore HTTP 服务,则必须安装 boost 开发库(比如 boostdevel ,包括用于开发的 boost 头文件),且版本不能低于 1.54 。注意检查 makefle boost 库的安装位置。要使用 Python 接口,在 CentOS 中,你需要输入 pip install requests 来安装 requests 。要使用 php 接口,你需要使用如下命令安装 pthreads curl

1- 安装 curl-devel

# yum install curl-devel

2- 下载 php

# wget -c http://www.php.net/distributions/php-5.4.36.tar.gz

下载 pthreads

# wget -c http://pecl.php.net/get/pthreads-1.0.0.tgz

3- 解压

# tar zxvf php-5.4.36.tar.gz

# tar zxvf pthreads-1.0.0.tgz

4- pthreads 移动到 php/ext 文件夹

# mv pthreads-1.0.0 php-5.4.36/ext/pthreads

5- 重新配置

# ./buildconf --force

# ./configure --help | grep pthreads

你应该能看到上述命令列出了 --enable-pthreads

如果没有,用这个命令清除生成文件:

# rm -rf aclocal.m4

# rm -rf autom4te.cache/

# ./buildconf --force

6- php 文件夹中运行配置命令

# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc --with-curl

7- 安装 php

运行 make clear 以确保没有其他生成文件干扰

# make clear

# make

# make install

8- 复制 PHP 的配置文件,将本地库添加到 include 路径

# cp php.ini-development /etc/php.ini

编辑 php.ini Include_path 如下设置:

Include_path = "/usr/local/lib/php"

9- 安装 node

# wget https://npm.taobao.org/mirrors/node/v10.9.0/node-v10.9.0.tar.gz

# tar -xvf node-v10.9.0.tar.gz

# cd node-v10.9.0

# ./configure

# make

# sudo make install

10- 检查模块

# php -m (check pthread loaded)

你应该看到上述命令列出了 pthread

11- 如果没有列出 pthread ,更新 php.ini

# echo "extension=pthreads.so" >> /etc/php.ini