I posted earlier today, and I think now that the problem might not be RICE
at all. I just tried to compile something that I *know* should compile
properly, which does not use RICE, and it didn't work with a *different* boost
library (in this case
Hi there,
Cross-posted this to the RICE listserv, but they cannot reproduce. I can reproduce it on karmic and lucid (ubuntu), separate machines, in boost 1.43.0. RICE is a C++ interface for Ruby (not unlike boost python).
If I include boost numeric ublas matrix_sparse and either rice/Data_Type.hpp or rice/Constructor.hpp, I get a lot of errors -- even if I do nothing with them.
For example, this works:
#include
int main() { return 0; }
So does this:
#include
int main() { return 0; }
But if I put both #includes in, it gives the following errors:
$ make g++ -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -I/usr/lib/ruby/gems/1.8/gems/rice-1.3.2/ruby/lib/include -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -g -c main.cpp In file included from /usr/local/include/boost/numeric/ublas/storage_sparse.hpp:23, from /usr/local/include/boost/numeric/ublas/vector_sparse.hpp:16, from /usr/local/include/boost/numeric/ublas/matrix_sparse.hpp:16, from main.cpp:5: /usr/local/include/boost/numeric/ublas/storage.hpp:60: error: expected primary-expression before ‘)’ token /usr/local/include/boost/numeric/ublas/storage.hpp:65: error: expected primary-expression before ‘)’ token /usr/local/include/boost/numeric/ublas/storage.hpp:79: error: expected primary-expression before ‘)’ token /usr/local/include/boost/numeric/ublas/storage.hpp: In member function ‘typename ALLOC::size_type boost::numeric::ublas::unbounded_array
::max_size() const’: /usr/local/include/boost/numeric/ublas/storage.hpp:174: error: expected primary-expression before ‘)’ token /usr/local/include/boost/numeric/ublas/storage.hpp:174: error: expected ‘;’ before ‘ruby_xmalloc’ /usr/local/include/boost/numeric/ublas/storage.hpp:174: error: expected primary-expression before ‘)’ token /usr/local/include/boost/numeric/ublas/storage.hpp: In member function ‘typename ALLOC::size_type boost::numeric::ublas::bounded_array ::max_size() const’: /usr/local/include/boost/numeric/ublas/storage.hpp:357: error: expected primary-expression before ‘)’ token /usr/local/include/boost/numeric/ublas/storage.hpp:357: error: expected ‘;’ before ‘ruby_xmalloc’ /usr/local/include/boost/numeric/ublas/storage.hpp:357: error: expected primary-expression before ‘)’ token In file included from /usr/local/include/boost/numeric/ublas/vector_sparse.hpp:16, from /usr/local/include/boost/numeric/ublas/matrix_sparse.hpp:16, from main.cpp:5: /usr/local/include/boost/numeric/ublas/storage_sparse.hpp: At global scope: /usr/local/include/boost/numeric/ublas/storage_sparse.hpp:240: error: expected primary-expression before ‘)’ token make: *** [main.o] Error 1 ruby_xmalloc does not seem to exist in that file, so I gather it's having some kind of syntax hiccup that is leaking into later #includes.
Here are other relevant details:
$ sudo gem list --local |grep rice rice (1.3.2, 1.3.1)
I seem to get the same bug with both boost 1.41 and boost 1.43, though sometimes I have trouble telling which one I'm including.
Should this be a bug report, or am I missing something stupid?
*(I'd be eternally grateful if you'd reply to me as well as to the list.)*
Thanks so much, John
PS: extconf.rb below. Works fine for other projects, as long as I don't use matrix_sparse.
require 'rubygems' require 'mkmf-rice'
dir_config("boost")
have_library("stdc++") have_library("boost") have_library("boost_filesystem") if RUBY_VERSION =~ /1.9/ then $CPPFLAGS += " -DRUBY_19" end
create_makefile('main')
-- John Woods Marcotte Lab Center for Systems and Synthetic Biology The University of Texas at Austin