【问题标题】:Quantlib with boost for iOS build on xcode 4.6Quantlib 在 xcode 4.6 上构建 iOS 的 boost
【发布时间】:2013-04-11 09:48:25
【问题描述】:

我正在尝试为 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 项目对我有用,我尝试将其链接到 buildql.sh 脚本中作为 boost ref,但我得到:

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}

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

【问题讨论】:

    标签: ios boost build quantlib arm7


    【解决方案1】:

    对 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 =/选择/本地/

    当前输出如下所示:

    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
    

    【讨论】:

    • 一切正常,现在可以构建了。
    【解决方案2】:

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

    • 仔细设置路径,也就是说,尽量不要在外部驱动器上有空格或有数据(尽管可以)
    • 为ARM芯片、模拟器和安装的iOS版本设置参数非常非常仔细!

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-07
      • 2013-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多