Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis: system includes not treated as such by gcc on osx #67

Open
bchretien opened this issue Jul 25, 2014 · 4 comments
Open

Travis: system includes not treated as such by gcc on osx #67

bchretien opened this issue Jul 25, 2014 · 4 comments

Comments

@bchretien
Copy link
Member

Compilation currently fails on Travis with osx + gcc-4.8. It seems that system includes (e.g. -isystem /usr/include) end up being treated as normal includes (-I/usr/include), and warnings in Eigen become errors.

Scanning dependencies of target roboptim-core
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/roboptim-core.dir/build.make src/CMakeFiles/roboptim-core.dir/build
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /tmp/_travis/build/CMakeFiles 44
[  1%] Building CXX object src/CMakeFiles/roboptim-core.dir/finite-difference-gradient.cc.o
cd /tmp/_travis/build/src && /usr/local/bin/g++-4.8   -Droboptim_core_EXPORTS --coverage -Werror  -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -DROBOPTIM_DO_NOT_CHECK_ALLOCATION -fvisibility=hidden -fPIC -I/tmp/_travis/build -I/tmp/_travis/build/include -I/Users/travis/build/roboptim/roboptim-core/include -I/usr/local/include -I/tmp/_travis/install/include/eigen3 -I/usr/local/Cellar/log4cxx/0.10.0/include     -I/tmp/_travis/install/include/eigen3 -I/usr/local/Cellar/log4cxx/0.10.0/include -o CMakeFiles/roboptim-core.dir/finite-difference-gradient.cc.o -c /Users/travis/build/roboptim/roboptim-core/src/finite-difference-gradient.cc
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /tmp/_travis/build/CMakeFiles 45
[  2%] Building CXX object src/CMakeFiles/roboptim-core.dir/generic-solver.cc.o
cd /tmp/_travis/build/src && /usr/local/bin/g++-4.8   -Droboptim_core_EXPORTS --coverage -Werror  -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -DROBOPTIM_DO_NOT_CHECK_ALLOCATION -fvisibility=hidden -fPIC -I/tmp/_travis/build -I/tmp/_travis/build/include -I/Users/travis/build/roboptim/roboptim-core/include -I/usr/local/include -I/tmp/_travis/install/include/eigen3 -I/usr/local/Cellar/log4cxx/0.10.0/include     -I/tmp/_travis/install/include/eigen3 -I/usr/local/Cellar/log4cxx/0.10.0/include -o CMakeFiles/roboptim-core.dir/generic-solver.cc.o -c /Users/travis/build/roboptim/roboptim-core/src/generic-solver.cc
In file included from /tmp/_travis/install/include/eigen3/Eigen/Core:259:0,
                 from /Users/travis/build/roboptim/roboptim-core/include/roboptim/core/function.hh:35,
                 from /Users/travis/build/roboptim/roboptim-core/include/roboptim/core/problem.hh:36,
                 from /Users/travis/build/roboptim/roboptim-core/include/roboptim/core/generic-solver.hh:32,
                 from /Users/travis/build/roboptim/roboptim-core/src/generic-solver.cc:22:
/tmp/_travis/install/include/eigen3/Eigen/src/Core/MathFunctions.h: In static member function 'static Scalar Eigen::internal::random_default_impl<Scalar, false, true>::run()':
/tmp/_travis/install/include/eigen3/Eigen/src/Core/MathFunctions.h:511:61: error: conversion to 'int' from 'long unsigned int' may alter its value [-Werror=conversion]
     enum { rand_bits = floor_log2<(unsigned int)(RAND_MAX)+1>::value,
                                                             ^
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/roboptim-core.dir/generic-solver.cc.o] Error 1
make[1]: *** [src/CMakeFiles/roboptim-core.dir/all] Error 2
make: *** [all] Error 2

Possible related issue: http://public.kitware.com/Bug/view.php?id=10837

@bchretien bchretien added the bug label Jul 25, 2014
@bchretien bchretien changed the title Travis: system includes not treated as such with osx Travis: system includes not treated as such by gcc on osx Jul 25, 2014
@bchretien
Copy link
Member Author

Indeed, at the end of /usr/share/cmake-3.0/Modules/Compiler/GNU.cmake (whatever the path for your distribution):

  if(NOT APPLE)
    set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
  endif()

If this is just it, we can simply patch that in the jrl-cmakemodules, but someone on Mac OS X would need to test it first. Note that Clang.cmake does support -isystem, so the stock gcc with the clang backend does not have this problem.

@thomas-moulard
Copy link
Member

So the patch would be to always disable "-Werror" on Mac OS X, I guess?
If I understand correctly the ticket "-isystem" is not supported which means that there is almost no way to compile roboptim-core on Mac OS X with the default setup?

@bchretien
Copy link
Member Author

Apparently, -isystem is supported. It may not have been the case 7 years ago when this was added, but I guess it is now... Someone with Mac OS X could check. So we either disable -Werror or enable -isystem for OS X. The latter seems better if we're sure that this is indeed supported.

bchretien pushed a commit to bchretien/roboptim-core that referenced this issue Jul 25, 2014
@bchretien
Copy link
Member Author

Apparently, this was finally fixed in CMake 3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants