[Ves] Build for armv7s and arm64

Jon Chmura jon.chmura at me.com
Thu Oct 31 08:49:56 EDT 2013


Let me clarify my Xcode build problem.  I can build with Xcode 5 and iOS 7 if I set my project up just like the KiwiViewer (ARCHS set to standard, build only active arch set to NO, and valid archs set to only armv7).  My project is set up differently and I have to set these values to Xcode defaults.  This is where the arm64 support is causing me grief.  I thought it would be a good time to bring up on the mailing list since a lot of 64 bit iOS devices are hitting the market.

Specifically my Xcode problem is caused when using Cocoapods, Xcode 5, and the kiwi/vtk frameworks.  I have been using Cocoapods for awhile to manage my open source dependencies.  I just started using it to also manage dependencies on my private modules.  The first time I did a pod install after upgrading to Xcode 5 my build broke.  My project settings matched the KiwiViewer settings but when Cocoapods creates projects for all the pulled in dependencies it uses the Xcode default settings which is currently 64bit support and build active archs = YES.  It can’t link the .a file made for the pods if the architecture settings don’t match.  There are some posts about this online which basically recommend using the default Xcode architecture settings.  

Jon Chmura
jon.chmura at me.com




On Oct 30, 2013, at 2:45 PM, Casey Goodlett <casey.goodlett at kitware.com> wrote:

