std::make_unique compile error again
Opened this issue · 4 comments
Hi Everyone,
It looks like the std::make_unique issue has returned in a new install of R 4.4.0.
Any advice on how to proceed would be much appreciated.
Best,
John
`
devtools::install_github('jwood000/RcppAlgos')
Downloading GitHub repo jwood000/RcppAlgos@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/RtmpEpvtTp/remotes11e9563eda43e9/jwood000-RcppAlgos-c92abf9/DESCRIPTION’ (403ms)
─ preparing ‘RcppAlgos’:
✔ 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 (766ms)
─ building ‘RcppAlgos_2.8.3.tar.gz’
Installing package into ‘/home/everett/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
- installing source package ‘RcppAlgos’ ...
** using staged installation
** libs
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c BigComboCount.cpp -o BigComboCount.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c BigPartsCountDistinct.cpp -o BigPartsCountDistinct.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c BigPartsCountRep.cpp -o BigPartsCountRep.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c BigPartsCountSection.cpp -o BigPartsCountSection.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c BigPermuteCount.cpp -o BigPermuteCount.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CartesianContainer.cpp -o CartesianContainer.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CheckReturn.cpp -o CheckReturn.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ClassUtils.cpp -o ClassUtils.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CnstrntsSpecialClass.cpp -o CnstrntsSpecialClass.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CnstrntsToRClass.cpp -o CnstrntsToRClass.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CombinationResults.cpp -o CombinationResults.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CombinatoricsApply.cpp -o CombinatoricsApply.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CombinatoricsCount.cpp -o CombinatoricsCount.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c CombinatoricsMain.cpp -o CombinatoricsMain.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboApplyClass.cpp -o ComboApplyClass.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboCartesian.cpp -o ComboCartesian.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboClass.cpp -o ComboClass.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboCount.cpp -o ComboCount.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboGroups.cpp -o ComboGroups.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboGroupsClass.cpp -o ComboGroupsClass.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboGroupsGeneral.cpp -o ComboGroupsGeneral.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboGroupsSame.cpp -o ComboGroupsSame.o
g++ -std=gnu++11 -I"/home/opt/R-4.4.0/lib/R/include" -DNDEBUG -I../inst/include/ -I'/home/everett/R/x86_64-pc-linux-gnu-library/4.4/cpp11/include' -I/usr/local/include -fpic -g -O2 -c ComboGroupsTemplate.cpp -o ComboGroupsTemplate.o
ComboGroupsTemplate.cpp: In function ‘std::unique_ptr MakeComboGroup(const std::vector&, const GroupHelper&, int, int, int, int, bool, bool, bool)’:
ComboGroupsTemplate.cpp:35:21: error: ‘make_unique’ is not a member of ‘std’
35 | return std::make_unique(
| ^~~~~~~~~~~
ComboGroupsTemplate.cpp:35:21: note: ‘std::make_unique’ is only available from C++14 onwards
ComboGroupsTemplate.cpp:35:51: error: expected primary-expression before ‘>’ token
35 | return std::make_unique(
| ^
ComboGroupsTemplate.cpp:39:21: error: ‘make_unique’ is not a member of ‘std’
39 | return std::make_unique(n, r, i1, i2, bnd, vGrpSize);
| ^~~~~~~~~~~
ComboGroupsTemplate.cpp:39:21: note: ‘std::make_unique’ is only available from C++14 onwards
ComboGroupsTemplate.cpp:39:50: error: expected primary-expression before ‘>’ token
39 | return std::make_unique(n, r, i1, i2, bnd, vGrpSize);
| ^
ComboGroupsTemplate.cpp:41:21: error: ‘make_unique’ is not a member of ‘std’
41 | return std::make_unique(
| ^~~~~~~~~~~
ComboGroupsTemplate.cpp:41:21: note: ‘std::make_unique’ is only available from C++14 onwards
ComboGroupsTemplate.cpp:41:48: error: expected primary-expression before ‘>’ token
41 | return std::make_unique(
| ^
make: *** [/home/opt/R-4.4.0/lib/R/etc/Makeconf:204: ComboGroupsTemplate.o] Error 1
ERROR: compilation failed for package ‘RcppAlgos’ - removing ‘/home/everett/R/x86_64-pc-linux-gnu-library/4.4/RcppAlgos’
Warning message:
In i.p(...) :
installation of package ‘/tmp/RtmpEpvtTp/file11e956686cc6ab/RcppAlgos_2.8.3.tar.gz’ had non-zero exit status
`
`
sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /home/opt/R-4.4.0/lib/R/lib/libRlapack.so; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/New_York
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.4.0 tools_4.4.0
`
This looks like you need to enable a more recent c++ standard. I see you have g++ -std=gnu++11
, where you need at least c++ 14 support. As of c++ 14, std::make_unique
is defined in the memory header.
You may need to upgrade your compiler if it doesn't support a later standard.
Also, I don't see anything from the current checks: https://cran.r-project.org/web/checks/check_results_RcppAlgos.html
Please let me know what you find.
Thanks
Before spending too much time on your setup, let me point out a few things:
- There is a Makevars file and a DESCRIPTION that could possibly affect compilation.
- For the current
Makevars
file there is no specification for C++ standard nor is there anything in theSystemRequirements
field of theDESCRIPTION
file. - Given the two points above, the base C++ standard employed is dependent on the R version you are using. Since R 4.0.0, the standard is C++17.
- Finally, there is an INSTALL.md file that has some guidelines for installation. It says there that a modern compiler is required. We know that compilation fails for gcc 4.8.5 whereas compilation was successful for gcc 5.3.1.
- It looks like you are using gcc compiler. You can find what version of gcc you have by typing
gcc -v
on the command line.
Please let me know what you find.
Thanks