SebKrantz / collapse

Advanced and Fast Data Transformation in R
https://sebkrantz.github.io/collapse/
Other
643 stars 33 forks source link

Linux Mint make error (conflicting types) #613

Closed mkw-TL closed 2 weeks ago

mkw-TL commented 1 month ago

Hey! Thanks for a great package. I know this is an issue on my end, rather than a package issue. That being said, if you did have any pointers, I'd be glad to hear them! (gcc version 13.1.0 and OMP version (if it matters) is 4.5)

** using staged installation
** libs
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'   -fopenmp -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ExportSymbols.c -o ExportSymbols.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG  -I'/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'   -fopenmp -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'   -fopenmp -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c TRA.c -o TRA.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'   -fopenmp -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c base_radixsort.c -o base_radixsort.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'   -fopenmp -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c data.table_init.c -o data.table_init.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'   -fopenmp -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c data.table_rbindlist.c -o data.table_rbindlist.o
In file included from data.table.h:7,
                 from data.table_rbindlist.c:6:
base_radixsort.h:35:8: error: redefinition of ‘struct sxpinfo_struct’
   35 | struct sxpinfo_struct {
      |        ^~~~~~~~~~~~~~
In file included from base_radixsort.h:4:
/usr/share/R/include/Rinternals.h:214:8: note: originally defined here
  214 | struct sxpinfo_struct {
      |        ^~~~~~~~~~~~~~
base_radixsort.h:60:8: error: redefinition of ‘struct vecsxp_struct’
   60 | struct vecsxp_struct {
      |        ^~~~~~~~~~~~~
/usr/share/R/include/Rinternals.h:234:8: note: originally defined here
  234 | struct vecsxp_struct {
      |        ^~~~~~~~~~~~~
base_radixsort.h:65:16: error: redefinition of ‘struct VECTOR_SEXPREC’
   65 | typedef struct VECTOR_SEXPREC {
      |                ^~~~~~~~~~~~~~
/usr/share/R/include/Rinternals.h:305:16: note: originally defined here
  305 | typedef struct VECTOR_SEXPREC {
      |                ^~~~~~~~~~~~~~
base_radixsort.h:68:3: error: conflicting types for ‘VECTOR_SEXPREC’; have ‘struct VECTOR_SEXPREC’
   68 | } VECTOR_SEXPREC, *VECSEXP;
      |   ^~~~~~~~~~~~~~
/usr/share/R/include/Rinternals.h:308:3: note: previous declaration of ‘VECTOR_SEXPREC’ with type ‘VECTOR_SEXPREC’
  308 | } VECTOR_SEXPREC, *VECSEXP;
      |   ^~~~~~~~~~~~~~
base_radixsort.h:68:20: error: conflicting types for ‘VECSEXP’; have ‘struct VECTOR_SEXPREC *’
   68 | } VECTOR_SEXPREC, *VECSEXP;
      |                    ^~~~~~~
/usr/share/R/include/Rinternals.h:308:20: note: previous declaration of ‘VECSEXP’ with type ‘VECSEXP’ {aka ‘struct VECTOR_SEXPREC *’}
  308 | } VECTOR_SEXPREC, *VECSEXP;
      |                    ^~~~~~~
make: *** [/usr/lib/R/etc/Makeconf:168: data.table_rbindlist.o] Error 1
ERROR: compilation failed for package ‘collapse’
* removing ‘/home/joeh/R/x86_64-pc-linux-gnu-library/4.1/collapse’
SebKrantz commented 1 month ago

Hi, thanks. Can you try installing from r-universe or Github and tell me whether you get the same issue?

SebKrantz commented 1 month ago

Should solve your problem. I got notice from somebody else that the changes I pushed solved the issue. Perhaps please confirm. I'll leave the issue open as a reference for others with this problem until a new version makes it to CRAN.

ben-schwen commented 1 month ago

I experience the same error for installing under WSL (tried installing from CRAN / r-universe and GitHub)

sessionInfo()
#> R version 4.1.2 (2021-11-01)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 22.04.3 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
#> 
#> locale:
#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] processx_3.8.4 compiler_4.1.2 R6_2.5.1       cli_3.6.2      tools_4.1.2   
#>  [6] curl_5.2.1     remotes_2.5.0  desc_1.4.3     callr_3.7.6    ps_1.7.6      
#> [11] pkgbuild_1.4.4
SebKrantz commented 1 month ago

@ben-schwen thanks! Can you try again from GitHub. The issue is that on some systems an internal R header (Defn.h) is visible to the compiler.

ben-schwen commented 1 month ago

@ben-schwen thanks! Can you try again from GitHub. The issue is that on some systems an internal R header (Defn.h) is visible to the compiler.

Current master works fine now. Ty!

tyner commented 3 weeks ago

When is the next release to CRAN expected?

SebKrantz commented 3 weeks ago

In about one week.