0

我正在尝试为xcode 4.6构建 quantlib 。
关注的项目是这个:https ://github.com/philipbarnes/quantlib-on-iOS

这个 quantlib 项目依赖于这个 boost 项目:https ://gitorious.org/boostoniphone/boostoniphone

我的问题是我无法获得这种提升来构建,但我也可以通过 Pete 在 github 上构建另一个版本。

为 iOS 构建 quantlib 的步骤之一要求设置 boost 目录。我试图调整它无济于事。 这意味着我有一个 dir 'boostoniphone-huuskpes-boostoniphone' - 它没有构建,据说是与 iPhone 项目上的 quantlib 一起使用的版本,以及确实构建的 dir 'boostoniphone-master' - 它有一个带有文件夹的不同构建结构,也许在 quantlib 项目中设置 $BOOSTDIR 变量并不是那么简单。

控制台的这些输出已被短路,以便更舒适地阅读

我的gitorious boost 输出说:

3 warnings generated.
darwin.archive bin.v2/libs/thread/build/darwin-6.1~iphonesim/release/architecture-x86/link-       static/macosx-version-iphonesim-6.0/target-os-iphone/threading-multi/libboost_thread.a
common.copy stage/lib/libboost_thread.a
...updated 120 targets...

=================================================================
Done

Splitting all existing fat binaries...
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo:     can't open input file: /Users/colman/Downloads/boostoniphone-huuskpes-   boostoniphone_/src/boost_1_51_0/bin.v2/libs/thread/build/darwin-4.2.1~iphone/release/architecture-  arm/link-static/macosx-version-iphone-6.0/target-os-iphone/threading-multi/libboost_thread.a (No such   file or directory)

...并继续重复问题,然后此错误是下一个...

ar: obj/*.o: No such file or directory
...armv7s
ar: obj/*.o: No such file or directory
...i386
ar: obj/*.o: No such file or directory
liboficate: thread
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: /Users/colman/Downloads/boostoniphone-huuskpes-    boostoniphone_/src/boost_1_51_0/bin.v2/libs/thread/build/darwin-4.2.1~iphone/release/architecture-arm/link-static/macosx-version-iphone-6.0/target-os-iphone/threading-multi/libboost_thread.a (No such file or directory)

由于另一个 boost 项目对我有用,我尝试将它作为 boost ref 链接到 buildql.sh 脚本中,但我得到:

checking for arm-apple-darwin10-gcc...       /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-    darwin10-llvm-gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/colman/Downloads/boostoniphone-huuskpes-boostoniphone_/QuantLib-1.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

/Applications/Xcode.app/Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: /Users/colman/Downloads/boostoniphone-huuskpes-boostoniphone_/QuantLib-1.2.1/prefix/armv7/lib/libQuantLib.a (No such file or directory)

指向如何制作框架的指针也可能是一种解决方案?但我认为让 quantlib for iOS 项目工作是真正的解决方案。

回到 BOOST 变量,在 buildql.sh 文件中进行了如下更改:

#: ${BOOST_HOME:=$HOME/workspace/huuskpes-boostoniphone}
: ${BOOST_HOME:=$HOME/workspace/boostoniphone-master/}

: ${BOOST_SRC:=$BOOST_HOME/src/boost_1_51_0}

以下内容也进行了更改以尝试适合“boostoniphone-master”

: ${SRCDIR:=`pwd`/src}
: ${BUILDDIR:=`pwd`/build}
: ${PREFIXDIR:=`pwd`/prefix}
: ${FRAMEWORKDIR:=`pwd`/framework}

感谢您的任何提示,潜在的解决方案。

4

2 回答 2

0

下面是解决方案,而不是进入所有脚本细节:

  • 仔细设置路径,这意味着尽量不要在外部驱动器上有空格或有数据(虽然你可以)
  • 为ARM芯片、模拟器和安装的iOS版本设置参数非常非常仔细!

总而言之,这应该是最重要的。

于 2013-09-28T10:30:39.247 回答
0

对 buildql.sh 脚本的更改如下所示:

: ${BOOST_HOME:=/Volumes/Untitled\ 1/workspace/boostoniphone-master/iphone-build/stage/lib}
: ${BOOST_SRC_HOME:=/Volumes/Untitled\ 1/workspace/boostoniphone-master/boostoniphone-master}
: ${BOOST_SRC:=$BOOST_SRC_HOME/src/boost_1_51_0/boost}

...

: ${SRCDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/src}
: ${BUILDDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/build}
: ${PREFIXDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/prefix}
: ${PREFIXDIR_2:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/prefix}
: ${FRAMEWORKDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a}

构建命令运行时出现新错误:

./buildql.sh -with-boost-include=/opt/local/include/ --with-boost-lib=/Volumes/Untitled 1/workspace/boostoniphone-master/iphone-build/stage --prefix=/opt /当地的/

当前输出如下所示:

libtool: link: (cd .libs/libExperimental.lax/libAmortizingBonds.a && ar x "/Volumes/Untitled 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/ql/experimental/amortizingbonds/.libs/libAmortizingBonds.a")
../../libtool: line 1096: cd: .libs/libExperimental.lax/libAmortizingBonds.a: No such file or directory
make[3]: *** [libExperimental.la] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

=================================================================
Done

rm: /Volumes/Untitled: Resource busy

=================================================================
Framework: Setting up directories...


=================================================================
Framework: Creating symlinks...

ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Versions/Current: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Headers: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Resources: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Documentation: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/ql: No such file or directory

=================================================================
Framework: Lipoing library into /Volumes/Untitled 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Versions/A/ql

/Applications/Xcode.app/Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo:     can't open input file: $    /Applications/Xcode.app/Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo         -create         -arch armv7 /Volumes/Untitled 1/workspace/quantlib-on-iOS-    master/QuantLib-1.2.1/1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/ql/.libs/libQuantLib.a         -arch armv7s /Volumes/Untitled 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/ql/.libs/libQuantLib.a         -arch i386  /Volumes/Untitled 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/1/workspace/quantlib-on-iOS-master/    QuantLib-1.2.1/ql/.libs/libQuantLib.a         -o          /Volumes/Untitled (No such file or directory)

Aborted: Lipo  failed
于 2013-04-23T09:51:34.017 回答