To install the package rstan
in R, the package RcppParallel
is required, but I'm not able to install it in R/4.3 on a Linux machine (cluster). I tried different solutions proposed (e.g., install from source, from github etc) but none of them worked.
Below is the error message when entering devtools::install_github("RcppCore/RcppParallel")
:
> devtools::install_github("RcppCore/RcppParallel")
Downloading GitHub repo RcppCore/RcppParallel@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/RtmpQAq3pY/remotes19ca222cb2f4/RcppCore-RcppParallel-6f81716/DESCRIPTION’ ...
─ preparing ‘RcppParallel’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts (342ms)
─ checking for empty or unneeded directories
─ building ‘RcppParallel_5.1.7-9000.tar.gz’
* installing *source* package ‘RcppParallel’ ...
** using staged installation
** preparing to configure package 'RcppParallel' ...
*** configured file: 'R/tbb-autodetected.R.in' => 'R/tbb-autodetected.R'
*** configured file: 'src/Makevars.in' => 'src/Makevars'
*** configured file: 'src/install.libs.R.in' => 'src/install.libs.R'
** finished configure for package 'RcppParallel'
** libs
using C++ compiler: ‘g++ (GCC) 5.2.0’
(tbb) Building TBB using bundled sources ...
make[1]: Entering directory `/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/tbb/src'
OS: linux
arch=intel64
compiler=gcc
runtime=cc5.2.0_libc2.17_kernel3.10.0
tbb_build_prefix=linux_intel64_gcc_cc5.2.0_libc2.17_kernel3.10.0
work_dir=/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/build/linux_intel64_gcc_cc5.2.0_libc2.17_kernel3.10.0_release
make[1]: Leaving directory `/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/tbb/src'
make[1]: Entering directory `/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/tbb/src'
Created ../build/lib_release directory
make -C "../build/lib_release" -r -f ../../build/Makefile.tbb cfg=release
make[2]: Entering directory `/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/tbb/build/lib_release'
../../build/Makefile.tbb:28: CONFIG: cfg=release arch=intel64 compiler=gcc target=linux runtime=cc5.2.0_libc2.17_kernel3.10.0
g++ -I../inst/include -o concurrent_hash_map.o -c -MMD -DDO_ITT_NOTIFY -O2 -DUSE_PTHREAD -m64 -mrtm -fpic -D__TBB_BUILD=1 -Wall -Wextra -g -O2 -DTBB_NO_LEGACY=1 -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
In file included from ../../include/tbb/concurrent_hash_map.h:26:0,
from ../../src/tbb/concurrent_hash_map.cpp:17:
../../include/tbb/compat/iterator.h:19:11: error: expected nested-name-specifier before ‘iterator_category’
using iterator_category = Category;
^
../../include/tbb/compat/iterator.h:20:11: error: expected nested-name-specifier before ‘value_type’
using value_type = T;
^
../../include/tbb/compat/iterator.h:21:11: error: expected nested-name-specifier before ‘difference_type’
using difference_type = Distance;
^
../../include/tbb/compat/iterator.h:22:11: error: expected nested-name-specifier before ‘pointer’
using pointer = Pointer;
^
../../include/tbb/compat/iterator.h:23:11: error: expected nested-name-specifier before ‘reference’
using reference = Reference;
^
make[2]: *** [concurrent_hash_map.o] Error 1
make[2]: Leaving directory `/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/tbb/build/lib_release'
make[1]: *** [tbb_release] Error 2
make[1]: Leaving directory `/tmp/RtmpnnJNlE/R.INSTALL9a795ad099fc/RcppParallel/src/tbb/src'
g++ -std=gnu++11 -I"/cm/shared/apps/R/4.3/lib64/R/include" -DNDEBUG -I../inst/include -I/usr/local/include -std=gnu++11 -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fpic -g -O2 -c init.cpp -o init.o
g++ -std=gnu++11 -I"/cm/shared/apps/R/4.3/lib64/R/include" -DNDEBUG -I../inst/include -I/usr/local/include -std=gnu++11 -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fpic -g -O2 -c options.cpp -o options.o
g++ -std=gnu++11 -shared -L/usr/local/lib64 -o RcppParallel.so init.o options.o
installing via 'install.libs.R' to /cm/shared/apps/R/4.3/lib64/R/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 '/cm/shared/apps/R/4.3/lib64/R/library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so':
/cm/shared/apps/R/4.3/lib64/R/library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/cm/shared/apps/R/4.3/lib64/R/library/RcppParallel’
Warning message:
In i.p(...) :
installation of package ‘/tmp/RtmpQAq3pY/file19ca7020dbc7/RcppParallel_5.1.7-9000.tar.gz’ had non-zero exit status