RcppCore / RcppParallel

High-level functions for parallel programming with Rcpp
http://rcppcore.github.io/RcppParallel/
171 stars 58 forks source link

RcppParallel Install Issues #201

Closed acwilsoncu closed 1 year ago

acwilsoncu commented 1 year ago

Hi all, am attempting to install the RcppParallel package as root on a Centos 7 server running RStudio Workbench. Am a bit stuck on how to proceed and would appreciate any input you all have on how to get around this error:

R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages('RcppParallel', repos='https://cran.rstudio.com/')
trying URL 'https://cran.rstudio.com/src/contrib/RcppParallel_5.1.7.tar.gz'
Content type 'application/x-gzip' length 1629119 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘RcppParallel’ ...
** package ‘RcppParallel’ successfully unpacked and MD5 sums checked
** 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
(tbb) Building TBB using bundled sources ...
make[1]: Entering directory `/tmp/RtmpReWVfG/R.INSTALL8ed30717eb6/RcppParallel/src/tbb/src'
OS: linux
arch=intel64
compiler=gcc
runtime=cc4.8.5_libc2.17_kernel3.10.0
tbb_build_prefix=linux_intel64_gcc_cc4.8.5_libc2.17_kernel3.10.0
work_dir=/tmp/RtmpReWVfG/R.INSTALL8ed30717eb6/RcppParallel/src/build/linux_intel64_gcc_cc4.8.5_libc2.17_kernel3.10.0_release
make[1]: Leaving directory `/tmp/RtmpReWVfG/R.INSTALL8ed30717eb6/RcppParallel/src/tbb/src'
make[1]: Entering directory `/tmp/RtmpReWVfG/R.INSTALL8ed30717eb6/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/RtmpReWVfG/R.INSTALL8ed30717eb6/RcppParallel/src/tbb/build/lib_release'
../../build/Makefile.tbb:28: CONFIG: cfg=release arch=intel64 compiler=gcc target=linux runtime=cc4.8.5_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:19:11: error: using-declaration for non-member at class scope
../../include/tbb/compat/iterator.h:19:29: error: expected ‘;’ before ‘=’ token
     using iterator_category = Category;
                             ^
../../include/tbb/compat/iterator.h:19:29: error: expected unqualified-id before ‘=’ token
../../include/tbb/compat/iterator.h:20:11: error: expected nested-name-specifier before ‘value_type’
     using value_type = T;
           ^
../../include/tbb/compat/iterator.h:20:11: error: using-declaration for non-member at class scope
../../include/tbb/compat/iterator.h:20:22: error: expected ‘;’ before ‘=’ token
     using value_type = T;
                      ^
../../include/tbb/compat/iterator.h:20:22: error: expected unqualified-id before ‘=’ token
../../include/tbb/compat/iterator.h:21:11: error: expected nested-name-specifier before ‘difference_type’
     using difference_type = Distance;
           ^
../../include/tbb/compat/iterator.h:21:11: error: using-declaration for non-member at class scope
../../include/tbb/compat/iterator.h:21:27: error: expected ‘;’ before ‘=’ token
     using difference_type = Distance;
                           ^
../../include/tbb/compat/iterator.h:21:27: error: expected unqualified-id before ‘=’ token
../../include/tbb/compat/iterator.h:22:11: error: expected nested-name-specifier before ‘pointer’
     using pointer = Pointer;
           ^
../../include/tbb/compat/iterator.h:22:11: error: using-declaration for non-member at class scope
../../include/tbb/compat/iterator.h:22:19: error: expected ‘;’ before ‘=’ token
     using pointer = Pointer;
                   ^
../../include/tbb/compat/iterator.h:22:19: error: expected unqualified-id before ‘=’ token
../../include/tbb/compat/iterator.h:23:11: error: expected nested-name-specifier before ‘reference’
     using reference = Reference;
           ^
../../include/tbb/compat/iterator.h:23:11: error: using-declaration for non-member at class scope
../../include/tbb/compat/iterator.h:23:21: error: expected ‘;’ before ‘=’ token
     using reference = Reference;
                     ^
../../include/tbb/compat/iterator.h:23:21: error: expected unqualified-id before ‘=’ token
make[2]: *** [concurrent_hash_map.o] Error 1
make[2]: Leaving directory `/tmp/RtmpReWVfG/R.INSTALL8ed30717eb6/RcppParallel/src/tbb/build/lib_release'
make[1]: *** [tbb_release] Error 2
make[1]: Leaving directory `/tmp/RtmpReWVfG/R.INSTALL8ed30717eb6/RcppParallel/src/tbb/src'
g++ -std=gnu++11 -I"/opt/R/4.2.1/lib/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"/opt/R/4.2.1/lib/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/opt/R/4.2.1/lib/R/lib -L/usr/local/lib -o RcppParallel.so init.o options.o -L/opt/R/4.2.1/lib/R/lib -lR
installing via 'install.libs.R' to /opt/R/4.2.1/lib/R/library/00LOCK-RcppParallel/00new/RcppParallel
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘RcppParallel’
    finding HTML links ... done
    RcppParallel-package                    html  
    RcppParallel.package.skeleton           html  
    flags                                   html  
    setThreadOptions                        html  
    tbbLibraryPath                          html  
** 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/R/4.2.1/lib/R/library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so':
  /opt/R/4.2.1/lib/R/library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/R/4.2.1/lib/R/library/RcppParallel’

The downloaded source packages are in
    ‘/tmp/RtmpeTViAn/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RcppParallel", repos = "https://cran.rstudio.com/") :
  installation of package ‘RcppParallel’ had non-zero exit status
> 
> 
eddelbuettel commented 1 year ago

Please search the existing issues for 'CentOS 7' -- this has come up before, your toolchain is likely to old but there is a workaround / improvement via devtoolset.

Here is search for all 'centos' issues: https://github.com/RcppCore/RcppParallel/issues?q=is%3Aissue+centos -- please review and report back. This is most likely a duplicate issue.

acwilsoncu commented 1 year ago

Thanks for your input, @eddelbuettel

I was able to resolve this by creating the ~/.R/Makevars file and setting the CXX11 compiler to be the same as the CXX from the output of 'R CMD config --all'

J-Kamp commented 1 year ago

Thanks for your input, @eddelbuettel

I was able to resolve this by creating the ~/.R/Makevars file and setting the CXX11 compiler to be the same as the CXX from the output of 'R CMD config --all'

Can you be more specific on what you did? I have tried adding the Makevars file with: CXX11 = /gsc/software/linux-x86_64-centos7/gcc-7.2.0/bin/g++

Installing both with R CMD, in R with install.packages and with devtools directly.

None of it works and I end up with the same error as you posted in the top.