0

I'm trying to build quantlib for xcode 4.6.
The project of concern is this one: https://github.com/philipbarnes/quantlib-on-iOS

This quantlib project relies on this boost project: https://gitorious.org/boostoniphone/boostoniphone

My problem is I cannot get this boost to build, but I can get another version to build on github also by Pete.

One of the steps in building quantlib for iOS asks to set the boost dir. I tried to adjust this to no avail.  This means I have a dir 'boostoniphone-huuskpes-boostoniphone' - which does not build and was said to be the version to use with the quantlib on iPhone project, and the dir 'boostoniphone-master' which did build - it has a different build structure with folders and maybe setting the $BOOSTDIR variable in the quantlib project isn't so simple.

These outputs from the console have been shorted for more comfortable reading

My gitorious boost output says:

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)

... and continues with problem repeated , then this error is next ...

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)

as the other boost project works for me it, I try to link it into the buildql.sh script as a boost ref, but I get:

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

and

/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)

A pointer to how to make frameworks may also be a solution? But I think getting the quantlib for iOS project to work is the real solution.

Coming back to the BOOST variable, in the buildql.sh file, changes such as the following have been made:

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

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

The following were also altered to attempt to fit the 'boostoniphone-master'

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

Thanks for any hints, potential solutions.

2 Answers2

0

Changes to the buildql.sh script look like this:

: ${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}

Build command runs with a new error:

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

Current output looks like this:

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
0

Rather than go into all the script details the following is the solution:

  • Set the paths carefully, that means, try not to have spaces or have data on external drive (although you can)
  • Set the parameters for the ARM chip, simulator and the iOS version installed very very carefully!

All in all that should be the most of it.