Looks like it’s missing a forward slash between rtools40
and mingw
, did you edit it manually or use the code above? If you did it manually, you just need to re-open the file and add that forward slash.
Otherwise, if you run:
file.edit("~/.Rprofile")
It will open it in the RStudio source editor, and you can add the forward slash and save the file from there
ASaeed
November 10, 2020, 4:59am
22
Yes I was missing a flash forward. I will try to reinstall rstan as you told me before now and see if this change helped.
ASaeed
November 10, 2020, 6:07am
23
No luck again with installing rstan :( I tried using remotes, from source, and from zip file and they all failed.
Here is the error I got.
C:/Users/R-3.4.3/rtools40/mingw32/bin/ar -rs …/inst/lib//i386/libStanServices.a stan_fit.o stan_fit_base.o
C:\UsersR-3.4.3\rtools40\mingw32\bin\ar.exe: creating …/inst/lib//i386/libStanServices.a
no DLL was created
ERROR: compilation failed for package ‘rstan’
removing ‘C:/Users/R/R-4.0.3/library/rstan’
Warning in install.packages :
installation of package ‘C:/Users/AppData/Local/Temp/Rtmp2rIAAt/downloaded_packages/rstan_2.21.2.tar.gz’ had non-zero exit status
Let’s double-check that your compiler is all configured correctly now. What output do you get from the following:
install.packages("jsonlite",type="source")
ASaeed
November 10, 2020, 6:26am
25
Same error.
ERROR: compilation failed for package ‘jsonlite’
removing ‘\server/userhome/students4/My Documents/R/win-library/4.0/jsonlite’
restoring previous ‘\server/userhome/students4/My Documents/R/win-library/4.0/jsonlite’
Warning in install.packages :
installation of package ‘jsonlite’ had non-zero exit status
There should be more error messages there, can you copy the full output?
ASaeed
November 10, 2020, 6:31am
27
Here you go. Sorry I didn’t think you need to see the whole thing.
installing source package ‘jsonlite’ …
** package ‘jsonlite’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c base64.c -o base64.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c collapse_array.c -o collapse_array.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c collapse_object.c -o collapse_object.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c collapse_pretty.c -o collapse_pretty.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c escape_chars.c -o escape_chars.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c integer64_to_na.c -o integer64_to_na.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c is_datelist.c -o is_datelist.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c is_recordlist.c -o is_recordlist.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c is_scalarlist.c -o is_scalarlist.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c modp_numtoa.c -o modp_numtoa.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c null_to_na.c -o null_to_na.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c num_to_char.c -o num_to_char.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c parse.c -o parse.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c prettify.c -o prettify.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c push_parser.c -o push_parser.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c r-base64.c -o r-base64.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c register.c -o register.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c row_collapse.c -o row_collapse.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c transpose_list.c -o transpose_list.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c validate.c -o validate.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl.c -o yajl/yajl.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_alloc.c -o yajl/yajl_alloc.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_buf.c -o yajl/yajl_buf.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_encode.c -o yajl/yajl_encode.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_gen.c -o yajl/yajl_gen.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_lex.c -o yajl/yajl_lex.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_parser.c -o yajl/yajl_parser.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -I"C:/Users//R/R-40~1.3/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c yajl/yajl_tree.c -o yajl/yajl_tree.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/ar rcs yajl/libstatyajl.a yajl/yajl.o yajl/yajl_alloc.o yajl/yajl_buf.o yajl/yajl_encode.o yajl/yajl_gen.o yajl/yajl_lex.o yajl/yajl_parser.o yajl/yajl_tree.o
C:/Users//R-3.4.3/rtools40/mingw32/bin/gcc -shared -s -static-libgcc -o jsonlite.dll tmp.def base64.o collapse_array.o collapse_object.o collapse_pretty.o escape_chars.o integer64_to_na.o is_datelist.o is_recordlist.o is_scalarlist.o modp_numtoa.o null_to_na.o num_to_char.o parse.o prettify.o push_parser.o r-base64.o register.o row_collapse.o transpose_list.o validate.o -Lyajl -lstatyajl \server/userhome/students4//My Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a -L\server/userhome/students4//My Documents/R/win-library/4.0/StanHeaders/libs/x64 -lStanHeaders -L\server/userhome/students4//My Documents/R/win-library/4.0/RcppParallel/lib/x64 -ltbb -LC:/Users//R/R-40~1.3/bin/i386 -lR
gcc.exe: error: \server/userhome/students4//My Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a: No such file or directory
no DLL was created
ERROR: compilation failed for package ‘jsonlite’
removing ‘\server/userhome/students4//My Documents/R/win-library/4.0/jsonlite’
restoring previous ‘\server/userhome/students4//My Documents/R/win-library/4.0/jsonlite’
Warning in install.packages :
installation of package ‘jsonlite’ had non-zero exit status
Extremely odd, it looks like everything is compiling fine but then it’s trying to use a bunch of arguments from RStan. Can you close and restart R/RStudio and try the install again?
ASaeed
November 10, 2020, 6:39am
29
Cool. Just did that and jsonlite got installed fine. Now I will try to install rstan again from source.
1 Like
ASaeed
November 10, 2020, 6:58am
30
Same old error. Which is a bummer :(. The installation message is huge 117 word pages, do you still want me to post it here?
ERROR: compilation failed for package ‘rstan’
removing ‘\server/userhome/students4/My Documents/R/win-library/4.0/rstan’
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
ASaeed
November 10, 2020, 6:59am
31
The error is from the last bit of the message.
I just need the text directly above the ERROR: section that you posted, like the last page or so.
Also, it will greatly cut down on the amount of output if you add -Wno-deprecated-declarations -Wno-ignored-attributes
to your Makevars.win file.
Just run file.edit("~/.R/Makevars.win")
and copy those two statements to the end of the CXX14FLAGS line
ASaeed
November 10, 2020, 7:15am
34
Just did it and rerun the installation and here is what I got.
Installing package into ‘\server/userhome/students4//My Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL ‘http://cran.rstudio.com/src/contrib/rstan_2.21.2.tar.gz ’
Content type ‘application/x-gzip’ length 1152008 bytes (1.1 MB)
downloaded 1.1 MB
installing source package ‘rstan’ …
** package ‘rstan’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
//server/userhome/students4/My Documents/.R/Makevars.win:2: *** missing separator. Stop.
ERROR: compilation failed for package ‘rstan’
removing ‘\server/userhome/students4/My Documents/R/win-library/4.0/rstan’
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\AppData\Local\Temp\Rtmp0y79dj\downloaded_packages’
That indicates an issue with the Makevars file (that I’m assuming you just edited?), can you double-check that it looks like:
CXX14FLAGS += -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-deprecated-declarations -Wno-ignored-attributes
ASaeed
November 10, 2020, 9:22am
36
This is how it looks like, all in one line
Ah that’s it, there should be a space between -msse4.2
and -Wno-deprecated-declarations
ASaeed
November 10, 2020, 9:26am
38
I just removed the space and am rerunning the install now.
ASaeed
November 10, 2020, 9:42am
39
I got the same error as before ,so I am restarting R and reinstalling rstan from source.
Its expected that you’ll get the same error, but now there will be much less output so that I can see what the error is