CMake error on OSX High Sierra for iOS 11 with Xcode 9.4

503 views
Skip to first unread message

Henk Kortier

unread,
Jun 6, 2018, 4:37:07 PM6/6/18
to Ceres Solver
Hi,

Unfortunately i'm getting the following error when I try to build for iOS:

cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DIOS_PLATFORM=OS -DCMAKE_BUILD_TYPE=Release
-- Building with Xcode version: 9.4
-- Using C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Using CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- Building for minimum iOS version: 11.4 (SDK version: 11.4)
-- Removing iOS architecture: armv7 from build as it is not supported by the minimum iOS version to build for: 11.4 (iOS >= 11 requires 64-bit).
-- Removing iOS architecture: armv7s from build as it is not supported by the minimum iOS version to build for: 11.4 (iOS >= 11 requires 64-bit).
-- Configuring iOS build for platform: OS, architecture(s): arm64
-- Detected Ceres version: 1.14.0 from /Users/henkkortier/iOS projects/VINS-Mobile/VINS_ThirdPartyLib/ceres-solver/include/ceres/version.h
-- Building Ceres for iOS platform: OS
-- Building for iOS: Forcing use of miniglog instead of glog.
CMake Error at cmake/UpdateCacheVariable.cmake:42 (message):
  Specified variable to update in cache: TBB has not been set in the cache.
Call Stack (most recent call first):
  CMakeLists.txt:198 (update_cache_variable)

I've tried using both 1.14.0 and master. Anyone a clue? 

Alex Stewart

unread,
Jun 7, 2018, 3:09:32 PM6/7/18
to ceres-...@googlegroups.com
This is to do with the cmake_dependent_options() and when they are updated, I will fix this in master this week - but for now you can remove the:

update_cache_variable(TBB OFF)

line in the main CMakeLists.txt in the IOS block, as it will in fact be off by default.

-Alex

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/bf8d93fa-db1f-45e3-b98f-0d42c617ca32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henk Kortier

unread,
Jun 7, 2018, 4:17:51 PM6/7/18
to Ceres Solver
Tnx!

TBB error gone. But now I'm getting the following error:

cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DIOS_PLATFORM=OS -DCXX11=ON -DLAPACK=OFF -DCMAKE_BUILD_TYPE=Release
-- Building with Xcode version: 9.4
-- Using C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Using CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- Building for minimum iOS version: 11.4 (SDK version: 11.4)
-- Removing iOS architecture: armv7 from build as it is not supported by the minimum iOS version to build for: 11.4 (iOS >= 11 requires 64-bit).
-- Removing iOS architecture: armv7s from build as it is not supported by the minimum iOS version to build for: 11.4 (iOS >= 11 requires 64-bit).
-- Configuring iOS build for platform: OS, architecture(s): arm64
-- Detected Ceres version: 2.0.0 from /Users/henkkortier/iOS projects/VINS-Mobile/VINS_ThirdPartyLib/ceres-solver/include/ceres/version.h
-- Building Ceres for iOS platform: OS
-- Building for iOS: Forcing use of miniglog instead of glog.
-- Building for iOS: SuiteSparse, CXSparse, LAPACK, gflags, and OpenMP are not available.
-- Building for iOS: Will not build examples.
-- Building with C++11
-- No preference for use of exported Eigen CMake configuration set, and no hints for include directory provided. Defaulting to preferring an installed/exported Eigen CMake configuration if available.
-- Found installed version of Eigen: /usr/local/share/eigen3/cmake
-- Found Eigen version 3.3.4: /usr/local/include/eigen3
-- Enabling use of Eigen as a sparse linear algebra library.
-- Building without LAPACK.
-- Building without SuiteSparse.
-- Building without CXSparse.
-- Google Flags disabled; no tests or tools will be built!
-- Compiling minimal glog substitute into Ceres.
-- Using minimal glog substitute (include): internal/ceres/miniglog
-- Max log level for minimal glog substitute: 2
-- Building without OpenMP, disabling.
-- Neither OpenMP, TBB or C++11 threads is enabled, disabling multithreading.
-- Building Ceres as a static library.
-- Enabling CERES_USE_EIGEN_SPARSE in Ceres config.h
-- Enabling CERES_NO_LAPACK in Ceres config.h
-- Enabling CERES_NO_SUITESPARSE in Ceres config.h
-- Enabling CERES_NO_CXSPARSE in Ceres config.h
-- Enabling CERES_NO_THREADS in Ceres config.h
CMake Error at internal/ceres/CMakeLists.txt:241 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "AppleClang"

  version 9.1.0.9020039.


Op donderdag 7 juni 2018 21:09:32 UTC+2 schreef Lex:

Alex Stewart

unread,
Jun 8, 2018, 9:48:47 AM6/8/18
to ceres-...@googlegroups.com
Interesting.  So there was a chain on the CMake mailing list about this here, but I can recreate this issue even in master where the minimum CMake version we specify is 3.5 and irrespective of whether CMP0025 is explicitly enabled, but only when building for iOS (with the latest Xcode).  However the reported compiler ids:

-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039

are the same both for OS X (which builds fine) and iOS, which fails at the first use of target_compile_features().  I suspect that our iOS toolchain file is not setting something that is now required.  I will try and have a look at this later this week, but as of right now I don't have a great fix.  A dirty fix would be to comment out this line, it will mean that the C++ version / required features are not embedded in the Ceres CMake target, but you could manually specify the C++ standard version in your own project.

-Alex


Henk Kortier

unread,
Jun 13, 2018, 4:13:10 PM6/13/18
to Ceres Solver
Thanks Lex,

I'll wait for you observations and possible fix that is more elegant.


Op vrijdag 8 juni 2018 15:48:47 UTC+2 schreef Lex:

Alex Stewart

unread,
Jun 16, 2018, 3:58:43 PM6/16/18
to ceres-...@googlegroups.com
Henk

There are now two CLs [1] [2] out for review which should fix both parts of this issue.  The first is minor and will probably get merged soon, the latter is a bit more involved but should also land pretty quickly.

-Alex

Henk Kortier

unread,
Jun 24, 2018, 9:35:25 AM6/24/18
to Ceres Solver
Thanks a lot. Build successful again.

Op zaterdag 16 juni 2018 21:58:43 UTC+2 schreef Lex:
Reply all
Reply to author
Forward
0 new messages