primecoin-xpmpool-compile
编译 xpmpool
安装 gcc 4.9
boost 1.55 版本以下需要使用 gcc 4.9 以下的版本 因为 ABI 兼容性问题导致
// 检查一下版本信息,如果高于 4.9 需要重装 |
详细说明:
This is essentially a won’t fix. compiling boost with gcc5, which uses
C++11 ABI, changes boost ABI and breaks most reverse dependencies.
The boost maintainer decided against backporting fixes to older
boost1.55, and rename the sonames throughout as that would be
non-standard.
Boost 1.58 and later is the default in testing and unstable, and it
uses gcc5 and thus the C++11 ABI.
Thus your options are to use:
(a) gcc4.9 or lower, C++98 ABI, and debian’s boost1.55 or lower.
(b) gcc5 or better, C++11 ABI, and debian’s boost1.57 or better.
编译 boost 1.46.1
// 查看版本 |
编译可能遇到的问题:
/usr/include/boost/config/requires_threads.hpp:29:4: error: |
这是因为boost是根据编译器的宏定义来判断gcc是否支持多线程,但是gcc 4.7及以上的版本使用的宏与老版本使用的宏不同,这样,boost自然就不能正确获取gcc支持多线程的宏,从而导致不能成功编译boost_thread支持的程序。解决办法是在boost/config/stdlib/libstdcpp3.hpp文件的:
#ifdef __GLIBCXX__ // gcc 3.4 and greater: |
修改为
# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ |
./boost/thread/xtime.hpp:23:5: error: expected identifier before numeric constant |
修改 TIME_UTC 为 TIME_UTC_ 和 std 的冲突了
// 下面使用 stage 了这里的 prefix 就无效了 |
如果是自定义目录需要添加环境变量
修改/etc/profile, 文件末尾添加
export BOOST_INCLUDE="your install path "/include |
在/etc/profile.d/ 中新建一个shell文件boost.sh
#!/bin/sh |
source /etc/profile.d/boost.sh
以后在编译程序的时候,只需要加上 :-I$BOOST_INCLUDE_PATH - L$BOOST_LIB_PATH
卸载
将/usr/local/lib和/usr/local/include/boost两个目录下的文件直接删除就可以。
编译 wt 3.3.2
CMake 2.6,找不到 boost 换 2.8
CMake (>= 2.4), and
./bootstrap |
wt3.3.10 需要 cmake 2.12 以上
编译依赖包
- ZEROMQ message system
- Google protobuf protocol
- libwt database abstraction
- libwt webserver
- Postgres SQL server
ZEROMQ, czmq, protobuf : ./configure; make; sudo make install;make clean
Postgres SQL server 9.6.9 源码编译
sudo apt-get install libreadline-dev |
然后需要创建数据库
进入控制台 |
编译 wt 需要
使用 CMake 2.8
C++ boost library (preferably version 1.46.1 or higher)
cd wt-x.x.x
mkdir build
cd build
配置
cmake -DBOOST_ROOT=/home/tyler/Documents/boost_1_46_1 -DBOOST_DIR=/home/tyler/Documents/boost_1_46_1 -DBOOST_INCLUDE_DIRS=/home/tyler/Documents/boost_1_46_1 -DBOOST_LIB_DIRS=/home/tyler/Documents/boost_1_46_1/stage/lib -DENABLE_POSTGRES=on -DPOSTGRES_PREFIX=/usr/local/pgsql/ -DWT_CPP_11_MODE=-std=c++11 ../
如果失败了,
ccmake ../
or
cmake-gui ../
编译
make -j 2
sudo make install
编译过程如果有问题:
Linking CXX executable test.sqlite3
../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlopen
../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlclose
../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlerror
../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlsym
检查 libdl.so 是否存在,如果没有安装下面的库apt install libc6-dev-i386
修改 D:\wt-3.3.2\test\CMakeLists.txt
找到 HAVE_SQLITE,在 TARGET_LINK_LIBRARIES 语句的最后面加上 dl 链接库
compiled library path: /usr/local/lib/
编译 openssl 1.0.2p
openssl version -a |
如果不指定–prefix和–openssldir, 那么, 生成的文件在
/usr/local/include, /usr/local/lib, /usr/local/ssl这三个目录下
–prefix是指定include和lib install路径
–openssldir是指定bin certs man misc openssl.cnf private的安装路径
export OPENSSL_INCLUDE_PATH=”/usr/local/include/openssl/“
export OPENSSL_LIB_PATH=”/usr/local/lib/“
1.0.1k 版本,如果提示 SSLv2_method 找不到。
修改 ssl/s2_meth.c 文件 77 行,增加下面三个方法原来的三行删掉
参见
IMPLEMENT_ssl2_meth_func(SSLv2_method, |
编译 primecoind
根据上面编译的配置,修改 makefile.unix 的相关依赖路径
export BOOST_INCLUDE_PATH=/home/tyler/Documents/boost_1_46_1
export BOOST_LIB_PATH=/home/tyler/Documents/boost_1_46_1/stage/lib
需要编译以下berkeley db db-4.8.30.NC
tar -xvf db-4.8.30.NC.tar.gz |
export BDB_LIB_PATH=$BDB_PREFIX/lib
export BDB_INCLUDE_PATH=$BDB_PREFIX/include
export BDB_LIB_SUFFIX=-4.8
进入目录 primeserver/src 执行make -f makefile.unix > log.txt 2>&1
启动服务
第一次运行需要创建数据库 |