[CppAD] Compilation issue on OSX

Dominique Orban dominique.orban at gmail.com
Fri Oct 11 14:33:47 EDT 2013


I'm configuring CppAD 20130927 on OSX 10.8.4 (Xcode 4.6.3) with the following setup

CC=gcc-4.8 CXX=g++-4.8 cmake .. -Dcmake_install_prefix=/tmp/cppad_install -Dcppad_testvector=std

gcc-4.8 and g++-4.8 were installed via Homebrew.

The configure step goes smoothly but `make check` fails with the following message:

--
[ 93%] Building CXX object test_more/CMakeFiles/test_more.dir/rev_sparse_hes.cpp.o
/tmp/cppad-20130927/test_more/rev_sparse_hes.cpp: In function 'bool {anonymous}::case_six()':
/tmp/cppad-20130927/test_more/rev_sparse_hes.cpp:496:22: error: no match for 'operator|=' (operand types are 'std::vector<bool>::reference {aka std::_Bit_reference}' and 'bool')
    Check[i * n + j] |= F2[i * n + k] & r[ k * n + j];
                     ^
/tmp/cppad-20130927/test_more/rev_sparse_hes.cpp:496:22: note: candidates are:
In file included from /usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/ios:42:0,
                from /usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/ostream:38,
                from /usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/iostream:39,
                from /tmp/cppad-20130927/cppad/error_handler.hpp:131,
                from /tmp/cppad-20130927/cppad/base_require.hpp:146,
                from /tmp/cppad-20130927/cppad/cppad.hpp:24,
                from /tmp/cppad-20130927/test_more/rev_sparse_hes.cpp:14:
/usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/bits/ios_base.h:169:3: note: const std::_Ios_Iostate& std::operator|=(std::_Ios_Iostate&, std::_Ios_Iostate)
  operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
  ^
/usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/bits/ios_base.h:169:3: note:   no known conversion for argument 1 from 'std::vector<bool>::reference {aka std::_Bit_reference}' to 'std::_Ios_Iostate&'
/usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/bits/ios_base.h:131:3: note: const std::_Ios_Openmode& std::operator|=(std::_Ios_Openmode&, std::_Ios_Openmode)
  operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
  ^
/usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/bits/ios_base.h:131:3: note:   no known conversion for argument 1 from 'std::vector<bool>::reference {aka std::_Bit_reference}' to 'std::_Ios_Openmode&'
/usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/bits/ios_base.h:91:3: note: const std::_Ios_Fmtflags& std::operator|=(std::_Ios_Fmtflags&, std::_Ios_Fmtflags)
  operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
  ^
/usr/local/Cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/bits/ios_base.h:91:3: note:   no known conversion for argument 1 from 'std::vector<bool>::reference {aka std::_Bit_reference}' to 'std::_Ios_Fmtflags&'
make[3]: *** [test_more/CMakeFiles/test_more.dir/rev_sparse_hes.cpp.o] Error 1
make[2]: *** [test_more/CMakeFiles/test_more.dir/all] Error 2
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2
--

This error does not occur if I use either the boost, eigen of cppad test vector options. According to Brad Bell, the error does not occur on Linux with gcc-4.8. It might be OSX specific. My C++ is nonexistent, so I don't understand the error message. 

Other things I've tried:

- change the version of gcc: all lead to the same error
- use clang / clang++ instead of gcc / g++: same error
- add CXXFLAGS='-std=c++11' or CXXFLAGS='-std=c++11 -stdlib=libc++': same error.

My goal is to submit a Homebrew [1] formula for CppAD to the Homebrew/Science tap [2]. My current formula is available from [3]. Any feedback would be greatly appreciated.

Thanks!

Dominique


[1] http://brew.sh
[2] https://github.com/Homebrew/homebrew-science
[3] https://gist.github.com/6938726


More information about the CppAD mailing list