parser not building under C++11

35 views
Skip to first unread message

Ben Goodrich

unread,
Jun 23, 2016, 3:04:10 PM6/23/16
to stan development mailing list
I am getting a build error from the parser when C++11 is explicitly or implicitly (in the case of g++-6) used. I think it was working before, but I can't think of anything I would have done that could affect it. Log attached.

Ben

parser_error.txt

Daniel Lee

unread,
Jun 23, 2016, 3:05:26 PM6/23/16
to stan-dev mailing list
Is there a way I can reproduce this locally? Or possibly log into a machine that has it set up?


Daniel


On Thu, Jun 23, 2016 at 3:04 PM, Ben Goodrich <goodri...@gmail.com> wrote:
I am getting a build error from the parser when C++11 is explicitly or implicitly (in the case of g++-6) used. I think it was working before, but I can't think of anything I would have done that could affect it. Log attached.

Ben

--
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/d/optout.

Ben Goodrich

unread,
Jun 23, 2016, 5:51:45 PM6/23/16
to stan development mailing list
On Thursday, June 23, 2016 at 3:05:26 PM UTC-4, Daniel Lee wrote:
Is there a way I can reproduce this locally? Or possibly log into a machine that has it set up?

You can pull all of the rstan repo, including the submodules in StanHeaders/inst/include and then do

R CMD build StanHeaders
R CMD INSTALL StanHeaders_2.10.0-2.tar.gz
R CMD build rstan/rstan
R CMD INSTALL rstan_2.10.1.tar.gz

I fixed it by changing rstan/rstan/src/Makevars to define BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK rather than -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE but that doesn't work under the pre-C++11 standard, so now it is using C++11 on everything but Windows and leaving -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE instead of -DBOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK on Windows.

Ben


Daniel Lee

unread,
Jun 23, 2016, 5:52:38 PM6/23/16
to stan-dev mailing list
Sorry -- I don't have that compiler.


Do you have it on a machine that I can remote into?


Daniel


Ben Goodrich

unread,
Jun 23, 2016, 5:54:14 PM6/23/16
to stan development mailing list
On Thursday, June 23, 2016 at 5:52:38 PM UTC-4, Daniel Lee wrote:
Sorry -- I don't have that compiler.

It is the same with clang++. It is just a matter of whether you use --std=c++11 or not.

Daniel Lee

unread,
Jun 23, 2016, 5:55:59 PM6/23/16
to stan-dev mailing list
Ok. I'll try it now.

--

Daniel Lee

unread,
Jun 23, 2016, 6:04:02 PM6/23/16
to stan-dev mailing list
Ben, I'm gonna need more help.

What branch are you on? On that branch, are the flags set up so it'll fail?

I just tried adding `-std=c++11` to clang++ and it was fine. Would you mind sending more explicit instructions so I can actually reproduce the issue?



Daniel

Ben Goodrich

unread,
Jun 23, 2016, 6:08:24 PM6/23/16
to stan development mailing list
On Thursday, June 23, 2016 at 6:04:02 PM UTC-4, Daniel Lee wrote:
Ben, I'm gonna need more help.

What branch are you on? On that branch, are the flags set up so it'll fail?

develop, and the flags are set up so that it doesn't fail. To get it to fail, you would first have to do something like

cp rstan/rstan/src/Makevars.win rstan/rstan/src/Makevars.

Ben

Daniel Lee

unread,
Jun 23, 2016, 6:27:08 PM6/23/16
to stan-dev mailing list
I did that and I'm ok. There are a lot of warnings, but it compiled.

The output is attached. Let me know how you want to proceed. Here is what I did:
- I cloned rstan
- I updated rstan to the develop branch: 48a50a94c
- I went to StanHeaders/inst/include/mathlib and updated to develop: 91cb184a9
- I went to StanHeaders/inst/include/upstream and updated to develop: 0c492ab81
- I did this: cp rstan/rstan/src/Makevars.win rstan/rstan/src/Makevars
- then I did:

R CMD build StanHeaders
R CMD INSTALL StanHeaders_2.10.0-2.tar.gz
R CMD build rstan/rstan
R CMD INSTALL rstan_2.10.1.tar.gz

The output is from the last line.


Can you try with a different compiler with -std=c++11?



Daniel


installation.txt

Ben Goodrich

unread,
Jun 23, 2016, 6:43:26 PM6/23/16
to stan development mailing list
On Thursday, June 23, 2016 at 6:27:08 PM UTC-4, Daniel Lee wrote:
I did that and I'm ok. There are a lot of warnings, but it compiled.

The output is attached. Let me know how you want to proceed. Here is what I did:
- I cloned rstan
- I updated rstan to the develop branch: 48a50a94c
- I went to StanHeaders/inst/include/mathlib and updated to develop: 91cb184a9
- I went to StanHeaders/inst/include/upstream and updated to develop: 0c492ab81
- I did this: cp rstan/rstan/src/Makevars.win rstan/rstan/src/Makevars

The cp accidentally overwrote the instructions to use C++11, in which case it should work. You can force C++11 by first defining

export USE_CXX1X=1

and then doing
 
R CMD INSTALL rstan_2.10.1.tar.gz

again. I can trigger the error with either g++ or clang++ using C++11 and -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE but g++ has a less readable error log than the clang++ one I first attached.

Ben

Daniel Lee

unread,
Jun 24, 2016, 1:01:53 AM6/24/16
to stan-dev mailing list
Ben, I just did what you said and it still works.

See attached.



installation.txt
Reply all
Reply to author
Forward
0 new messages