Can't install Rstan 2.3

872 views
Skip to first unread message

Emmanuel Charpentier

unread,
Jul 4, 2014, 1:44:57 PM7/4/14
to stan-...@googlegroups.com
Dear list,

Trying to follow the procedure written out at the RStan Getting Started page, I find myself (today July 4th, 2014) unable to proceed : in fact, the "http://mc-stan.org/rstan/install.R" address redirects back to the Stan Project Home page.

Ouch !

It is probably a glitch (I have already installed rstan on other machines using the same procedure) ; is that a (curious) way for the Stan gang to enforce US national holiday ?

Heads, up, someone ?

--
Emmanuel Charpentier

Bob Carpenter

unread,
Jul 4, 2014, 2:11:30 PM7/4/14
to stan-...@googlegroups.com
We uploaded a new version of the site and it probably
tanked the old version of the site. But hey, at least
you can buy a Stan t-shirt now.

I have no idea where that install.R script came from.
If someone tells me where it's at, I can put it back
up on the mc-stan.org site.

- Bob

P.S. I'm so American I'm working on a holiday!
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bob Carpenter

unread,
Jul 4, 2014, 2:16:57 PM7/4/14
to stan-...@googlegroups.com
I found it and uploaded a new version and everyone
should be able to see it again.

Sorry for the glitch.

- Bob

P.S. GitHub rocks --- great search through their web
interface.


On Jul 4, 2014, at 1:44 PM, Emmanuel Charpentier <emanuel.c...@gmail.com> wrote:

Song Qian

unread,
Jul 4, 2014, 4:00:12 PM7/4/14
to stan-...@googlegroups.com
I tried the new version just now. Installation went smoothly, but when trying the school example:

> print(fit)
Error in .Call("effective_sample_size", sim, n - 1) :
"effective_sample_size" not resolved from current namespace (rstan)

Ben Goodrich

unread,
Jul 4, 2014, 4:57:15 PM7/4/14
to stan-...@googlegroups.com
Restart R


On Friday, July 4, 2014 4:00:12 PM UTC-4, Song wrote:
I tried the new version just now.  Installation went smoothly, but when trying the school example:

> print(fit)
Error in .Call("effective_sample_size", sim, n - 1) :
  "effective_sample_size" not resolved from current namespace (rstan)

On Jul 4, 2014, at 2:16 PM, Bob Carpenter <ca...@alias-i.com> wrote:

> I found it and uploaded a new version and everyone
> should be able to see it again.
>
> Sorry for the glitch.
>
> - Bob
>
> P.S.  GitHub rocks --- great search through their web
> interface.
>
>
> On Jul 4, 2014, at 1:44 PM, Emmanuel Charpentier <emanuel.c...@gmail.com> wrote:
>
>> Dear list,
>>
>> Trying to follow the procedure written out at the RStan Getting Started page, I find myself (today July 4th, 2014) unable to proceed : in fact, the "http://mc-stan.org/rstan/install.R" address redirects back to the Stan Project Home page.
>>
>> Ouch !
>>
>> It is probably a glitch (I have already installed rstan on other machines using the same procedure) ; is that a (curious) way for the Stan gang to enforce US national holiday ?
>>
>> Heads, up, someone ?
>>
>> --
>> Emmanuel Charpentier
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

Bill Harris

unread,
Jul 11, 2014, 12:20:06 PM7/11/14
to stan-...@googlegroups.com
This is probably different, but the subject fits.  I installed 2.3.0 on Linux with no problems (I do like the new install script), but I wasn't so fortunate on W7.

