[Ves] Compiling VES on iOS

Casey Goodlett casey.goodlett at kitware.com
Fri May 23 09:04:01 EDT 2014


Alessanro,

You should normally have to add the include path for each framework as you
have done.  I assume you also included the vtk.framework headers?  You will
see the same in the KiwiSimple and KiwiViewer projects.

Another option that you may investigate is how to compile each file. I
forget the name of the option, but its something like compile each file as
objective-c / objective-c++ or by file type.  My experience has been best
when I use "by file type".  You do have to be careful then that any ves/ves
header is included in a file with .mm extension.  You can get strange build
errors if some of the eigen headers get included in a file with .m
extension.

Do you have a project file you can share?


On Fri, May 23, 2014 at 3:21 AM, Alessandro Dal Grande <adgror at gmail.com>wrote:

> Update: I managed to compile by removing the c++11 flag I added.
>
> OK, I don’t know how to go forward with the framework in XCode, the
> example app doesn’t work either. I tried to manually add to the include
> path the headers with:
>
> $(PROJECT_DIR)/kiwi.framework/Headers
>
> in the Build Settings, but that breaks OpenCV for some reason. If I don’t,
> the compiler errors out with:
>
> […]/kiwi.framework/Headers/vesKiwiBaseApp.h:30:10: 'vesMath.h' file not
> found with <angled> include; use "quotes” instead
>
> --
> Alessandro Dal Grande
>
> On Thursday, 22 May 2014 at 15:01, Alessandro Dal Grande wrote:
>
>  Yup, it switched back to Clang:
>
> [  0%] Building C object libarchive/CMakeFiles/archive.dir/archive_acl.c.o
> cd
> /Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Build/libarchive-ios-simulator/libarchive
> && /usr/bin/cc  -DHAVE_CONFIG_H -Darchive_EXPORTS -fvisibility=hidden
> -fvisibility-inlines-hidden -mios-simulator-version-min=5.0
> -fvisibility=hidden -fvisibility-inlines-hidden
> -mios-simulator-version-min=5.0 -g -arch i386 -isysroot
> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
> -fPIC
> -I/Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Source/libarchive/libarchive
> -I/Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Build/libarchive-ios-simulator
> -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/libxml2
>    -o CMakeFiles/archive.dir/archive_acl.c.o   -c
> /Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Source/libarchive/libarchive/archive_acl.c
> /usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report
> /Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Build/libarchive-ios-simulator/CMakeFiles
> 1
>
> --
> Alessandro Dal Grande
>
> On Thursday, 22 May 2014 at 14:58, Alessandro Dal Grande wrote:
>
>  Sure I will try it now.
>
> --
> Alessandro Dal Grande
>
> On Thursday, 22 May 2014 at 14:56, Casey Goodlett wrote:
>
> That should not be a problem.
>
> If you dont mind testing removing the find_program for the compilers in
> the simulator toolchain, it would help me to confirm that I understand the
> situation.
>
> Thanks
>
>
> On Thu, May 22, 2014 at 5:44 PM, Alessandro Dal Grande <adgror at gmail.com>wrote:
>
>  I think I can live without the simulator build, as I cannot test on it
> anyway, based on my app requirements ;)
>
> Another strange thing that happens is I get warnings like this one:
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:
> for architecture: armv7 file:
> ./CMakeExternals/Install/vtk-ios-device/lib/libvtklibxml2-6.0.a(debugXML.c.o)
> has no symbols
>
> Is it fine, am I missing something?
>
> --
> Alessandro Dal Grande
>
> On Thursday, 22 May 2014 at 14:30, Casey Goodlett wrote:
>
> You can use the same compiler for both simulator and device builds with
> the arch, sysroot, and ios-version-min flags set from the toolchain file.
> In other words the compiler is the same for both builds but the build
> options are different.
>
> The key flags are
> -arch
> -isysroot
> -mios-simulator-version-min=5.0
> or
> -mios-iphoneos-version-min=5.0
>
>
> Note the version min is key for the simulator build otherwise you may link
> against host (OS X) libraries.
>
>
> On Thu, May 22, 2014 at 5:24 PM, Alessandro Dal Grande <adgror at gmail.com>wrote:
>
> Yeah, I get the same:
>
> $ c++ -v
> Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
> Target: x86_64-apple-darwin13.1.0
> Thread model: posix
>
> This seems to be the compiler used for armv7/armv7s architectures though,
> so it should be working if I run the builds on my iDevice?
>
> Thanks
>
> --
> Alessandro Dal Grande
>
> On Thursday, 22 May 2014 at 14:21, Casey Goodlett wrote:
>
>
> On Thu, May 22, 2014 at 5:17 PM, Alessandro Dal Grande <adgror at gmail.com>wrote:
>
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
> --with-gxx-include-dir=/usr/include/c++/4.2.1
>
>
> I believe that --with-gxx-include-dir line means you get libstdc++
>
> Compare with
> $ c++ -v
> Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
> Target: x86_64-apple-darwin13.2.0
> Thread model: posix
>
> --
> Casey B. Goodlett, Ph.D.
> Technical Leader
> Kitware, Inc. - North Carolina Office
> http://www.kitware.com
> (919) 969-6990 x310
>
>
>
>
>
> --
> Casey B. Goodlett, Ph.D.
> Technical Leader
> Kitware, Inc. - North Carolina Office
> http://www.kitware.com
> (919) 969-6990 x310
>
>
>
>
>
> --
> Casey B. Goodlett, Ph.D.
> Technical Leader
> Kitware, Inc. - North Carolina Office
> http://www.kitware.com
> (919) 969-6990 x310
>
>
>
>
>


-- 
Casey B. Goodlett, Ph.D.
Technical Leader
Kitware, Inc. - North Carolina Office
http://www.kitware.com
(919) 969-6990 x310
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20140523/aac43e31/attachment-0003.html>


More information about the Ves mailing list