gpt4 book ai didi

linux - 为 power-pc 交叉编译 boost 库失败

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:20:24 26 4
gpt4 key购买 nike

我需要为 power-pc 交叉编译 boost 库。

请在下面找到我为让它运行而执行的步骤:

我有

  1. 下载 boost 1.61
  2. 解压到/home/emh2
  3. 并执行 sudo ./home/bootstrap.sh 来 boost 构建器 b2
  4. Boost.Builder b2 已成功创建。

交叉编译器 powerpc-bt-linux-gnuspe-g++ 位于以下路径下:

/usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/

交叉编译器的include目录如下

/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/powerpc-bt-linux-gnuspe

/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/

/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/

接下来,我在 /home 中创建了包含以下内容的 user-config.jam:

 using gcc 
: ppc
: /usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/powerpc-bt-linux-gnuspe-g++
: <compilerflags>-I/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/powerpc-bt-linux-gnuspe -I/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/ -I/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/ ;

然后我开始交叉编译

./b2 toolset=gcc-ppc --with-log

这是表明找不到文件/目录的输出:

Performing configuration checks
- 32-bit : yes (cached)
- arm : no (cached)
- mips1 : no (cached)
- power : yes (cached)

Building the Boost C++ Libraries.
- symlinks supported : yes (cached)
- compiler-supports-visibility : yes (cached)
- has_icu builds : no (cached)
- lockfree boost::atomic_flag : no (cached)
Component configuration:

- atomic : not building
- chrono : not building
- container : not building
- context : not building
- coroutine : not building
- coroutine2 : not building
- date_time : not building
- exception : not building
- filesystem : not building
- graph : not building
- graph_parallel : not building
- iostreams : not building
- locale : not building
- log : building
- math : not building
- metaparse : not building
- mpi : not building
- program_options : not building
- python : not building
- random : not building
- regex : not building
- serialization : not building
- signals : not building
- system : not building
- test : not building
- thread : not building
- timer : not building
- type_erasure : not building
- wave : not building
...patience...
...patience...
...patience...
...patience...
...found 4056 targets...
...updating 208 targets...
gcc.compile.c++ bin.v2/libs/atomic/build/gcc-ppc/release/threading- multi/lockpool.o
libs/atomic/src/lockpool.cpp:15:19: fatal error: cstddef: No such file or directory
compilation terminated.

"/usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/powerpc-bt-linux-gnuspe-g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -m32 -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG -I"." -c -o "bin.v2/libs/atomic/build/gcc-ppc /release/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"

...failed gcc.compile.c++ bin.v2/libs/atomic/build/gcc-ppc/release/threading- multi/lockpool.o...
...skipped <pbin.v2/libs/atomic/build/gcc-ppc/release/threading- multi>libboost_atomic.so.1.61.0 for lack of <pbin.v2/libs/atomic/build/gcc-ppc /release/threading-multi>lockpool.o...
...skipped <pstage/lib>libboost_atomic.so.1.61.0 for lack of <pbin.v2/libs /atomic/build/gcc-ppc/release/threading-multi>libboost_atomic.so.1.61.0...
...skipped <pstage/lib>libboost_atomic.so for lack of <pstage/lib>libboost_atomic.so.1.61.0...
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-ppc/release/threading- multi/gregorian/greg_month.o
In file included from ./boost/date_time/gregorian/greg_month.hpp:12:0,
from libs/date_time/src/gregorian/greg_month.cpp:14:
./boost/date_time/constrained_value.hpp:12:21: fatal error: exception: No such file or directory
compilation terminated.

我在这里缺少什么?为什么我会收到这些“没有这样的文件或目录”错误?

最佳答案

首先,我会跑

./b2 --debug-configuration -n 

描述here .这应该允许您确认 b2 正在抓取正确的 jam 文件。它会在/home/user/中查找 user-config.jam,因此您可能需要将其移至该目录(如果该目录不存在)。

此外,我发现自己需要写出 <compileflag>-option1 <compileflag>-option2 etc...可能有一种方法可以传递一整串选项,但只是在单个 <compileflags> 之后将它们分开。似乎不起作用。

输出显示了运行的完整编译命令。您应该会看到您的编译标志显示在那里,并且可以使用它来验证您的 jam 文件语法是否正常工作。

在你上面的输出中,你可以看到你想要的包含没有出现

"/usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/powerpc-bt-linux-gnuspe-g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline    -Wall -pthread -fPIC -m32  -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1   -DBOOST_ATOMIC_SOURCE -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-ppc   /release/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"

关于linux - 为 power-pc 交叉编译 boost 库失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43952456/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com