> Weird.  Somehow I have been successfully building with xcode 5 and the ios 7 sdk without this problem.
> 
> Maybe I have some old headers on my system that were not removed during the upgrade?
> 
> I dug a bit further and for the device toolchain configuration on my build there is no gcc or g++ in the iPhoneOS system root (although there is in the simulator system root).  As a result the superbuild falls back to the system level compiler.  These seems to compile ok when given the proper arch and min iphoneos version commands.  I wonder if for newer xcode we should use the system compiler and configure architecture, sysroot, and min-iphoneos-version options for device and simulator builds.
> 
> I might try a clean uninstall and reinstall of xcode to get myself back to a clean slate.
> 
> 
> On Wed, Oct 30, 2013 at 1:35 PM, Aashish Chaudhary <aashish.chaudhary at kitware.com> wrote:
> For the tr1 I have a branch that I need to push (will do it this week).  I was waiting for this another branch that needed to go in first (for some other build related issue).
> 
> - Aashish
> 
> 
> On Wed, Oct 30, 2013 at 1:20 PM, Pat Marion <james.patrick.marion at gmail.com> wrote:
> Hi Jon,
> 
> There was a previous VES mailing list thread where we briefly talked about this tr1 issue.  Maybe search for the email by subject:   [Ves] ios 7
> I think the idea was that VES needs a patch to resolve it, for now you could do a find/replace across many files to remove references to tr1.
> 
> Pat
> 
> 
> On Wed, Oct 30, 2013 at 1:06 PM, Jon Chmura <jon.chmura at me.com> wrote:
> Casey,
> 
> I tried all of those options with make -j1 build.  Below is the failure when building WITH lib archive and curl.
> 
> 
> -- Build files have been written to: /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Build/curl-ios-device
> [  9%] Performing build step for 'curl-ios-device'
> [  1%] Building C object lib/CMakeFiles/libcurl.dir/file.c.o
> In file included from /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Source/curl/lib/file.c:23:
> In file included from /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Source/curl/lib/setup.h:127:
> /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Source/curl/include/curl/curlrules.h:143:6: error: 
>       '__curl_rule_01__' declared as an array with a negative size
>     [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Source/curl/include/curl/curlrules.h:132:27: note: 
>       expanded from macro 'CurlchkszEQ'
> #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
>                           ^~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> make[5]: *** [lib/CMakeFiles/libcurl.dir/file.c.o] Error 1
> make[4]: *** [lib/CMakeFiles/libcurl.dir/all] Error 2
> make[3]: *** [all] Error 2
> make[2]: *** [CMakeExternals/Stamp/curl-ios-device/curl-ios-device-build] Error 2
> make[1]: *** [CMakeFiles/curl-ios-device.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> I also attempted building WITHOUT lib archive and curl.  Is the tr1/memory error associated with using the C11 compiler?
> 
> Scanning dependencies of target ves
> [  1%] Building CXX object src/ves/CMakeFiles/ves.dir/vesActor.cpp.o
> In file included from /Users/jonc/Developer/VES/src/ves/vesActor.cpp:22:
> In file included from /Users/jonc/Developer/VES/src/ves/./vesActor.h:33:
> In file included from /Users/jonc/Developer/VES/src/ves/./vesNode.h:31:
> In file included from /Users/jonc/Developer/VES/src/ves/./vesBoundingObject.h:27:
> In file included from /Users/jonc/Developer/VES/src/ves/./vesObject.h:25:
> In file included from /Users/jonc/Developer/VES/src/ves/./vesSetGet.h:25:
> /Users/jonc/Developer/VES/src/ves/./vesSharedPtr.h:28:10: fatal error: 'tr1/memory' file not found
> #include <tr1/memory>
>          ^
> 1 error generated.
> make[5]: *** [src/ves/CMakeFiles/ves.dir/vesActor.cpp.o] Error 1
> make[4]: *** [src/ves/CMakeFiles/ves.dir/all] Error 2
> make[3]: *** [all] Error 2
> make[2]: *** [CMakeExternals/Stamp/ves-ios-device/ves-ios-device-build] Error 2
> make[1]: *** [CMakeFiles/ves-ios-device.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> 
> Jon Chmura
> jon.chmura at me.com
> 
> 
> 
> 
> On Oct 30, 2013, at 12:07 PM, Casey Goodlett <casey.goodlett at kitware.com> wrote:
> 
>> Jon,
>> 
>> I have no tried arm64 so I do not know where the problem is.  A couple of thoughts to try:
>> 
>> You might try increasing the iphoneos-version-min to 7.0 maybe thats needed to support arm64.  This stackoverflow entry http://stackoverflow.com/questions/18913906/xcode-5-and-ios-7-architecture-and-valid-architectures seems to indicate you need to set a minimum of 6.0 for arm64 support.
>> 
>> If you can disable libarchive and libcurl for the arm64 test we could eliminate those as variables.  
>> 
>> Try a serial build "make -j1" so that the error is the last output.
>> 
>> Let us know what you find out
>> 
>> 
>> On Wed, Oct 30, 2013 at 11:59 AM, Jon Chmura <jon.chmura at me.com> wrote:
>> Casey,
>> 
>> Thanks for the quick reply.  I wasn’t able to build with arm64.  I checked out a new copy of VES.  Modified to add arm64 (see git diff)
>> 
>> diff --git a/CMake/toolchains/toolchain-ios-device.cmake b/CMake/toolchains/toolchain-ios-device
>> index af6aedf..05c6dd5 100644
>> --- a/CMake/toolchains/toolchain-ios-device.cmake
>> +++ b/CMake/toolchains/toolchain-ios-device.cmake
>> @@ -16,7 +16,7 @@ find_program(CMAKE_CXX_COMPILER NAME g++
>>    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/
>>    NO_DEFAULT_PATH)
>>  
>> -set(CMAKE_OSX_ARCHITECTURES "armv7;armv7s")
>> +set(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64")
>>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=5.0 -fvisibility=hidden -fvisibi
>>  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -miphoneos-version-min=5.0 -fvisibility=hidden -fvisibility
>> 
>> The build failed but I didn’t see any useful error messages.  Maybe an issue with libarchive...
>> 
>> [ 40%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_read_disk_entry_from_file.c.o
>> /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Source/libarchive/libarchive/archive_read_disk_entry_from_file.c:325:13: warning: 
>>       'tempnam' is deprecated: This function is provided for compatibility reasons only. Due to
>>       security concerns inherent in the design of tempnam(3), it is highly recommended that you use
>>       mkstemp(3) instead. [-Wdeprecated-declarations]
>>         tempfile = tempnam(tempdir, "tar.md.");
>>                    ^
>> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/stdio.h:389:7: note: 
>>       'tempnam' declared here
>> char    *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam);
>>          ^
>> [ 57%] 1 warning generated.
>> 
>> -- Installing: /Users/jonc/Developer/VES/Apps/iOS/build/CMakeExternals/Install/libarchive-ios-simulator/lib/LibArchive/cmake/LibArchiveTargets-release.cmake
>> [ 52%] Completed 'libarchive-ios-simulator'
>> [ 52%] Built target libarchive-ios-simulator
>> make: *** [all] Error 2
>> 
>> Jon Chmura
>> jon.chmura at me.com
>> 
>> 
>> 
>> 
>> On Oct 30, 2013, at 11:17 AM, Casey Goodlett <casey.goodlett at kitware.com> wrote:
>> 
>>> Jon,
>>> 
>>> You should be able to edit the toolchain file and add arm64 to the arch list (currently should be armv7;armv7s).  I have not tried to build for arm64 so there may be unexpected problems.  I typically modify my xcode project to build only armv7 and armv7s.
>>> 
>>> Can you let us know if you are able to get the project to build with arm64 support?
>>> 
>>> Thanks
>>> 
>>> 
>>> On Wed, Oct 30, 2013 at 11:07 AM, Jon Chmura <jon.chmura at me.com> wrote:
>>> Is there any way to build the iOS frameworks so that they support armv7 and arm64.  I realize that if the project settings are set up as follows it will build even for devices that are armv7s and arm64.
>>> 
>>> { 'ARCHS' => 'ARCHS_STANDARD’,
>>>  'VALID_ARCHS' => 'armv7’, 
>>> 'ONLY_ACTIVE_ARCH' => 'NO’,
>>>  'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++98’, 
>>> 'CLANG_CXX_LIBRARY' => 'libstdc++' }
>>> 
>>> This requirement causes build issues when using an Xcode workspace (i.e.. multiple Xcode projects used to build an app).  I’m looking for a workaround but it be preferable if I could use the standard Xcode settings
>>> 
>>> 'ARCHS' => 'ARCHS_STANDARD_INCLUDING_64_BIT’,
>>>  'VALID_ARCHS' => armv7 armv7s arm64, 
>>> 'ONLY_ACTIVE_ARCH' => ‘YES’,
>>> 
>>> Jon Chmura
>>> jon.chmura at me.com
>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Ves mailing list
>>> Ves at public.kitware.com
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Casey B. Goodlett, Ph.D.
>>> R&D Engineer
>>> Kitware, Inc. - North Carolina Office
>>> http://www.kitware.com
>>> (919) 969-6990 x310
>> 
>> 
>> 
>> 
>> -- 
>> Casey B. Goodlett, Ph.D.
>> R&D Engineer
>> Kitware, Inc. - North Carolina Office
>> http://www.kitware.com
>> (919) 969-6990 x310
> 
> 
> _______________________________________________
> Ves mailing list
> Ves at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
> 
> 
> 
> _______________________________________________
> Ves mailing list
> Ves at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
> 
> 
> 
> 
> -- 
> | Aashish Chaudhary 
> | R&D Engineer         
> | Kitware Inc.            
> | www.kitware.com   
> 
> _______________________________________________
> Ves mailing list
> Ves at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
> 
> 
> 
> 
> -- 
> Casey B. Goodlett, Ph.D.
> R&D Engineer
> 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/20131031/a749fc3e/attachment-0001.html>


More information about the Ves mailing list