stan-dev / stan-dev/rstan

Errors after installing RTools twice!

Open
#467 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

I followed the instructions to install R tools. I already had R (v 3.4.1) and R studio (v1.0.143) installed. I checked the box for 'PATH' as directed in installation instructions. I checked the path in R with the command Sys.getenv("PATH"), and the first couple items looked like " "C:\Program Files\R\R-3.4.1\bin\x64;C:\RBuildTools\3.4\bin;C:\RBuildTools\3.4\mingw_32\bin;C:\GTK\bin;C:\Program Files ...." which appears to look correct. However, when I run the function to check if the toolchain works, I get an error (below). I use C++ a lot for coding...so it's not that I don't have a c++ compiler.

Description:

I entered this after installing Rtools 3.4.1964. Rstan library was loaded.

fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
' )
fx( 2L, 5 ) # should be 10

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! c:/Rtools/mingw_64/bin/g++: not found
make: *** [fileb6c71d233ce.o] Error 127
Warning message:
running command 'make -f "C:/PROGRA1/R/R-341.1/etc/x64/Makeconf" -f "C:/PROGRA1/R/R-341.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="fileb6c71d233ce.dll" WIN=64 TCLBIN=64 OBJECTS="fileb6c71d233ce.o"' had status 2
In addition: Warning message:
running command 'C:/PROGRA1/R/R-341.1/bin/x64/R CMD SHLIB fileb6c71d233ce.cpp 2> fileb6c71d233ce.cpp.err.txt' had status 1

fx( 2L, 5 ) # should be 10
Error in fx(2L, 5) : could not find function "fx"

Reproducible Steps:

See above.

Current Output:

fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
' )
fx( 2L, 5 ) # should be 10

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! c:/Rtools/mingw_64/bin/g++: not found
make: *** [fileb6c71d233ce.o] Error 127
Warning message:
running command 'make -f "C:/PROGRA1/R/R-341.1/etc/x64/Makeconf" -f "C:/PROGRA1/R/R-341.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="fileb6c71d233ce.dll" WIN=64 TCLBIN=64 OBJECTS="fileb6c71d233ce.o"' had status 2
In addition: Warning message:
running command 'C:/PROGRA1/R/R-341.1/bin/x64/R CMD SHLIB fileb6c71d233ce.cpp 2> fileb6c71d233ce.cpp.err.txt' had status 1

fx( 2L, 5 ) # should be 10
Error in fx(2L, 5) : could not find function "fx"

Expected Output:

Not an error like this. Expected 10 as example states.

RStan Version:

2.16.2

R Version:

3.4.1 (2017-06-30)

Operating System:

Your operating system Windows 10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the R CMD SHLIB command and the referenced R-3.4.1/etc/x64/Makeconf and share/make/winshlib.mk files to trace why c:/Rtools/mingw_64/bin/g++ is missing. Reproduce the inline::cxxfunction example and confirm that it completes and fx(2L, 5) returns 10.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.