0

我在尝试在运行 Lion 的 Mac 上编译Adob​​e Source Libraries (ASL)时遇到了各种麻烦。我正在使用 MacPorts GCC-4.7(我喜欢 C++11)。

我通过将 url 更改为指向 downloads.sourceforge.net 下载并编辑了 asl_1.0.43_net_setup.sh。

我告诉 bjam 使用我的 gcc 并通过编辑 ~/user-config.jam 将 -std=c++11 标志传递给它:

import toolset : using ; using darwin ;
using gcc
    : 47 
    : g++-mp-4.7 
    : <cxxflags>"-std=c++11"
    ;

我用标志告诉 bjam 制作 64 位版本: bjam toolset=gcc-47 -j 4 address-model=64 architecture=x86

我不断收到错误消息(多次):documentation/examples/namespace.cpp:1:0: error: CPU you selected does not support x86-64 instructions set

即使我告诉它使用 64 位,bjam(愚蠢地)似乎正在设置 -march=i486 并导致上述问题。理想情况下,ASL 可以使用我现有的已安装 boost 和 TBB 进行编译,而无需构建自定义版本。

到目前为止,我已经花了几个小时,准备扔掉它。它似乎有很多希望,但构建系统不灵活(这就是我不使用 jam 或 bjam 的原因)。

有没有人有任何关于使用 clang 或 GCC 在现代 Mac 上构建这个东西的提示?(GCC:不是 XCode 附带的版本)。

[编辑] 我找到了 i486 位并将其删除。现在我遇到了用 C++11 编译器编译的问题:

./adobe/closed_hash.hpp:691:88: error: 'insert' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
./adobe/closed_hash.hpp:691:88: note: declarations in dependent base    'adobe::version_1::closed_hash_set<adobe::pair<adobe::version_1::name_t, adobe::version_1::any_regular_t>, adobe::get_element<0, adobe::pair<adobe::version_1::name_t, adobe::version_1::any_regular_t> >, boost::hash<adobe::version_1::name_t>, std::equal_to<adobe::version_1::name_t>, adobe::version_1::capture_allocator<adobe::pair<adobe::version_1::name_t, adobe::version_1::any_regular_t> > >' are not found by unqualified lookup
./adobe/closed_hash.hpp:691:88: note: use 'this->insert' instead

[编辑] 嗯,这实际上看起来像是 adobe 代码中的一个错误,g++ 过去是允许的,但现在不再允许了。叹息,现在看起来 ASL 还没有针对任何现代的(大部分)兼容的 C++11 编译器进行编译。

现在我在 adobe 脚本下载的 boost 版本中看到编译问题(信号库显然在某些移动构造函数中存在错误,并且 GCC 正在抱怨它):

../boost_libraries/boost/smart_ptr/shared_ptr.hpp:168:25: note: 'boost::shared_ptr<boost::signals::detail::basic_connection>::shared_ptr(const boost::shared_ptr<boost::signals::detail::basic_connection>&)' is implicitly declared as deleted because 'boost::shared_ptr<boost::signals::detail::basic_connection>' declares a move constructor or move assignment operator
4

1 回答 1

0

我已经放弃试图弄清楚 bjam 引入的所有复杂性。

相反,我在 ASL 的 github 上创建了一个分支,我正在使用 cmake、gcc-47 和 clang-3.2 构建它。我在代码中做了一些小修复,并且其中一个目录在没有警告的情况下编译。

https://github.com/tfiner/adobe_asl

[编辑] 经过几个小时的汗水,我终于有了两个由 clang 3.2 使用 boost 1.49、TBB 4.0 和 OS X 10.6 构建的闪亮库。随意从 github 克隆它,如果你设法让它工作,请告诉我。

于 2012-06-21T21:08:31.467 回答