The place where I use Windows upgraded from XP to W7 in the spring.  I installed R 3.0.3 in c:/Program Files/ easily, but I never could get Rcpp to work (I didn't try hard).  Figuring it was a "spaces in the path" problem, I installed R 3.1.1 today in c:/R/R.3.1.1/ and copied over all the packages as described in the R FAQ for Windows.

Then I tried the scripts to install rstan using RStudio, and I get errors.  When I rerun with debug, I get

> install.packages(c("inline", "Rcpp"), type = "source")
trying URL 'http://cran.rstudio.com/src/contrib/inline_0.3.13.tar.gz'
Content type 'application/x-gzip' length 14224 bytes (13 Kb)
opened URL
downloaded 13 Kb

trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.2.tar.gz'
Content type 'application/x-gzip' length 2004313 bytes (1.9 Mb)
opened URL
downloaded 1.9 Mb

* installing *source* package 'inline' ...
** package 'inline' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (inline)
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/R/R-31~1.1/etc/i386/Makeconf" -f "C:/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" OBJECTS="Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o"' had status 309
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/R/R-3.1.1/library/Rcpp'
* restoring previous 'C:/R/R-3.1.1/library/Rcpp'
Warning in install.packages :
  running command '"C:/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\R\R-3.1.1\library" C:\Users\adminbsh\AppData\Local\Temp\RtmpmYE5li/downloaded_packages/Rcpp_0.11.2.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\adminbsh\AppData\Local\Temp\RtmpmYE5li\downloaded_packages’


For what it's worth, my Path is set to

c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;C:\Program Files (x86)\Common Files\Pervasive Software Shared\pvswcore;C:\PVSW\bin;C:\Oracle\product\11.2.0\client64\bin;C:\Oracle\product\11.2.0\client32\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\eDNA\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Bazaar;C:\Program Files\ggobi

Do you see anything obvious to pursue?

Thanks,

Bill

Ben Goodrich

unread,
Jul 11, 2014, 1:09:08 PM7/11/14
to stan-...@googlegroups.com, bill_...@facilitatedsystems.com
On Friday, July 11, 2014 12:20:06 PM UTC-4, Bill Harris wrote:
For what it's worth, my Path is set to

c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;C:\Program Files (x86)\Common Files\Pervasive Software Shared\pvswcore;C:\PVSW\bin;C:\Oracle\product\11.2.0\client64\bin;C:\Oracle\product\11.2.0\client32\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\eDNA\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Bazaar;C:\Program Files\ggobi

Do you see anything obvious to pursue?

I just tweaked the script. Try calling it with

install_rstan(multiarch = TRUE)

Ben


Bill Harris

unread,
Jul 11, 2014, 1:48:58 PM7/11/14
to stan-...@googlegroups.com
Thanks for trying, but that didn't work either.  Here's the trace without running with debug:

>
Sys.setenv(MAKEFLAGS = "-j4") > source('http://mc-stan.org/rstan/install.R', echo = TRUE, max.deparse.length = 2000) > install_rstan <- function(multiarch = FALSE) { + on.exit(Sys.unsetenv("R_MAKEVARS_USER")) + on.exit(Sys.unsetenv("R_MAKEVARS_SITE"), add = TRUE) + + try(remove.packages("rstan"), silent = TRUE) + Sys.setenv(R_MAKEVARS_USER = "foobar") + Sys.setenv(R_MAKEVARS_SITE = "foobar") + if(multiarch) install.packages(c("inline", "Rcpp"), type = "source", INSTALL_opts = '--merge-multiarch') + else install.packages(c("inline", "Rcpp"), type = "source") + library(inline) + library(Rcpp) + src <- ' + std::vector<std::string> s; + s.push_back("hello"); + s.push_back("world"); + return Rcpp::wrap(s); + ' + hellofun <- cxxfunction(body = src, includes = '', plugin = 'Rcpp', verbose = FALSE) + test <- try(hellofun()) + if(inherits(test, "try-error")) stop("hello world failed; ask for help on Rcpp list") + + options(repos = c(getOption("repos"), + rstan = "http://rstan.org/repo/")) + if(multiarch) install.packages("rstan", type = 'source', INSTALL_opts = '--merge-multiarch') + else install.packages("rstan", type = 'source') + library(rstan) + set_cppo("fast") + if (any(grepl("^darwin", R.version$os, ignore.case = TRUE))) { + cat('\nCC=clang', 'CXX=clang++ -arch x86_64 -ftemplate-depth-256', + file = "~/.R/Makevars", sep = "\n", append = TRUE) + } + return(invisible(NULL)) + } > install_rstan(multiarch = TRUE) Removing package from ‘C:/R/R-3.1.1/library’ (as ‘lib’ is unspecified) Error in remove.packages : there is no package called ‘rstan’
trying URL 'http://cran.rstudio.com/src/contrib/inline_0.3.13.tar.gz'
Content type 'application/x-gzip' length 14224 bytes (13 Kb)
opened URL
downloaded 13 Kb

trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.2.tar.gz'
Content type 'application/x-gzip' length 2004313 bytes (1.9 Mb)
opened URL
downloaded 1.9 Mb


install for i386

* installing *source* package 'inline' ...
** package 'inline' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded

install for x64

* installing *source* package 'inline' ...
** package 'inline' successfully unpacked and MD5 sums checked
** testing if installed package can be loaded
* DONE (inline)

install for i386

* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs
Warning: running command 'make -f "Makevars.win" -f "C:/R/R-31~1.1/etc/i386/Makeconf" -f "C:/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" OBJECTS="Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o"' had status 309
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/R/R-3.1.1/library/Rcpp'
* restoring previous 'C:/R/R-3.1.1/library/Rcpp'
Warning: running command 'C:/R/R-31~1.1/bin/i386/Rcmd.exe INSTALL -l C:\R\R-3.1.1\library C:\Users\adminbsh\AppData\Local\Temp\RtmpmYE5li/downloaded_packages/Rcpp_0.11.2.tar.gz --no-multiarch' had status 1
Warning in install.packages :
  running command '"C:/R/R-31~1.1/bin/x64/R" CMD INSTALL --merge-multiarch -l "C:\R\R-3.1.1\library" C:\Users\adminbsh\AppData\Local\Temp\RtmpmYE5li/downloaded_packages/Rcpp_0.11.2.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\adminbsh\AppData\Local\Temp\RtmpmYE5li\downloaded_packages’

Attaching package: ‘Rcpp’

The following object is masked from ‘package:inline’:

    registerPlugin

Warning message:
running command 'make -f "C:/R/R-31~1.1/etc/x64/Makeconf" -f "C:/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="filee8866097f39.dll" WIN=64 TCLBIN=64 OBJECTS="filee8866097f39.o"' had status 309 

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

Program source:
  1: 
  2: // includes from the plugin
  3: 
  4: #include <Rcpp.h>
  5: 
  6: 
  7: #ifndef BEGIN_RCPP
  8: #define BEGIN_RCPP
  9: #endif
 10: 
 11: #ifndef END_RCPP
 12: #define END_RCPP
 13: #endif
 14: 
 15: using namespace Rcpp;
 16: 
 17: 
 18: // user includes
 19: 
 20: 
 21: // declarations
 22: extern "C" {
 23: SEXP filee8866097f39( ) ;
 24: }
 25: 
 26: // definition
 27: 
 28: SEXP filee8866097f39(  ){
 29: BEGIN_RCPP
 30:  
 31:     std::vector<std::string> s; 
 32:     s.push_back("hello");
 33:     s.push_back("world");
 34:     return Rcpp::wrap(s);
 35:   
 36: END_RCPP
 37: }
 38: 
 39: 
Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Warning message: running command 'make -f "C:/R/R-31~1.1/etc/x64/Makeconf" -f "C:/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="filee8866097f39.dll" WIN=64 TCLBIN=64 OBJECTS="filee8866097f39.o"' had status 309
In addition: Warning message: running command 'C:/R/R-31~1.1/bin/x64/R CMD SHLIB filee8866097f39.cpp 2> filee8866097f39.cpp.err.txt' had status 1

> library(rstan)
Error in library(rstan) : there is no package called ‘rstan’

Is it a problem with Rcpp (status 309)?  My expertise with Rcpp is limited to having installed rstan a few times on Windows and Linux, but I never did anything that required me to interact directly with it.  On the Rtools page (https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows), I see two checks, and they seem to work:


> Sys.getenv("PATH")
[1] "C:\\R\\R-3.1.1\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\gcc-4.6.3\\bin;C:\\Program Files (x86)\\Common Files\\Pervasive Software Shared\\pvswcore;C:\\PVSW\\bin;C:\\Oracle\\product\\11.2.0\\client64\\bin;C:\\Oracle\\product\\11.2.0\\client32\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\eDNA\\;C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;C:\\Program Files (x86)\\QuickTime\\QTSystem\\;C:\\Program Files (x86)\\Bazaar;C:\\Program Files\\ggobi"
> system('g++ -v')
Using built-in specs.
COLLECT_GCC=c:\Rtools\GCC-46~1.3\bin\G__~1.EXE
COLLECT_LTO_WRAPPER=c:/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-mingw32/4.6.3/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS=
Thread model: win32
gcc version 4.6.3 20111208 (prerelease) (GCC)

Any more ideas?

Bill



--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Ben Goodrich

unread,
Jul 11, 2014, 2:34:22 PM7/11/14
to stan-...@googlegroups.com, bill_...@facilitatedsystems.com
On Friday, July 11, 2014 1:48:58 PM UTC-4, Bill Harris wrote:
Thanks for trying, but that didn't work either.  Here's the trace without running with debug:

Do you also have CYGWIN installed? Here is the only thing I could google that was similar

https://github.com/hadley/pryr/issues/22

If you can install Rcpp on your own (outside of install_rstan()), then I would consider it to be our bug. Otherwise, I think you would be better served asking on the Rcpp list.

Ben

Bill Harris

unread,
Jul 11, 2014, 5:41:20 PM7/11/14
to stan-...@googlegroups.com
Ben, that's fair.  To get rid of what rstan did, I ran install.packages(Rcpp), which claimed to work, and then system('g++ -v') worked, as before, but system('make -v')  and system('ls') continue to fail. I'd wonder about permissions and the difference between Rtools and cygwin, but I'm running right now with an admin account, and the permissions look the same between g++ and make.

When I get some time, I'll have to dive into how R connects to the OS.  It sounds more like a problem with system() than with Rtools right now.

Bill


Bill Harris

unread,
Jul 11, 2014, 5:42:02 PM7/11/14
to stan-...@googlegroups.com
Incidentally, I am running CYGWIN and Rtools.  I saw that, but I don't yet see what I'm doing wrong.


Bob Carpenter

unread,
Jul 11, 2014, 5:44:24 PM7/11/14
to stan-...@googlegroups.com
The usual solution is to make sure that Rtools is on your
PATH before Cygwin so that R picks up the right compiler.

If that's not in the install doc for R, it should be!

- Bob

Bill Harris

unread,
Jul 11, 2014, 5:47:22 PM7/11/14
to stan-...@googlegroups.com
Bob,

You mean like

> Sys.getenv('PATH')
[1] "C:\\R\\R-3.1.1\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\gcc-4.6.3\\bin;C:\\cygwin64\\bin;C:\\Program Files (x86)\\Common Files\\Pervasive Software Shared\\pvswcore;C:\\PVSW\\bin;C:\\Oracle\\product\\11.2.0\\client64\\bin;C:\\Oracle\\product\\11.2.0\\client32\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\eDNA\\;C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;C:\\Program Files (x86)\\QuickTime\\QTSystem\\;C:\\Program Files (x86)\\Bazaar;C:\\Program Files\\ggobi"

and


> system('g++ -v')
Using built-in specs.
COLLECT_GCC=c:\Rtools\GCC-46~1.3\bin\G__~1.EXE
COLLECT_LTO_WRAPPER=c:/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-mingw32/4.6.3/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS=
Thread model: win32
gcc version 4.6.3 20111208 (prerelease) (GCC) 


?

Bill

Bob Carpenter

unread,
Jul 11, 2014, 7:27:49 PM7/11/14
to stan-...@googlegroups.com
Yes, that's how it should look, with Rtools\bin before cyginwin64\bin.

That's been the problem before with users with Cygwin installed
on Windows.

There are instructions for compiling RStan under Cygwin in the
CmdStan manual (those need to move to the RStan doc):

https://github.com/stan-dev/cmdstan/releases/download/v2.3.0/cmdstan-guide-2.3.0.pdf


These are for 64-bit R and 64-bit Cygwin
==================================================================

• Kill all Cygwin bash shells and shut down R.

• After installing R and Rtools, make sure that R and Rtools are in the PATH environment variable. My R installation directory was c:\Program Files\R\R-3.0.1 and my Rtools installation directory was c:\Rtools, so I added the following to the end of my user PATH variable:

• C:\Program Files\R\R-3.0.1\bin\x64
• C:\Rtools\bin
• C:\Rtools\gcc-4.6.3\bin

• Now there could be a conflict between Cygwin and Rtools when running a bash shell under Cygwin, so I added the following lines to my .bash_profile file to remove any PATH directory referencing Rtools:

> TMP=`echo $PATH | /usr/bin/tr ':' '\n' \
| /usr/bin/egrep -iv '^/cygdrive/c/Rtools/' \

| tr '\n' ':'`

> PATH=${TMP%:}

(Note that the backslash characters signal that the line continues after a return.) This was only necessary to allow me to continue using Cygwin.

• Apparently there is something in Rcpp or inline or rstan that doesn’t like UNC paths. My home directory was \\server\users\kevinv and apparently this caused my local R library directory to be \server\users\kevinv\R as verified by .libPaths() from the R command prompt.

I fixed this by copying the entire directory tree rooted at \server\users\kevinv\R over to a local directory on my worksta- tion, C:\Users\KevinV\R, then adding the user environment variable R_LIBS_USER=C:\Users\KevinV\R. I shut down R and restarted it.

• At this point the instructions given for installing Rstan finally worked.

==========================end outtake===============================

- Bob

Jiqiang Guo

unread,
Jul 12, 2014, 10:32:18 AM7/12/14
to stan-...@googlegroups.com
Bill, 

What do you mean by system('make -v') fails?  I think the problem is that you cannot R cannot use `gnu make` so it cannot install Rcpp from source because it will use make as installing rstan would need.  Besides, if make is found, one needs to make sure it is the one that is packaged in rtools.  For example, one would expect the following:

> system('where make')
c:\Rtools\bin\make.exe 



Jiqiang 


On Fri, Jul 11, 2014 at 7:27 PM, Bob Carpenter <ca...@alias-i.com> wrote:
Yes, that's how it should look, with Rtools\bin before cyginwin64\bin.

That's been the problem before with users with Cygwin installed
on Windows.

There are instructions for compiling RStan under Cygwin in the
CmdStan manual (those need to move to the RStan doc):

  https://github.com/stan-dev/cmdstan/releases/download/v2.3.0/cmdstan-guide-2.3.0.pdf


These are for 64-bit R and 64-bit Cygwin
==================================================================

        * Kill all Cygwin bash shells and shut down R.

        * After installing R and Rtools, make sure that R and Rtools are in the PATH environment variable. My R installation directory was c:\Program Files\R\R-3.0.1 and my Rtools installation directory was c:\Rtools, so I added the following to the end of my user PATH variable:

* C:\Program Files\R\R-3.0.1\bin\x64
* C:\Rtools\bin
* C:\Rtools\gcc-4.6.3\bin

        * Now there could be a conflict between Cygwin and Rtools when running a bash shell under Cygwin, so I added the following lines to my .bash_profile file to remove any PATH directory referencing Rtools:


     > TMP=`echo $PATH | /usr/bin/tr ':' '\n'                      \
                       | /usr/bin/egrep -iv '^/cygdrive/c/Rtools/' \

| tr '\n' ':'`

     > PATH=${TMP%:}

(Note that the backslash characters signal that the line continues after a return.) This was only necessary to allow me to continue using Cygwin.

        * Apparently there is something in Rcpp or inline or rstan that doesn't like UNC paths. My home directory was \\server\users\kevinv and apparently this caused my local R library directory to be \server\users\kevinv\R as verified by .libPaths() from the R command prompt.


I fixed this by copying the entire directory tree rooted at \server\users\kevinv\R over to a local directory on my worksta- tion, C:\Users\KevinV\R, then adding the user environment variable R_LIBS_USER=C:\Users\KevinV\R. I shut down R and restarted it.

        * At this point the instructions given for installing Rstan finally worked.
Reply all
Reply to author
Forward
0 new messages