Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(can't install package) ERROR: compilation failed for package 'fim4r' #77

Closed
mytarmail opened this issue Apr 28, 2023 · 8 comments
Closed

Comments

@mytarmail
Copy link

Can anyone help me with package installation

library(arules)
arules::fim4r()


..
...
....
.......
-DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -DISTA_ABORT ista/src/ista.c -o ista.o
gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -DISR_CLOMAX -DACC_ABORT \
              accretion/src/accretion.c -o accretion.o
gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -DFPG_ABORT fpgrowth/src/fpgpsp.c -o fpgpsp.o
gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -ID:/Program Files/R/R-43~1.0/include fim4r.c -o fim4r.o
fim4r.c:22:10: fatal error: R.h: No such file or directory
   22 | #include "R.h"
      |          ^~~~~
compilation terminated.
make: *** [Makefile.win:314: fim4r.o] Error 1
ERROR: compilation failed for package 'fim4r'
* removing 'D:/Program Files/R/R-4.3.0/library/fim4r'
Available methods in fim4r are: ‘apriori’, ‘eclat’, ‘fpgrowth’, ‘carpenter’, ‘ista’, ‘relim’, ‘sam’Warning message:
In utils::install.packages(fim4r_url, repos = NULL) :
  installation of package ‘C:/Users/TARAS/AppData/Local/Temp/Rtmpuqdg3g/downloaded_packages/fim4r_latest.tar.gz’ had non-zero exit status

my session, Rtools43 installed


sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default


time zone: Asia/Damascus
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] arules_1.7-6 Matrix_1.5-4

loaded via a namespace (and not attached):
[1] compiler_4.3.0  generics_0.1.3  tools_4.3.0     rstudioapi_0.14 grid_4.3.0      lattice_0.21-8 
> 
@mhahsler
Copy link
Owner

Hi, this sounds like a Windows-specific configuration issue with R. Please try to remove and reinstall the latest version of R and Rtools.

@mytarmail
Copy link
Author

Hi, this sounds like a Windows-specific configuration issue with R. Please try to remove and reinstall the latest version of R and Rtools.

Hi!
Thank you for your quick response.
I did everything as you said, but the result is the same

@mhahsler
Copy link
Owner

I just installed R 4.3.0, RStudio, and RTools4.3 on a Windows machine, and it works for me fine. You may have some configuration file that messed up the compiler...

> library(arules)
> arules::fim4r()
Package fim4r is required.
Download and install the package?
1: Yes
2: No

Selection: 1
Installing package into ‘C:/Users/Michael Hahsler/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://mhahsler.github.io/arules/docs/fim4r/fim4r_latest.tar.gz'
Content type 'application/gzip' length 804083 bytes (785 KB)
downloaded 785 KB

* installing *source* package 'fim4r' ...
** using staged installation
** libs
  running 'src/Makefile.win' ...
gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src util/src/arrays.c -o arrays.o
....
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (fim4r)
Available methods in fim4r are: ‘apriori’, ‘eclat’, ‘fpgrowth’, ‘carpenter’, ‘ista’, ‘relim’, ‘sam’

@mytarmail
Copy link
Author

mytarmail commented Apr 28, 2023

I completely reinstalled Windows7 with disk formatting))) but the problem remained the same, moreover, it seems to me that I can not install any package in binary form.
I don't understand what the problem is, but the problem seems to be on my end.

@mhahsler
Copy link
Owner

Maybe it is Windows 7? I have tried it on Windows 10.

@mytarmail
Copy link
Author

Just installed clean windows 10, also R tools and R, nothing else..
getting exactly the same problem.

gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -DISR_CLOMAX -DACC_ABORT \
              accretion/src/accretion.c -o accretion.o
gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -DFPG_ABORT fpgrowth/src/fpgpsp.c -o fpgpsp.o
gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -IF:/Program Files/R-4.3.0/include fim4r.c -o fim4r.o
fim4r.c:22:10: fatal error: R.h: No such file or directory
   22 | #include "R.h"
      |          ^~~~~
compilation terminated.
make: *** [Makefile.win:314: fim4r.o] Error 1
ERROR: compilation failed for package 'fim4r'
* removing 'F:/Program Files/R-4.3.0/library/fim4r'
Available methods in fim4r are: ‘apriori’, ‘eclat’, ‘fpgrowth’, ‘carpenter’, ‘ista’, ‘relim’, ‘sam’Warning message:
In utils::install.packages(fim4r_url, repos = NULL) :
  installation of package ‘C:/Users/tars/AppData/Local/Temp/RtmpOcnFKT/downloaded_packages/fim4r_latest.tar.gz’ had non-zero exit status
 sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=Russian_Russia.utf8  LC_CTYPE=Russian_Russia.utf8    LC_MONETARY=Russian_Russia.utf8
[4] LC_NUMERIC=C                    LC_TIME=Russian_Russia.utf8    


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.0 Matrix_1.5-4   generics_0.1.3 tools_4.3.0    arules_1.7-6   grid_4.3.0    
[7] lattice_0.21-8

Maybe I need to install something for Windows, some kind of library or something else ???

@mhahsler
Copy link
Owner

I think this is a Windows problem with where your R installation is (F: instead of C:)...

Your output right before the error says:

gcc -std=c99 -Wall -Wextra -Wconversion -Wno-unused-parameter -D__USE_MINGW_ANSI_STDIO=1 -pedantic -c  -DNDEBUG -DQUIET -O3 -funroll-loops -Iutil/src -Imath/src  -Itract/src -Iapriori/src -Ieclat/src -Ifpgrowth/src -Isam/src  -Irelim/src -Icarpenter/src -Iista/src -Iaccretion/src -IF:/Program Files/R-4.3.0/include fim4r.c -o fim4r.o

R-4.3.0/include contains R.h, but it specifies the include -IF:/Program Files/R-4.3.0/include. I guess that is the F: drive? I think gcc does not understand this including the space.

On my Windows installation with R on C:, it uses -IC:/PROGRA~1/R/R-43~1.0/include which is the correct translation without spaces. Maybe this is a bug in R and it only fixes paths on C:?

Sorry about this. I do not use Windows so I am not sure why this happens...

@mytarmail
Copy link
Author

Problem solved.
R must be MANDATORY installed on the C drive, then the installation of the package is fine.
Thank you very much for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants