English 中文(简体)
全面数据。 R:zlib.h没有这种档案或名录
原标题:Install data.table library in R: zlib.h no such file or directory

I want to install the data.table library in R, but I have problems. When I type

安装。

it tells me that I have to compile the library from source. If I say yes, my C compiler starts running until the error message comes that <zlib.h> was not found.

因此,我还试图安装Szlib.h图书馆(使用MSYS2),但似乎没有任何用途。

我的完全产出如下:

imelf@DESKTOP-CFHKUQA MINGW32 /d/Informatik/NachhilfeInfoUni/SteuberHenry/DataAnalysis
$ pacman -S mingw-w64-i686-zlib
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-i686-zlib-1.3.1-1

Total Download Size:   0.10 MiB
Total Installed Size:  0.40 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages...
 mingw-w64-i686-zlib-1.3.1-...   103.3 KiB   294 KiB/s 00:00 [###############################] 100%
(1/1) checking keys in keyring                               [###############################] 100%
(1/1) checking package integrity                             [###############################] 100%
(1/1) loading package files                                  [###############################] 100%
(1/1) checking for file conflicts                            [###############################] 100%
(1/1) checking available disk space                          [###############################] 100% 
:: Processing package changes...
(1/1) upgrading mingw-w64-i686-zlib                          [###############################] 100%

imelf@DESKTOP-CFHKUQA MINGW32 /d/Informatik/NachhilfeInfoUni/SteuberHenry/DataAnalysis
$ r

R version 4.2.0 (2022-04-22 ucrt) -- "Vigorous Calisthenics"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type  license()  or  licence()  for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type  contributors()  for more information and
 citation()  on how to cite R or R packages in publications.

Type  demo()  for some demos,  help()  for on-line help, or
 help.start()  for an HTML browser interface to help.
Type  q()  to quit R.

> 安装。;
Installing package into  C:/Users/imelf/AppData/Local/R/win-library/4.2 
(as  lib  is unspecified)
--- Please select a CRAN mirror for use in this session ---

  There is a binary version available but the source version is later:
           binary source needs_compilation
data.table 1.15.2 1.15.4              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel)$           
$$
installing the source package  data.table 

trying URL  https://ftp.gwdg.de/pub/misc/cran/src/contrib/data.table_1.15.4.tar.gz 
Content type  application/octet-stream  length 5387593 bytes (5.1 MB)
downloaded 5.1 MB

* installing *source* package  data.table  ...
** package  data.table  successfully unpacked and MD5 sums checked
** using staged installation

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c assign.c -o assign.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c between.c -o between.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c bmerge.c -o bmerge.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c chmatch.c -o chmatch.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c cj.c -o cj.o      
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c coalesce.c -o coalesce.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c dogroups.c -o dogroups.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fastmean.c -o fastmean.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fcast.c -o fcast.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fifelse.c -o fifelse.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fmelt.c -o fmelt.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c forder.c -o forder.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c frank.c -o frank.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fread.c -o fread.o
In file included from fread.c:21:
fread.c: In function ‘freadMain’:
fread.c:1291:21: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1291 |       if (isspace(ch[0]) || isspace(ch[nchar-1]))
      |                   ~~^~~
fread.c:1291:39: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1291 |       if (isspace(ch[0]) || isspace(ch[nchar-1]))
      |                                     ~~^~~~~~~~~
fread.c:1487:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1487 |       while (++ch<eof && isspace(*ch)) {};
      |                                  ^~~
fread.c:1570:29: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1570 |   while (ch<eof && (isspace(*ch) || *ch==  )) {   // isspace matches    , 	, 
 and 
;   before eof should be skipped too
      |                             ^~~
fread.c:2588:30: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 2588 |     while (ch<eof && isspace(*ch)) ch++;
      |                              ^~~
fread.c:2595:32: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 2595 |       while (ch<eof && isspace(*ch)) ch++;
      |                                ^~~
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c freadR.c -o freadR.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c froll.c -o froll.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c frollR.c -o frollR.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c frolladaptive.c -o frolladaptive.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fsort.c -o fsort.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c fwrite.c -o fwrite.o
fwrite.c:11:10: fatal error: zlib.h: No such file or directory
   11 | #include <zlib.h>      // for compression to .gz
      |          ^~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-42~1.0/etc/x64/Makeconf:252: fwrite.o] Error 1
ERROR: compilation failed for package  data.table 
* removing  C:/Users/imelf/AppData/Local/R/win-library/4.2/data.table 

The downloaded source packages are in
         C:UsersimelfAppDataLocalTempRtmpmWL9psdownloaded_packages 
Warning message:
In 安装。 :
  installation of package  data.table  had non-zero exit status
>

谁能帮助这里?

问题回答

图书馆的新版本(第1.15.4版也可在Windows 上的R 4.2上查阅),随后,指令install. Packages(“data.table”刚刚开课。

然后,我可以汇编和管理以下实例方案:

library("data.table");

DT = data.table(x = rep(c("a","b","c"), each = 3), y = c(1, 3, 6), v = 1:9);

print(DT);




相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签