I was trying to install renv packages. Here're my steps I did:
Install renv package
install.packages( "https://cran.r-project.org/src/contrib/Archive/renv/renv_0.12.5.tar.gz ", repos = NULL, type = "source" )
Initialize a local library
renv::init(bare=TRUE)
Install the correct packages
renv::restore()
In the #3 process, I faced an error message as below;
Installing Matrix [1.2-18] ...
FAILED
Error installing package 'Matrix':
installing to library 'C:/Users/gkim01/AppData/Local/Temp/RtmpqCrPev/renv-staging-4ef4325e15a3'
installing source package 'Matrix' ...
** package 'Matrix' successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"C:/Users/gkim01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -DNTIMER -I./SuiteSparse_config -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c CHMfactor.c -o CHMfactor.o
/bin/sh: line 1: gcc: command not found
make: *** [C:/Users/gkim01/AppData/Local/Programs/R/R-42~1.2/etc/x64/Makeconf:253: CHMfactor.o] Error 127
ERROR: compilation failed for package 'Matrix'
removing 'C:/Users/gkim01/AppData/Local/Temp/RtmpqCrPev/renv-staging-4ef4325e15a3/Matrix'
Error: install of package 'Matrix' failed
Actually, I had different error because I didn't install RTools. After RTools installed, I got this error on the same page of 'Matrix' installation. Please help me solve this!!
Thanks.
installing RTools should have provided you with gcc and the ability to call it.
I would maybe manually look for gcc in your Rtools folder; then check if its set in your paths
1 Like
Thank you so much!
I got a right version of RTools and installed the Matrix successfully.
However, I got another error as below. Do you have an idea why that happen?
Installing curl [4.3] ...
FAILED
Error installing package 'curl':
installing to library 'C:/Users/GKIM01/AppData/Local/Temp/RtmpEBTwXM/renv-staging-122fc32812c9a'
installing source package 'curl' ...
** package 'curl' successfully unpacked and MD5 sums checked
** using staged installation
** libs
rm -f curl.dll callbacks.o curl.o download.o escape.o fetch.o form.o getdate.o handle.o ieproxy.o init.o interrupt.o multi.o nslookup.o reflist.o split.o ssl.o typechecking.o utils.o version.o winidn.o writer.o libwinhttp.dll.a winhttp.def
"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/bin/x64/Rscript.exe" "../tools/winlibs.R" 7.64.1
echo '#include <curl/curl.h>' | gcc -E -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -std=gnu99 -xc - | grep "^[ \t]CURLOPT_. ," | sed s/,// > ../tools/option_table.txt
cp winhttp64.def.in winhttp.def
dlltool --as as -k --dllname winhttp.dll --input-def winhttp.def --output-lib libwinhttp.dll.a
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c callbacks.c -o callbacks.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c curl.c -o curl.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c download.c -o download.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c escape.c -o escape.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c fetch.c -o fetch.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c form.c -o form.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c getdate.c -o getdate.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c handle.c -o handle.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c ieproxy.c -o ieproxy.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c interrupt.c -o interrupt.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c multi.c -o multi.o
gcc -I"C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/include" -DNDEBUG -I../windows/libcurl-7.64.1/include -DCURL_STATICLIB -DSTRICT_R_HEADERS -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c nslookup.c -o nslookup.o
nslookup.c:17:13: error: conflicting types for 'inet_ntop'
17 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
| ^~~~~~~~~
In file included from nslookup.c:16:
c:\rtools42\x86_64-w64-mingw32.static.posix\include\ws2tcpip.h:401:35: note: previous declaration of 'inet_ntop' was here
401 | WINSOCK_API_LINKAGE LPCSTR WSAAPI InetNtopA(INT Family, LPCVOID pAddr, LPSTR pStringBuf, size_t StringBufSize);
| ^~~~~~~~~
make: *** [C:/Users/GKIM01/AppData/Local/Programs/R/R-42~1.2/etc/x64/Makeconf:253: nslookup.o] Error 1
ERROR: compilation failed for package 'curl'
removing 'C:/Users/GKIM01/AppData/Local/Temp/RtmpEBTwXM/renv-staging-122fc32812c9a/curl'
Error: install of package 'curl' failed
In addition: Warning message:
package ‘testthat’ was built under R version 4.2.3
Thanks!
system
Closed
May 12, 2023, 3:30pm
4
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.