Fix building on Ubuntu 18.04 with GCC 7
This commit is contained in:
parent
8678b677bb
commit
8f317e93d6
7 changed files with 87 additions and 34 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
build
|
||||
|
||||
|
|
@ -119,7 +119,11 @@ else( WIN32 ) # Apple AND Linux
|
|||
message( STATUS "Configuring BitShares on Linux" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" )
|
||||
set( rt_library rt )
|
||||
set( pthread_library pthread)
|
||||
#set( pthread_library pthread)
|
||||
set(CMAKE_LINKER_FLAGS "-pthread" CACHE STRING "Linker Flags" FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
|
||||
if ( NOT DEFINED crypto_library )
|
||||
# I'm not sure why this is here, I guess someone has openssl and can't detect it with find_package()?
|
||||
# if you have a normal install, you can define crypto_library to the empty string to avoid a build error
|
||||
|
|
|
|||
67
Dockerfile
67
Dockerfile
|
|
@ -1,44 +1,63 @@
|
|||
FROM phusion/baseimage:0.9.19
|
||||
FROM ubuntu:18.04
|
||||
MAINTAINER PeerPlays Blockchain Standards Association
|
||||
|
||||
ENV LANG=en_US.UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
RUN \
|
||||
apt-get update -y && \
|
||||
apt-get install -y \
|
||||
g++ \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
autoconf \
|
||||
cmake \
|
||||
git \
|
||||
libbz2-dev \
|
||||
libreadline-dev \
|
||||
libboost-all-dev \
|
||||
libcurl4-openssl-dev \
|
||||
libssl-dev \
|
||||
libncurses-dev \
|
||||
doxygen \
|
||||
bash \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
doxygen \
|
||||
git \
|
||||
graphviz \
|
||||
libbz2-dev \
|
||||
libcurl4-openssl-dev \
|
||||
libncurses-dev \
|
||||
libreadline-dev \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
locales \
|
||||
ntp \
|
||||
pkg-config \
|
||||
wget \
|
||||
&& \
|
||||
apt-get update -y && \
|
||||
apt-get install -y fish && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN \
|
||||
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
||||
locale-gen
|
||||
|
||||
# Compile Boost
|
||||
RUN \
|
||||
BOOST_ROOT=$HOME/boost_1_67_0 && \
|
||||
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz/download' -O boost_1_67_0.tar.gz &&\
|
||||
tar -zxvf boost_1_67_0.tar.gz && \
|
||||
cd boost_1_67_0/ && \
|
||||
./bootstrap.sh "--prefix=$BOOST_ROOT" && \
|
||||
./b2 install && \
|
||||
cd ..
|
||||
|
||||
ADD . /peerplays-core
|
||||
WORKDIR /peerplays-core
|
||||
|
||||
# Compile
|
||||
# Compile Peerplays
|
||||
RUN \
|
||||
( git submodule sync --recursive || \
|
||||
find `pwd` -type f -name .git | \
|
||||
while read f; do \
|
||||
rel="$(echo "${f#$PWD/}" | sed 's=[^/]*/=../=g')"; \
|
||||
sed -i "s=: .*/.git/=: $rel/=" "$f"; \
|
||||
done && \
|
||||
git submodule sync --recursive ) && \
|
||||
BOOST_ROOT=$HOME/boost_1_67_0 && \
|
||||
git submodule update --init --recursive && \
|
||||
mkdir build && \
|
||||
mkdir build/release && \
|
||||
cd build/release && \
|
||||
cmake \
|
||||
-DBOOST_ROOT="$BOOST_ROOT" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
. && \
|
||||
../.. && \
|
||||
make witness_node cli_wallet && \
|
||||
install -s programs/witness_node/witness_node programs/cli_wallet/cli_wallet /usr/local/bin && \
|
||||
#
|
||||
|
|
|
|||
38
README.md
38
README.md
|
|
@ -32,16 +32,44 @@ cd boost_1_67_0/
|
|||
## Building Peerplays
|
||||
|
||||
```
|
||||
export BOOST_ROOT=/root/boost_1_67_0
|
||||
export CC=gcc-5 ; export CXX=g++-5
|
||||
cd $HOME/src
|
||||
export BOOST_ROOT=$HOME/src/boost_1_67_0
|
||||
git clone https://github.com/peerplays-network/peerplays.git
|
||||
mkdir $HOME/peerplays/build; cd $HOME/src/peerplays/build
|
||||
cd peerplays
|
||||
git submodule update --init --recursive
|
||||
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release
|
||||
make -j$(nproc)
|
||||
|
||||
ake install # this can install the executable files under /usr/local
|
||||
make install # this can install the executable files under /usr/local
|
||||
```
|
||||
|
||||
docker build -t peerplays .
|
||||
|
||||
## Docker image
|
||||
|
||||
```
|
||||
# Install docker
|
||||
sudo apt install docker.io
|
||||
|
||||
|
||||
# Add current user to docker group
|
||||
sudo usermod -a -G docker $USER
|
||||
# You need to restart your shell session, to apply group membership
|
||||
# Type 'groups' to verify that you are a member of a docker group
|
||||
|
||||
|
||||
# Build docker image (from the project root, must be a docker group member)
|
||||
docker build -t peerplays .
|
||||
|
||||
|
||||
# Start docker image
|
||||
docker start peerplays
|
||||
|
||||
# Exposed ports
|
||||
# # rpc service:
|
||||
# EXPOSE 8090
|
||||
# # p2p service:
|
||||
# EXPOSE 1776
|
||||
```
|
||||
|
||||
Rest of the instructions on starting the chain remains same.
|
||||
|
|
|
|||
|
|
@ -189,9 +189,9 @@ namespace graphene { namespace chain {
|
|||
ordered_non_unique< tag<by_asset_balance>,
|
||||
composite_key<
|
||||
vesting_balance_object,
|
||||
member_offset<vesting_balance_object, asset_id_type, (size_t) (offset_s(vesting_balance_object,balance) + offset_s(asset,asset_id))>,
|
||||
member_offset<vesting_balance_object, asset_id_type, (size_t) (offsetof(vesting_balance_object,balance) + offsetof(asset,asset_id))>,
|
||||
member<vesting_balance_object, vesting_balance_type, &vesting_balance_object::balance_type>,
|
||||
member_offset<vesting_balance_object, share_type, (size_t) (offset_s(vesting_balance_object,balance) + offset_s(asset,amount))>
|
||||
member_offset<vesting_balance_object, share_type, (size_t) (offsetof(vesting_balance_object,balance) + offsetof(asset,amount))>
|
||||
//member<vesting_balance_object, account_id_type, &vesting_balance_object::owner>
|
||||
//member_offset<vesting_balance_object, account_id_type, (size_t) (offset_s(vesting_balance_object,owner))>
|
||||
>,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ target_link_libraries( graphene_net
|
|||
PUBLIC fc graphene_db )
|
||||
target_include_directories( graphene_net
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include" "${CMAKE_CURRENT_BINARY_DIR}/../chain/include"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ if( PERL_FOUND AND DOXYGEN_FOUND AND NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja" )
|
|||
COMMAND ${DOXYGEN_EXECUTABLE}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile include/graphene/wallet/wallet.hpp )
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp
|
||||
COMMAND PERLLIB=${CMAKE_CURRENT_SOURCE_DIR} ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_api_documentation.pl ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new
|
||||
COMMAND PERLLIB=${CMAKE_CURRENT_BINARY_DIR} ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_api_documentation.pl ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new
|
||||
|
|
|
|||
Loading…
Reference in a new issue