clang++ -I src -I lib/eigen_3.1.2 -I /usr/include -O3 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -Wno-unused-function -Wno-uninitialized  -c -std=c++0x -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/gm/parser_test.cpp -o test/gm/parser.o
ar -rs bin/libstanc.a bin/stan/gm/grammars/expression_grammar_inst.o bin/stan/gm/grammars/whitespace_grammar_inst.o bin/stan/gm/grammars/program_grammar_inst.o bin/stan/gm/grammars/statement_grammar_inst.o bin/stan/gm/grammars/var_decls_grammar_inst.o bin/stan/gm/grammars/term_grammar_inst.o bin/stan/gm/grammars/statement_2_grammar_inst.o bin/stan/gm/ast_def.o
ar: creating bin/libstanc.a
clang++ -I src -I lib/eigen_3.1.2 -I /usr/include -O3 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -Wno-unused-function -Wno-uninitialized   lib/gtest_1.6.0/src/gtest_main.cc test/gm/parser.o -std=c++0x -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 -o test/gm/parser test/libgtest.a -Lbin -lstan -Lbin -lstanc
test/gm/parser.o: In function `stan::gm::statement_grammar<boost::spirit::classic::position_iterator2<boost::spirit::multi_pass<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::buffering_input_iterator, boost::spirit::iterator_policies::split_std_deque> >, boost::spirit::classic::file_position_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::statement_grammar(stan::gm::variable_map&, std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)':
src/test/gm/parser_test.cpp:(.text._ZN4stan2gm17statement_grammarIN5boost6spirit7classic18position_iterator2INS3_10multi_passINSt3__119istreambuf_iteratorIcNS7_11char_traitsIcEEEENS3_17iterator_policies14default_policyINSC_11ref_countedENSC_8no_checkENSC_24buffering_input_iteratorENSC_15split_std_dequeEEEEENS4_18file_position_baseINS7_12basic_stringIcSA_NS7_9allocatorIcEEEEEEEEEC2ERNS0_12variable_mapERNS7_18basic_stringstreamIcSA_SN_EE[_ZN4stan2gm17statement_grammarIN5boost6spirit7classic18position_iterator2INS3_10multi_passINSt3__119istreambuf_iteratorIcNS7_11char_traitsIcEEEENS3_17iterator_policies14default_policyINSC_11ref_countedENSC_8no_checkENSC_24buffering_input_iteratorENSC_15split_std_dequeEEEEENS4_18file_position_baseINS7_12basic_stringIcSA_NS7_9allocatorIcEEEEEEEEEC2ERNS0_12variable_mapERNS7_18basic_stringstreamIcSA_SN_EE]+0xb8): undefined reference to `stan::gm::statement_2_grammar<boost::spirit::classic::position_iterator2<boost::spirit::multi_pass<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::buffering_input_iterator, boost::spirit::iterator_policies::split_std_deque> >, boost::spirit::classic::file_position_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::statement_2_grammar(stan::gm::variable_map&, std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, stan::gm::statement_grammar<boost::spirit::classic::position_iterator2<boost::spirit::multi_pass<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::buffering_input_iterator, boost::spirit::iterator_policies::split_std_deque> >, boost::spirit::classic::file_position_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&)'
test/gm/parser.o: In function `stan::gm::expression_grammar<boost::spirit::classic::position_iterator2<boost::spirit::multi_pass<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::buffering_input_iterator, boost::spirit::iterator_policies::split_std_deque> >, boost::spirit::classic::file_position_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::expression_grammar(stan::gm::variable_map&, std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, bool)':
src/test/gm/parser_test.cpp:(.text._ZN4stan2gm18expression_grammarIN5boost6spirit7classic18position_iterator2INS3_10multi_passINSt3__119istreambuf_iteratorIcNS7_11char_traitsIcEEEENS3_17iterator_policies14default_policyINSC_11ref_countedENSC_8no_checkENSC_24buffering_input_iteratorENSC_15split_std_dequeEEEEENS4_18file_position_baseINS7_12basic_stringIcSA_NS7_9allocatorIcEEEEEEEEEC2ERNS0_12variable_mapERNS7_18basic_stringstreamIcSA_SN_EEb[_ZN4stan2gm18expression_grammarIN5boost6spirit7classic18position_iterator2INS3_10multi_passINSt3__119istreambuf_iteratorIcNS7_11char_traitsIcEEEENS3_17iterator_policies14default_policyINSC_11ref_countedENSC_8no_checkENSC_24buffering_input_iteratorENSC_15split_std_dequeEEEEENS4_18file_position_baseINS7_12basic_stringIcSA_NS7_9allocatorIcEEEEEEEEEC2ERNS0_12variable_mapERNS7_18basic_stringstreamIcSA_SN_EEb]+0x8d): undefined reference to `stan::gm::term_grammar<boost::spirit::classic::position_iterator2<boost::spirit::multi_pass<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::buffering_input_iterator, boost::spirit::iterator_policies::split_std_deque> >, boost::spirit::classic::file_position_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::term_grammar(stan::gm::variable_map&, std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, stan::gm::expression_grammar<boost::spirit::classic::position_iterator2<boost::spirit::multi_pass<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::buffering_input_iterator, boost::spirit::iterator_policies::split_std_deque> >, boost::spirit::classic::file_position_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [test/gm/parser] Error 1
goodrich@CYBERPOWERPC:/opt/stan$
I'm not seeing all that much progress. With g++-4.7 the same tests are failing. With clang-3.2, it is now failing to link
CFLAGS += -std=c++0x
CFLAGS += -stdlib=libc++
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O3 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -std=c++0x -stdlib=libc++ -Wno-unused-function -Wno-uninitialized   lib/gtest_1.6.0/src/gtest_main.cc test/gm/parser.o -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 -o test/gm/parser test/libgtest.a -Lbin -lstan -Lbin -lstanc
bin/libstanc.a(expression_grammar_inst.o):(.bss+0x2): multiple definition of `stan::gm::binary_op_f'
test/gm/parser.o:(.bss+0xc): first defined here
bin/libstanc.a(expression_grammar_inst.o):(.bss+0x4): multiple definition of `stan::gm::subtraction'
test/gm/parser.o:(.bss+0xe): first defined here
bin/libstanc.a(expression_grammar_inst.o):(.bss+0x1): multiple definition of `stan::gm::set_fun_type2_f'
test/gm/parser.o:(.bss+0xb): first defined here
bin/libstanc.a(expression_grammar_inst.o):(.bss+0x0): multiple definition of `stan::gm::validate_expr_type2_f'
test/gm/parser.o:(.bss+0xa): first defined here
bin/libstanc.a(expression_grammar_inst.o):(.bss+0x3): multiple definition of `stan::gm::addition'
test/gm/parser.o:(.bss+0xd): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [test/gm/parser] Error 1
This brings up some questions:
  Question 1:  If we just turn off all the C++11 features,
  is Stan passing tests on all the platforms it passed tests
  for in version 1.0.3?
  Question 2:  How much work do we need to do to back out any
  C++11 dependencies in the new test code?
  Question 3:  Is there some reason (perhaps having to do with
  R, availability on the Mac or Windows, etc) that we can't move
  to always building everything with C++11 flags?
  Question 4:  What versions of clang++ and g++ under what
  backend configs do we need to support?
I just realized it's risky to try to test under C++11 and
run under no C++11. Â I'd rather test the same thing we run.
For the record, as of right now, I can run:
  Platform:
   Mac OS X 10.8.2
  Compiler:
   Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  Linker:
   Not even sure what the default is here now that I know
   there are so many ways it can be configured front and back and lib
  CFLAGS:
   ?? (I'm running the defaults, but looking at output of "make test-unit", they seem to vary)
   -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -Wno-unused-function -Wno-tautological-compare
   ?? in building gtest, I also see -std=c++0x and then:
      c1plus: error: unrecognized command line option "-std=c++0x"
  CFLAGS_GTEST:
   ?? (same issue as above -- not sure where the GTEST ones apply)
I haven't figured out a magic set of C++11 flags to let me
compile with g++ on the same platform.
I'm not seeing all that much progress. With g++-4.7 the same tests are failing. With clang-3.2, it is now failing to link
goodrich@CYBERPOWERPC:/tmp$ strings parser_4.6 | sort | uniq > strings_parser_4.6.txt
goodrich@CYBERPOWERPC:/tmp$ strings parser_4.7 | sort | uniq > strings_parser_4.7.txt
On Sunday, December 9, 2012 5:21:42 PM UTC-5, Ben Goodrich wrote:I'm not seeing all that much progress. With g++-4.7 the same tests are failing. With clang-3.2, it is now failing to link
To clarify, that linker error is with applying the c++0x to gtest only. If the c++0x is applied to everything viaCFLAGS += -std=c++0x
CFLAGS += -stdlib=libc++
then there is a different linking error
git diff --word-diff=color g++-4.6 g++-4.7boost::* [with T = boost::recursive_wrapper<stan::gm::array_literal>, boost::*
boost::* [with T = boost::recursive_wrapper<stan::gm::array_literal>; boost::*
bool boost::spirit::qi::error_handlerstatic typename MultiPass ...
... typename MultiPass::reference = char&]
g++-4.6
while g++-4.7 has a variant that ends with char& and a variant that
ends with char (see lines 1336 and 1337 of the earlier
strings_parser_4.7.txt).I think the problem with the parser test was that
the includes were for the _def.hpp with the definitions
rather than just the headers in the .hpp files.
The size issues were probably due to the double definitions.
The current makefile does NOT use any c++11 features
for g++ or clang++ in the os_mac config. Â For clang++,
Daniel even included warnings for c++11 extensions.
With the current makefile, tests pass for me on
Mac OS X Lion, with latest Xcode versions of g++
and clang++ at -O0 and -O3 optimization:
~/stan>clang++ --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
~/stan>g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Before the change they passed with g++ -O0, but not g++ -O3.
I'm not sure why it would've worked with -O0 given the double definitions.
I'm wondering if the ';' vs ',' in the strings output is
just a change in arbitrary convention rather than something
important.
I'll try to install clang++ 3.2 and g++ 4.7 version and see if I can
get it working.
CFLAGS += -stdlib=libc++ -std=c++98
With a recent clang and
Th
CFLAGSÂ +=Â -stdlib=libc++Â -std=c++98
I still have parser failures and weird boost warnings, although everything compiles. Note that the above uses the LLVM version of the standard C++ library (as opposed to GCC's), which is allegedly c++11 compliant, but can also be used with the old standard.
CFLAGSÂ +=Â -stdlib=libc++Â -std=c++98? If that works, then I think it is fine if we just document that Linux currently requires GCC's version of the standard C++ library.
- Bob
--
In file included from lib/boost_1.52.0/boost/iterator/reverse_iterator.hpp:12:
lib/boost_1.52.0/boost/iterator/iterator_adaptor.hpp:306:18: warning: returning reference to local temporary object
[-Wreturn-stack-address]
     { return *m_iterator; }
---------------------------------------
That latter issue also doesn't look like our fault, as we didn't
write the function which is returning a ref to a local temporary.
I also added the above to the wiki.
This won't really help in the short term, but I have an 8 core machine that is sitting relatively idle right now. Â I could repurpose it to a LInux buildbot with Jenkins. Â I've not set Jenkins up before, but if someone gave me a few pointers and maybe send along the Stan-specific configuration being used I'm sure if wouldn't be too hard. Â Just a thought.
On 12/14/12 4:44 AM, Ben Goodrich wrote:
 > ... we can revisit the idea
 > of using no optimization to compile stanc. Optimization of stanc expends a lot of RAM for no discernible benefit to
 > users, as opposed to libstan where it actually makes a difference for users' models.
Compiling stanc with -O0 seems the right thing
to do.
Given the enormous problems we've had (and are still having) with
1.0.4, I think we need to (1) decide on which tests we really care
about, and (2) automate the running of all the tests we want to run.
I have to say that I'm still completely overwhelmed by the
combinatorics of the compilation portability problem, which
presents us with at least the following set of knobs to twiddle:
  - Platform (Windows, Mac, Linux)
--
Â
Â
Jenkins is back up.
Can you hard-code O=0 into make bin/stanc$(EXE) ?
On 12/14/12 3:31 PM, Ben Goodrich wrote:
> On Friday, December 14, 2012 2:04:59 PM UTC-5, Bob Carpenter wrote:
>
> Â Â On 12/14/12 4:44 AM, Ben Goodrich wrote:
> Â Â Â > ... we can revisit the idea
> Â Â Â > of using no optimization to compile stanc. Optimization of stanc expends a lot of RAM for no discernible benefit to
> Â Â Â > users, as opposed to libstan where it actually makes a difference for users' models.
>
> Â Â Compiling stanc with -O0 seems the right thing
> Â Â to do.
>
>
> I wasn't sure how to modify make/command to hard code O=0. I tried to see if Jenkins would pass with O=0 globally, but
> Jenkins seems to be down at the moment.
>
> Â Â Given the enormous problems we've had (and are still having) with
> Â Â 1.0.4, I think we need to (1) decide on which tests we really care
> Â Â about, and (2) automate the running of all the tests we want to run.
>
>
> Clearly, there are limits to what we can do, but we should try to do a reasonable amount and then invite users to post
> if they have some configuration that doesn't work.
To me, the reasonable amount is just what we support.
I'd rather not encourage users to inundate us with test
failures on unsupported configs.
We could open it up the public to edit and then it won't fall to
us.
On the Mac, g++ defaults to g++03.
Is that different on Linux(es)?
I say we wait on C++11 until it's the R default.
That should put an end to our C++11 woes indefinitely
unless Eigen or Boost make it their default first.
--
Â
Â
--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Â
Â
<parser_warnings.txt>
This issue that we had before where we would get a ton of long, confusing warnings when compiling stanc if either --std=c++11 or --stdlib=libc++ (the clang version of the standard library) has morphed into short, clear warnings with the clang++ 3.3 RC (see attached).
src/stan/gm/ast.hpp:150:19: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:242:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:277:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:286:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:318:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:359:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:577:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:150:19: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:242:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:277:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:286:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:318:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:359:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
src/stan/gm/ast.hpp:577:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'src/test/prob/distributions/univariate/continuous/student_t_test.cpp:35:24: error: non-constant-expression cannot be narrowed from type 'int' to 'double' in
src/test/prob/distributions/univariate/continuous/student_t_test.cpp:35:31: error: non-constant-expression cannot be narrowed from type 'int' to 'double' in
src/test/prob/distributions/univariate/continuous/student_t_test.cpp:35:38: error: non-constant-expression cannot be narrowed from type 'int' to 'double' in
src/test/prob/distributions/univariate/continuous/student_t_test.cpp:35:45: error: non-constant-expression cannot be narrowed from type 'int' to 'double' in
src/test/prob/distributions/univariate/continuous/student_t_test.cpp:35:52: error: non-constant-expression cannot be narrowed from type 'int' to 'double' in
src/test/prob/distributions/univariate/continuous/scaled_inv_chi_square_test.cpp:35:24: error: non-constant-expression cannot be narrowed from type 'int' to 'double'
src/test/prob/distributions/univariate/continuous/scaled_inv_chi_square_test.cpp:35:31: error: non-constant-expression cannot be narrowed from type 'int' to 'double'
src/test/prob/distributions/univariate/continuous/scaled_inv_chi_square_test.cpp:35:38: error: non-constant-expression cannot be narrowed from type 'int' to 'double'
src/test/prob/distributions/univariate/continuous/scaled_inv_chi_square_test.cpp:35:45: error: non-constant-expression cannot be narrowed from type 'int' to 'double'
src/test/prob/distributions/univariate/continuous/scaled_inv_chi_square_test.cpp:35:52: error: non-constant-expression cannot be narrowed from type 'int' to 'double'