Open bergen288 opened 4 years ago
What version of the boost headers are you using? I've seen something like this happen before when rstan was updated but BH
was not
Steve: My BH Version: 1.72.0-3. This is the most recent version in its R CRAN website.
Thanks.
This issue was actually reported 3 years ago here: https://github.com/stan-dev/rstan/issues/409. Dirk suggested to add -DBOOST_NO_AUTO_PTR
to disable "auto_ptr" so I added it at the end of following line in rstan/src/Makevars file.
PKG_CPPFLAGS = -I"../inst/include" -I"." -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR
The rstan package was installed without warning for auto_ptr. But it has lots of warning as below:
ld: 0711-768 WARNING: Object stan/lang/ast_def.o, section 1, function .stan::lang::bare_array_type::oid[abi:cxx11]() const:
The branch at address 0x91e1c is not followed by a recognized no-op
or TOC-reload instruction. The unrecognized instruction is 0x38210080.
ld: 0711-768 WARNING: Object stan/lang/ast_def.o, section 1, function .stan::lang::write_expression_vis::operator()[abi:cxx11](stan::lang::binary_op const&) const:
The branch at address 0x97314 is not followed by a recognized no-op
or TOC-reload instruction. The unrecognized instruction is 0xE8010090.
The key problem is that I have the same error shown in Current Output section. Now what? Thanks.
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! file12f01b635c2537.cpp:6:36: warning: ISO C++11 requires whitespace after the macro name
#define STAN__SERVICES__COMMAND_HPP#include <boost/integer/integer_log2.hpp>
^
In file included from /software/R/site-library/BH/include/boost/smart_ptr/shared_ptr.hpp:28,
from /software/R/site-library/BH/include/boost/shared_ptr.hpp:17,
from /software/R/site-library/BH/include/boost/date_time/time_clock.hpp:17,
from /software/R/site-library/BH/include/boost/date_time/posix_time/posix_time_types.hpp:10,
from /software/R/site-library/rstan/include/rstan/stan_fit.hpp:13,
from /software/R/site-library/rstan/include/rstan/rstaninc.hpp:3,
from file12f01b635c2537.cpp:7:
/software/R/site-library/BH/include/boost/smart_ptr/detail/shared_count.hpp:356:33: warning: 'template<class> class std::auto_ptr' is dep
Calls: stan ... cxxfunctionplus -> <Anonymous> -> cxxfunction -> compileCode
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '/opt/freeware/lib64/R/bin/R CMD SHLIB file12f01b635c2537.cpp 2> file12f01b635c2537.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection
Calls: stan -> stan_model -> cxxfunctionplus -> sink
Execution halted
It looks like the warning got cut off
warning: 'template<class> class std::auto_ptr' is dep
and it doesn't seem like the error is posted in your last comment.
I've never worked with a powerpc based system before so I can't say much, but it looks like the compiler is attempting to apply an instruction that does not exist? Can you post your full session info? If you are using -mtune=native
then maybe you can try -mtune=generic
?
Summary:
rstan compilation conflict with class std::auto_ptr.
Description:
rstan_2.19.3.tar.gz is installed with lots of warning message as below:
In /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include/c++/bits/unique_ptr.h, class auto_ptr is defined as
template<typename> class auto_ptr;
.In backward/auto_ptr.h which is included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include/c++/memory, class auto_ptr is defined twice:
Reproducible Steps:
Current Output:
Failed with warning: 'template class std::auto_ptr' is dep
Expected Output:
How to avoid the conflicted auto_ptr?
RStan Version:
rstan (Version 2.19.3, GitRev: 2e1f913d3ca3)
R Version:
R3.6.1
Operating System:
AIX7.2