在 Linux 上构建 Microsoft Bond
Building Microsoft Bond on Linux
我正在尝试构建 Microsoft 的 Bond。
首先 CMake 找不到我的 Boost。在我从 find_package(Boost ...)中删除 OPTIONAL_COMPONENTS 之后,在 Config.cmake cmake 中找到了我的 Boost。
现在我在 make
之后得到这个输出错误
Scanning dependencies of target gbc
[ 9%] Generating build/gbc/gbc
Invalid package ID: "array-0.5.1.1 base-4.9.0.0 binary-0.8.3.0 bytestring-0.10.8.1"
CMake Error at stack_build.cmake:32 (message):
compiler/CMakeFiles/gbc.dir/build.make:100: recipe for target 'compiler/build/gbc/gbc' failed
make[2]: *** [compiler/build/gbc/gbc] Error 1
CMakeFiles/Makefile2:172: recipe for target 'compiler/CMakeFiles/gbc.dir/all' failed
make[1]: *** [compiler/CMakeFiles/gbc.dir/all] Error 2
Makefile:138: recipe for target
我和文件上说的完全一样。我安装了所有依赖项并做了这个。
mkdir build
cd build
cmake -DBOND_ENABLE_GRPC=FALSE ..
make
sudo make install
输出是。
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.12", minimum required is "2.7")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7")
-- Boost version: 1.61.0
-- Boost Python Library:
-- Stack found at /usr/bin/stack. Version 0.1.10.0 x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/berkan/Documents/programming/bond/build
当 Haskell 堆栈工具 (stack
) 的版本低于 1.5.1 时,我们已经看到这种情况发生。如果您 upgrade Haskell Stack 升级到较新的版本,这个问题应该会消失。
作为 Bond 一部分的 gbc
工具是用 Haskell 编写的,因此要从源代码构建它,您需要有一个有效的 Haskell Stack 工具链。
简而言之,对于 Linux,要升级现有版本:
$ stack upgrade
(要全新安装 Stack,curl -sSL https://get.haskellstack.org/ | sh
。)
Bond 项目的问题列表中有一个 similar issue 其他人遇到的问题。此修复是使用较新版本的 Haskell 堆栈工具。
我正在尝试构建 Microsoft 的 Bond。 首先 CMake 找不到我的 Boost。在我从 find_package(Boost ...)中删除 OPTIONAL_COMPONENTS 之后,在 Config.cmake cmake 中找到了我的 Boost。 现在我在 make
之后得到这个输出错误Scanning dependencies of target gbc
[ 9%] Generating build/gbc/gbc
Invalid package ID: "array-0.5.1.1 base-4.9.0.0 binary-0.8.3.0 bytestring-0.10.8.1"
CMake Error at stack_build.cmake:32 (message):
compiler/CMakeFiles/gbc.dir/build.make:100: recipe for target 'compiler/build/gbc/gbc' failed
make[2]: *** [compiler/build/gbc/gbc] Error 1
CMakeFiles/Makefile2:172: recipe for target 'compiler/CMakeFiles/gbc.dir/all' failed
make[1]: *** [compiler/CMakeFiles/gbc.dir/all] Error 2
Makefile:138: recipe for target
我和文件上说的完全一样。我安装了所有依赖项并做了这个。
mkdir build
cd build
cmake -DBOND_ENABLE_GRPC=FALSE ..
make
sudo make install
输出是。
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.12", minimum required is "2.7")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7")
-- Boost version: 1.61.0
-- Boost Python Library:
-- Stack found at /usr/bin/stack. Version 0.1.10.0 x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/berkan/Documents/programming/bond/build
当 Haskell 堆栈工具 (stack
) 的版本低于 1.5.1 时,我们已经看到这种情况发生。如果您 upgrade Haskell Stack 升级到较新的版本,这个问题应该会消失。
作为 Bond 一部分的 gbc
工具是用 Haskell 编写的,因此要从源代码构建它,您需要有一个有效的 Haskell Stack 工具链。
简而言之,对于 Linux,要升级现有版本:
$ stack upgrade
(要全新安装 Stack,curl -sSL https://get.haskellstack.org/ | sh
。)
Bond 项目的问题列表中有一个 similar issue 其他人遇到的问题。此修复是使用较新版本的 Haskell 堆栈工具。