error in when running r stan

1,370 views
Skip to first unread message

Zhongfa Liao

unread,
Aug 4, 2015, 11:53:17 PM8/4/15
to Stan users mailing list
Hi, 
My code works well in windows8, but when I run the code in win7, some error occurs, 
Warning message:
running command 'make -f "C:/USER_P~1/R/R-32~1.1/etc/x64/Makeconf" -f "C:/USER_P~1/R/R-32~1.1/share/make/winshlib.mk" -f "C:\Users\Felix\Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file1170f723401.dll" WIN=64 TCLBIN=64 OBJECTS="file1170f723401.o"' had status 127 

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:
  1: 
  2: // includes from the plugin
  3: 
  4: 
  5: // user includes
  6: #define STAN__SERVICES__COMMAND_HPP// Code generated by Stan version 2.7
  7: 
  8: #include <stan/model/model_header.hpp>
  9: 
 10: namespace model1170185b14ca_M1_code_namespace {
 11: 
 12: using std::istream;
 13: using std::string;
 14: using std::stringstream;
 15: using std::vector;
 16: using stan::io::dump;
 17: using stan::math::lgamma;
 18: using stan::model::prob_grad;
 19: using namespace stan::math;
 20: 
 21: typedef Eigen::Matrix<double,Eigen::Dynamic,1> vector_d;
 22: typedef Eigen::Matrix<double,1,Eigen::Dynamic> row_vector_d;
 23: typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> matrix_d;
 24: 
 25: static int current_statement_begin__;
 26: class model1170185b14ca_M1_code : public prob_grad {
 27: private:
 28:     int N;
 29:     int J;
 30:     vector_d y;
 31:     vector_d x;
 32:     vector<int> gene;
 33: public:
......
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! Warning message:
running command 'make -f "C:/USER_P~1/R/R-32~1.1/etc/x64/Makeconf" -f "C:/USER_P~1/R/R-32~1.1/share/make/winshlib.mk" -f "C:\Users\Felix\Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file1170f723401.dll" WIN=64 TCLBIN=64 OBJECTS="file1170f723401.o"' had status 127 
In addition: Warning messages:
1: running command '"C:/User_Program_Files/R/R-3.2.1/bin/x64/R" CMD config CXX' had status 1 
2: running command 'C:/User_Program_Files/R/R-3.2.1/bin/x64/R CMD SHLIB file1170f723401.cpp 2> file1170f723401.cpp.err.txt' had status 1 

How can I fix it? 
Thank you !

Ben Goodrich

unread,
Aug 5, 2015, 12:01:39 AM8/5/15
to Stan users mailing list
On Tuesday, August 4, 2015 at 11:53:17 PM UTC-4, Zhongfa Liao wrote:
status 127 

This is the code for "can't find some program", in this case probably g++. If you didn't install Rtools, do that. If you did, try executing

devtools::find_rtools(TRUE)

and see what that says.

Ben


Zhongfa Liao

unread,
Aug 5, 2015, 12:03:22 AM8/5/15
to stan-...@googlegroups.com
> devtools::find_rtools(TRUE)
Error in loadNamespace(name) : there is no package called ‘devtools’

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/tbhjcjF-Egs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ph.D. Candidate, Photonics group
Dept. of Electrical and Computer Engineering
Faculty of Applied Science & Engineering | University of Toronto
35 St. George Street | Room 452 | Toronto, ON | M5S 1A4

Zhongfa Liao

unread,
Aug 5, 2015, 12:12:37 AM8/5/15
to stan-...@googlegroups.com
SORRY, please ignore the last message. I have figure out. Thank you !

Ben Goodrich

unread,
Aug 5, 2015, 12:12:49 AM8/5/15
to Stan users mailing list
On Wednesday, August 5, 2015 at 12:03:22 AM UTC-4, Zhongfa Liao wrote:
> devtools::find_rtools(TRUE)
Error in loadNamespace(name) : there is no package called ‘devtools’

First install devtools via

install.packages("devtools")

Ben
 

Zhongfa Liao

unread,
Aug 5, 2015, 12:17:38 AM8/5/15
to stan-...@googlegroups.com
Sorry, I have installed the Rtools, but the warning is still there. 

WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 3.3 from http://cran.r-project.org/bin/windows/Rtools/ and then run find_rtools().
 
My computer is a university secure computer, does this cause a problem?
Thank you !

Ben Goodrich

unread,
Aug 5, 2015, 12:24:20 AM8/5/15
to Stan users mailing list
On Wednesday, August 5, 2015 at 12:17:38 AM UTC-4, Zhongfa Liao wrote:
My computer is a university secure computer, does this cause a problem?

Yes, if it means you do not have administrative privileges to modify the PATH (which the install for Rtools does). The best thing to do would be to talk to whoever manages the computer and ask them to install Rtools.

Ben
 

Zhongfa Liao

unread,
Aug 5, 2015, 10:28:47 AM8/5/15
to stan-...@googlegroups.com
Thank you very much, Ben !

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/tbhjcjF-Egs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhongfa Liao

unread,
Aug 5, 2015, 11:14:41 AM8/5/15
to stan-...@googlegroups.com
Hello, Ben, 
Sorry to disturb you again, I installed the Rtools, 
> devtools::find_rtools(TRUE)
Scanning path...
Scanning registry...
Found c:/User_Program_Files/Rtools for 3.3 
VERSION.txt
Rtools version 3.3.0.1958 
[1] TRUE
However, same error still exists. 
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! Warning message:
running command 'make -f "C:/USER_P~1/R/R-32~1.1/etc/x64/Makeconf" -f "C:/USER_P~1/R/R-32~1.1/share/make/winshlib.mk" -f "C:\Users\Felix\Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file71c46b21834.dll" WIN=64 TCLBIN=64 OBJECTS="file71c46b21834.o"' had status 127 
In addition: Warning messages:
1: running command '"C:/User_Program_Files/R/R-3.2.1/bin/x64/R" CMD config CXX' had status 1 
2: running command 'C:/User_Program_Files/R/R-3.2.1/bin/x64/R CMD SHLIB file71c46b21834.cpp 2> file71c46b21834.cpp.err.txt' had status 1 

Ben Goodrich

unread,
Aug 5, 2015, 11:45:43 AM8/5/15
to Stan users mailing list
On Wednesday, August 5, 2015 at 11:14:41 AM UTC-4, Zhongfa Liao wrote:
Hello, Ben, 
Sorry to disturb you again, I installed the Rtools, 
> devtools::find_rtools(TRUE)
Scanning path...
Scanning registry...
Found c:/User_Program_Files/Rtools for 3.3 

It appears as if Rtools was found in the registry but not in the path. Make sure when you install Rtools that you check the box allowing it to modify the path as explained in the picture at

https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows#install-rtools

Then you may need to restart R, your computer, etc. for it to take effect.

Ben
 

Avraham Adler

unread,
Aug 5, 2015, 11:58:00 AM8/5/15
to Stan users mailing list
If you open a command window and type PATH, that should be enough for Windows to "register" the new path (just check that the Rtools subdirectories are before any other instance of gcc. Better yet, remove others from the path while you use Rtools).

Avi
Reply all
Reply to author
Forward
0 new messages