Skip to content

Compilation error ("use of undeclared identifier") #40

@julianqz

Description

@julianqz

Hi there. I was trying to install presto and ran into the following problem.

> devtools::install_github("immunogenomics/presto")
Downloading GitHub repo immunogenomics/presto@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/5h/wjwzrklx5pvgg_n7qwc2f4rm0000gn/T/RtmpNQpHJV/remotes9f2b57aaf2b4/immunogenomics-presto-7636b3d/DESCRIPTION’ ...
─  preparing ‘presto’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘presto_1.0.0.tar.gz’
   
* installing *source* package ‘presto’ ...
** using staged installation
** libs
using C++ compiler: ‘Apple clang version 16.0.0 (clang-1600.0.26.6)’
using C++11
using SDK: ‘MacOSX15.2.sdk’
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:58:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo:126:
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:27:32: error: use of undeclared identifier 'u8'
   27 |     arma_static_check( (sizeof(u8) != 1), "error: type 'u8' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:28:32: error: use of undeclared identifier 's8'
   28 |     arma_static_check( (sizeof(s8) != 1), "error: type 's8' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:30:32: error: use of undeclared identifier 'u16'
   30 |     arma_static_check( (sizeof(u16) != 2), "error: type 'u16' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:31:32: error: use of undeclared identifier 's16'
   31 |     arma_static_check( (sizeof(s16) != 2), "error: type 's16' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:33:32: error: use of undeclared identifier 'u32'
   33 |     arma_static_check( (sizeof(u32) != 4), "error: type 'u32' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:34:32: error: use of undeclared identifier 's32'
   34 |     arma_static_check( (sizeof(s32) != 4), "error: type 's32' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:36:32: error: use of undeclared identifier 'u64'
   36 |     arma_static_check( (sizeof(u64) != 8), "error: type 'u64' has unsupported size" );
      |                                ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_elem_check.hpp:37:32: error: use of undeclared identifier 's64'
   37 |     arma_static_check( (sizeof(s64) != 8), "error: type 's64' has unsupported size" );
      |                                ^
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:58:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo:127:
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:29:14: error: use of undeclared identifier 'u32'
   29 | typedef Mat <u32> u32_mat;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:30:14: error: use of undeclared identifier 'u32'
   30 | typedef Col <u32> u32_vec;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:31:14: error: use of undeclared identifier 'u32'
   31 | typedef Col <u32> u32_colvec;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:32:14: error: use of undeclared identifier 'u32'
   32 | typedef Row <u32> u32_rowvec;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:33:14: error: use of undeclared identifier 'u32'
   33 | typedef Cube<u32> u32_cube;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:35:14: error: use of undeclared identifier 's32'
   35 | typedef Mat <s32> s32_mat;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:36:14: error: use of undeclared identifier 's32'
   36 | typedef Col <s32> s32_vec;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:37:14: error: use of undeclared identifier 's32'
   37 | typedef Col <s32> s32_colvec;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:38:14: error: use of undeclared identifier 's32'
   38 | typedef Row <s32> s32_rowvec;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:39:14: error: use of undeclared identifier 's32'
   39 | typedef Cube<s32> s32_cube;
      |              ^
/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/armadillo_bits/typedef_mat.hpp:41:14: error: use of undeclared identifier 'u64'
   41 | typedef Mat <u64> u64_mat;
      |              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘presto’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/presto’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/5h/wjwzrklx5pvgg_n7qwc2f4rm0000gn/T//RtmpNQpHJV/file9f2b68b5fb14/presto_1.0.0.tar.gz’ had non-zero exit status

Here's the session info:

R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 15.3

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Toronto
tzcode source: internal

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

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       cli_3.6.3         rlang_1.1.4       processx_3.8.5    purrr_1.0.2       pkgload_1.4.0    
 [7] promises_1.3.2    shiny_1.10.0      xtable_1.8-4      glue_1.8.0        htmltools_0.5.8.1 httpuv_1.6.15    
[13] ps_1.8.1          pkgbuild_1.4.6    ellipsis_0.3.2    fastmap_1.2.0     lifecycle_1.0.4   memoise_2.0.1    
[19] compiler_4.3.1    miniUI_0.1.1.1    fs_1.6.5          sessioninfo_1.2.2 htmlwidgets_1.6.4 Rcpp_1.0.14      
[25] rstudioapi_0.17.1 urlchecker_1.0.1  later_1.4.1       digest_0.6.37     R6_2.5.1          curl_6.1.0       
[31] usethis_3.1.0     callr_3.7.6       magrittr_2.0.3    tools_4.3.1       mime_0.12         devtools_2.4.5   
[37] profvis_0.4.0     desc_1.4.3        cachem_1.1.0      remotes_2.5.0   

Lastly, I googled "use of undeclared identifier" and saw something about c++; but I'm not sure what to do with that info..

$ c++ -v
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions