Skip to content

M1 Mac Install Error #182

Closed
Closed
@Nonameentered

Description

@Nonameentered

I've been trying to get an arm64 version of R running on my computer as I've been using an intel R binary (both installed with different versions of Homebrew). I've been running into trouble with installing this package which is a dependency of quanteda. i've tried installing both via command line and through RStudio. At first I thought this was a repeat of #162 but it looks like it does see that I'm using arm64, however, I think there might be something wrong with the compiler? I'm not sure how to fix it though so any help would be appreciated, thanks!

* installing *source* package ‘RcppParallel’ ...
** package ‘RcppParallel’ successfully unpacked and MD5 sums checked
** using staged installation
** preparing to configure package 'RcppParallel' ...
*** configured file: 'src/Makevars.in' => 'src/Makevars'
** finished configure for package 'RcppParallel'
** libs
(tbb) Building TBB using bundled sources ...
OS: macos
arch=arm64
compiler=clang
runtime=cc13.1.6_os12.3.1
tbb_build_prefix=macos_arm64_clang_cc13.1.6_os12.3.1
work_dir=/private/var/folders/xj/0wct6fs17lj8c0qthjk1ryb80000gn/T/RtmpECKmtb/R.INSTALL3d296907c509/RcppParallel/src/build/macos_arm64_clang_cc13.1.6_os12.3.1_release
Created ../build/lib_release directory
make -C "../build/lib_release"  -r -f ../../build/Makefile.tbb cfg=release
../../build/Makefile.tbb:28: CONFIG: cfg=release arch=arm64 compiler=clang target=macos runtime=cc13.1.6_os12.3.1
clang++ -I../inst/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -o concurrent_hash_map.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall  -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
In file included from ../../src/tbb/concurrent_hash_map.cpp:17:
In file included from /opt/homebrew/include/tbb/concurrent_hash_map.h:17:
In file included from /opt/homebrew/include/tbb/../oneapi/tbb/concurrent_hash_map.h:21:
In file included from /opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:24:
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_config.h:438:13: warning: TBB Warning: Support for C++98/03 is deprecated. Please use the compiler that supports C++11 features at least. [-W#pragma-messages]
    #pragma message("TBB Warning: Support for C++98/03 is deprecated. Please use the compiler that supports C++11 features at least.")
            ^
In file included from ../../src/tbb/concurrent_hash_map.cpp:17:
In file included from /opt/homebrew/include/tbb/concurrent_hash_map.h:17:
In file included from /opt/homebrew/include/tbb/../oneapi/tbb/concurrent_hash_map.h:21:
In file included from /opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:26:
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:56:1: warning: inline namespaces are a C++11 feature [-Wc++11-inline-namespace]
inline namespace d0 {
^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:136:1: error: unknown type name 'constexpr'
constexpr std::uintptr_t number_of_bits() {
^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:136:16: error: cannot define or redeclare 'uintptr_t' here because namespace 'd0' does not enclose namespace 'std'
constexpr std::uintptr_t number_of_bits() {
          ~~~~~^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:136:16: warning: variable templates are a C++14 extension [-Wc++14-extensions]
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:136:16: error: no member named 'uintptr_t' in namespace 'std'
constexpr std::uintptr_t number_of_bits() {
          ~~~~~^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:136:25: error: expected ';' at end of declaration
constexpr std::uintptr_t number_of_bits() {
                        ^
                        ;
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:136:26: error: C++ requires a type specifier for all declarations
constexpr std::uintptr_t number_of_bits() {
                         ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:137:19: error: use of undeclared identifier 'T'
    return sizeof(T) * CHAR_BIT;
                  ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:144:39: error: expected '(' for function-style cast or type construction
    return (number_of_bits<decltype(x)>() - 1) ^ gnu_builtins::clz(x);
                           ~~~~~~~~~~~^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_machine.h:144:41: error: expected expression
    return (number_of_bits<decltype(x)>() - 1) ^ gnu_builtins::clz(x);
                                        ^
In file included from ../../src/tbb/concurrent_hash_map.cpp:17:
In file included from /opt/homebrew/include/tbb/concurrent_hash_map.h:17:
In file included from /opt/homebrew/include/tbb/../oneapi/tbb/concurrent_hash_map.h:21:
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:30:1: warning: inline namespaces are a C++11 feature [-Wc++11-inline-namespace]
inline namespace d0 {
^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:33:18: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<typename... T> void suppress_unused_warning(T&&...) {}
                 ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:33:55: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
template<typename... T> void suppress_unused_warning(T&&...) {}
                                                      ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:39:1: error: unknown type name 'constexpr'
constexpr size_t max_nfs_size = 128;
^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:39:17: error: expected ';' after top level declarator
constexpr size_t max_nfs_size = 128;
                ^
                ;
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:40:1: error: unknown type name 'constexpr'
constexpr std::size_t max_nfs_size_exp = 7;
^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:40:16: error: cannot define or redeclare 'size_t' here because namespace 'd0' does not enclose namespace 'std'
constexpr std::size_t max_nfs_size_exp = 7;
          ~~~~~^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:40:16: error: no member named 'size_t' in namespace 'std'
constexpr std::size_t max_nfs_size_exp = 7;
          ~~~~~^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:40:22: error: expected ';' after top level declarator
constexpr std::size_t max_nfs_size_exp = 7;
                     ^
                     ;
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:41:20: error: use of undeclared identifier 'max_nfs_size_exp'
static_assert(1 << max_nfs_size_exp == max_nfs_size, "max_nfs_size_exp must be a log2(max_nfs_size)");
                   ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:41:40: error: use of undeclared identifier 'max_nfs_size'
static_assert(1 << max_nfs_size_exp == max_nfs_size, "max_nfs_size_exp must be a log2(max_nfs_size)");
                                       ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:48:12: error: unknown type name 'constexpr'
    static constexpr std::int32_t LOOPS_BEFORE_YIELD = 16;
           ^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:48:27: error: non-friend class member 'int32_t' cannot have a qualified name
    static constexpr std::int32_t LOOPS_BEFORE_YIELD = 16;
                     ~~~~~^
/opt/homebrew/include/tbb/../oneapi/tbb/detail/_utils.h:48:27: error: no member named 'int32_t' in namespace 'std'
    static constexpr std::int32_t LOOPS_BEFORE_YIELD = 16;
                     ~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
6 warnings and 20 errors generated.
make[2]: *** [concurrent_hash_map.o] Error 1
make[1]: *** [tbb_release] Error 2
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.2.0/lib/R/include" -DNDEBUG -I../inst/include  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include  -std=gnu++11 -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fPIC  -g -O2  -c init.cpp -o init.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.2.0/lib/R/include" -DNDEBUG -I../inst/include  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include  -std=gnu++11 -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fPIC  -g -O2  -c options.cpp -o options.o
clang++ -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/homebrew/Cellar/r/4.2.0/lib/R/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib -o RcppParallel.so init.o options.o -L/opt/homebrew/Cellar/r/4.2.0/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing via 'install.libs.R' to /opt/homebrew/lib/R/4.2/site-library/00LOCK-RcppParallel/00new/RcppParallel
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘RcppParallel’:
 .onLoad failed in loadNamespace() for 'RcppParallel', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/opt/homebrew/lib/R/4.2/site-library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so':
  dlopen(/opt/homebrew/lib/R/4.2/site-library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so, 0x0006): symbol not found in flat namespace '__ZN3tbb10interface78internal15task_arena_base24internal_max_concurrencyEPKNS0_10task_arenaE'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/homebrew/lib/R/4.2/site-library/RcppParallel’

The downloaded source packages are in
    ‘/private/var/folders/xj/0wct6fs17lj8c0qthjk1ryb80000gn/T/RtmpvevTSW/downloaded_packages’
Warning message:
In install.packages("RcppParallel") :
  installation of package ‘RcppParallel’ had non-zero exit status
> sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: aarch64-apple-darwin21.3.0 (64-bit)
Running under: macOS Monterey 12.3.1

Matrix products: default
BLAS:   /opt/homebrew/Cellar/openblas/0.3.20/lib/libopenblasp-r0.3.20.dylib
LAPACK: /opt/homebrew/Cellar/r/4.2.0/lib/R/lib/libRlapack.dylib

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

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

loaded via a namespace (and not attached):
[1] compiler_4.2.0 tools_4.2.0  
> R.version
               _                           
platform       aarch64-apple-darwin21.3.0  
arch           aarch64                     
os             darwin21.3.0                
system         aarch64, darwin21.3.0       
status                                     
major          4                           
minor          2.0                         
year           2022                        
month          04                          
day            22                          
svn rev        82229                       
language       R                           
version.string R version 4.2.0 (2022-04-22)
nickname       Vigorous Calisthenics 

Activity

kevinushey

kevinushey commented on Apr 29, 2022

@kevinushey
Contributor

Based on the error, it looks like RcppParallel is finding your Homebrew TBB installation (rather than the bundled one) and failing when attempting to use it (or some of those header definitions are getting mixed up).

kevinushey

kevinushey commented on Apr 29, 2022

@kevinushey
Contributor

I just pushed a workaround; you can try remotes::install_github("RcppCore/RcppParallel") and see if that helps.

Nonameentered

Nonameentered commented on Apr 29, 2022

@Nonameentered
Author

It looks like that worked, thanks so much for the quick fix!

mollysrour

mollysrour commented on Sep 6, 2022

@mollysrour

The workaround did not work for me, and I'm still receiving this error.

lolapsgp

lolapsgp commented on Apr 21, 2023

@lolapsgp

Hi, I am having exactly the same problem. I have tried all the solutions I found on Google and nothing helps. Could someone fix it some other way?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      M1 Mac Install Error · Issue #182 · RcppCore/RcppParallel