gxb-core源码编译问题,求帮忙
-
make
CMake Error at CMakeLists.txt:43 (include):
include could not find load file:GetGitRevisionDescription
CMake Error at CMakeLists.txt:44 (get_git_head_revision):
Unknown CMake command "get_git_head_revision".-- Configuring incomplete, errors occurred!
See also "/Users/nieshenjie/workspace/code/gxchain/gxb-core/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
-
是通过os。源码编译的时候出的问题
-
git submodule update --init --recursive
子模块没下载过来,请按文档来, 编译release分支。如果有错误,先检查是不是依赖问题
-
-
好的, 非常感谢。 应该是有部分模块没更新全。
-
@albert 我在cmake的时候发现少了wasm, 但是我安装了。还是有这个问题。能否帮忙看看
-- Using custom FindBoost.cmake
CMake Error at libraries/fc/CMakeModules/FindBoost.cmake:1129 (message):
Unable to find the requested Boost libraries.Boost version: 1.57.0
Boost include path: /usr/local/include
Detected version of Boost is too old. Requested version was 1.67 (or
newer).
Call Stack (most recent call first):
CMakeLists.txt:67 (FIND_PACKAGE)-- Using custom FindBoost.cmake
-- Boost version: 1.57.0
-- Found the following Boost libraries:
-- coroutine
-- Configuring gxb-core on OS X
-- binaryen building with -std=c++11
-- binaryen building for platform x86-64
-- binaryen building with -Wall
-- binaryen building with -Werror
-- binaryen building with -Wextra
-- binaryen building with -Wno-unused-parameter
-- binaryen building with -fno-omit-frame-pointer
-- binaryen building with -fPIC
-- binaryen building with -O2
-- binaryen building with -UNDEBUG
-- Could NOT find WASM (missing: WASM_CLANG WASM_LLC WASM_LLVM_LINK)
CMake Error at CMakeModules/wasm.cmake:8 (message):
No WASM compiler cound be found (make sure WASM_ROOT is set)
Call Stack (most recent call first):
CMakeLists.txt:161 (include)
-
mac环境下编译:
安装依赖
brew install cmake@3.11 openssl wget git openssl autoconf automake doxygen libtool llvm@4
安装 boost
先下载一个包wget https://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 && chmod +x bootstrap.sh ./bootstrap.sh ./b2 --buildtype=complete install toolset=clang cxxflags="-arch x86_64" linkflags="-arch x86_64"
安装cmake(如果cmake是3.11以上版本,可跳过此步骤)
cd /tmp && wget https://cmake.org/files/v3.11/cmake-3.11.0-Linux-x86_64.sh mkdir -p /opt/cmake && chmod +x /tmp/cmake-3.11.0-Linux-x86_64.sh bash /tmp/cmake-3.11.0-Linux-x86_64.sh --prefix=/opt/cmake --skip-license ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
编译llvm支持WASM
mkdir ~/wasm-compiler cd ~/wasm-compiler git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git cd llvm/tools git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git cd .. && mkdir -p build && cd build cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=~/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release .. make -j4 install
下载gxb-core代码
git clone https://github.com/gxchain/gxb-core cd gxb-core && git checkout dev_master git submodule update --init --recursive
编译gxb-core, 并安装gxblib
export LLVM_DIR=/usr/local/Cellar/llvm@4/4.0.1/lib/cmake/llvm export WASM_ROOT=~/wasm/llvm mkdir -p build && cd build cmake -DLLVM_DIR=$LLVM_DIR -DWASM_ROOT=$WASM_ROOT -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DCMAKE_BUILD_TYPE=Release .. make -j4 sudo make install
-
/gxb-core
File: CMakeLists.txt
line 67-73#FIND_PACKAGE(Boost 1.67 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
#IF(NOT "${Boost_VERSION}" MATCHES "1.67(.*)")
#SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
#FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine)
#LIST(APPEND BOOST_COMPONENTS coroutine)
#SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
#ENDIF()
-