RcppAlgos icon indicating copy to clipboard operation
RcppAlgos copied to clipboard

std::make_unique compile error again

Open helixscript opened this issue 1 year ago • 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<ComboGroupsTemplate> 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<ComboGroupsGeneral>( | ^~~~~~~~~~~ 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<ComboGroupsGeneral>( | ^ ComboGroupsTemplate.cpp:39:21: error: ‘make_unique’ is not a member of ‘std’ 39 | return std::make_unique<ComboGroupsUnique>(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<ComboGroupsUnique>(n, r, i1, i2, bnd, vGrpSize); | ^ ComboGroupsTemplate.cpp:41:21: error: ‘make_unique’ is not a member of ‘std’ 41 | return std::make_unique<ComboGroupsSame>( | ^~~~~~~~~~~ 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<ComboGroupsSame>( | ^ 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 `

helixscript avatar May 24 '24 15:05 helixscript

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

jwood000 avatar May 24 '24 17:05 jwood000

Thanks ! Great observation. Curious though because CXX is set to C++ 17 (below). Perhaps something in the MakeFile is calling for 11. I will dig deeper.

Best, John

(base) @.***:~$ R CMD config CXX g++ -std=gnu++17

(base) @.***:~$ grep ^CXX $(R RHOME)/etc/Makeconf CXX = g++ -std=gnu++17 CXXFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXXPICFLAGS = -fpic CXX11 = g++ CXX11FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX11PICFLAGS = -fpic CXX11STD = -std=gnu++11 CXX14 = g++ CXX14FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX14PICFLAGS = -fpic CXX14STD = -std=gnu++14 CXX17 = g++ CXX17FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX17PICFLAGS = -fpic CXX17STD = -std=gnu++17 CXX20 = g++ CXX20FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX20PICFLAGS = -fpic CXX20STD = -std=gnu++20 CXX23 = g++ CXX23FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX23PICFLAGS = -fpic CXX23STD = -std=gnu++23 CXX_VISIBILITY = -fvisibility=hidden

On Fri, May 24, 2024 at 1:57 PM Joseph Wood @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/jwood000/RcppAlgos/issues/51#issuecomment-2130089420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2ISQ2P7FRIOVJBV4W57JTZD55PPAVCNFSM6AAAAABIHYXUUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZQGA4DSNBSGA . You are receiving this because you authored the thread.Message ID: @.***>

-- John K. Everett, Ph.D. http://www.linkedin.com/in/JohnEverettPhD

helixscript avatar May 25 '24 00:05 helixscript

... before I start digging, my default R compiler configurations are below. C++ settings look good. Kindly let me know where in your package compilation initiates, eg. MakeFile(s). Perhaps there is something that is pushing my system to use -std=gnu++11.

Best, John

(base) @.***:~$ more /etc/R/Makeconf

etc/Makeconf. Generated from Makeconf.in by configure.

${R_HOME}/etc/Makeconf

R was configured using the following call

(not including env. vars and site configuration)

configure '--prefix=/usr' '--with-cairo' '--with-jpeglib'

'--with-readline' '--with-tcltk' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share/R/share' '--includedir=/usr/share/R/include' '--with-blas' '--with-lap ack' '--enable-long-double' '--enable-R-profiling' '--enable-R-shlib' '--enable-memory-profiling' '--without-recommended-packages' '--build' 'x86_64-linux-gnu' 'build_alias=x86_64-linux-gnu' 'R_PRINTCMD=/usr/bin/lpr' 'R_PAPERSIZE=letter' 'T AR=/bin/tar' 'R_BROWSER=xdg-open' 'LIBnn=lib' 'JAVA_HOME=/usr/lib/jvm/default-java' 'R_SHELL=/bin/bash' 'CC=gcc' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro' 'CPPFLAGS=' 'FC=gfortran' 'FCFLAGS=-g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-stron g' 'CXX=g++' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2'

This fails if it contains spaces, or if it is quoted

include $(R_SHARE_DIR)/make/vars.mk

AR = ar BLAS_LIBS = -lblas

C compilers

CC = gcc CFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CC17 = gcc -std=gnu17 C17FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CC23 = gcc -std=gnu2x C23FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CC90 = gcc -std=gnu90 C90FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CC99 = gcc -std=gnu99 C99FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CPICFLAGS = -fpic CPPFLAGS = C_VISIBILITY = -fvisibility=hidden

C++ compilers

CXX = g++ -std=gnu++17 CXXFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXXPICFLAGS = -fpic CXX11 = g++ CXX11FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX11PICFLAGS = -fpic CXX11STD = -std=gnu++11 CXX14 = g++ CXX14FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX14PICFLAGS = -fpic CXX14STD = -std=gnu++14 CXX17 = g++ CXX17FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX17PICFLAGS = -fpic CXX17STD = -std=gnu++17 CXX20 = g++ CXX20FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX20PICFLAGS = -fpic CXX20STD = -std=gnu++20 CXX23 = g++ CXX23FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX23PICFLAGS = -fpic CXX23STD = -std=gnu++23 CXX_VISIBILITY = -fvisibility=hidden

DYLIB_EXT = .so DYLIB_LD = $(CC) DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)

should be used by packages for dylibs, but at the time of writing was not

DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS) ECHO = echo ECHO_C = ECHO_N = -n ECHO_T =

Fortran

FC = gfortran FCFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong $(LTO_FC)

additional libs needed when linking with $(FC), e.g. on some Oracle

compilers FCLIBS_XTRA = FFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong $(LTO_FC) FLIBS = -lgfortran -lm -lquadmath FPICFLAGS = -fpic FPIEFLAGS = -fPIE F_VISIBILITY = -fvisibility=hidden

FOUNDATION_CPPFLAGS = FOUNDATION_LIBS = JAR = /usr/lib/jvm/default-java/bin/jar JAVA = /usr/lib/jvm/default-java/bin/java JAVAC = /usr/lib/jvm/default-java/bin/javac JAVAH =

JAVA_HOME might be used in the next three.

They are for packages 'JavaGD' and 'rJava'

JAVA_HOME = /usr/lib/jvm/default-java JAVA_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux JAVA_LIBS = -L$(JAVA_HOME)/lib/server -ljvm JAVA_LD_LIBRARY_PATH = $(JAVA_HOME)/lib/server LAPACK_LIBS = -llapack LDFLAGS = -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro

we only need this is if it is external, as otherwise link to R

LIBINTL= LIBM = -lm LIBR0 = -L"$(R_HOME)/lib$(R_ARCH)" LIBR1 = -lR LIBR = -L"$(R_HOME)/lib$(R_ARCH)" -lR LIBS = -lpcre2-8 -ldeflate -llzma -lbz2 -lz -ltirpc -lrt -ldl -lm -licuuc -licui18n

needed by R CMD config

LIBnn = lib LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"

set for --enable-lto, --enable-lto=check

LTO = LTO_FC = LTO_LD =

set for --enable-lto=R, used in INSTALL

LTO_OPT = LTO_FC_OPT =

needed to build applications linking to static libR

MAIN_LD = $(CC) MAIN_LDFLAGS = -Wl,--export-dynamic -fopenmp MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS) MKINSTALLDIRS = "$(R_HOME)/bin/mkinstalldirs" NM = /usr/bin/nm -B OBJC = OBJCFLAGS = $(LTO) OBJC_LIBS = OBJCXX = R_ARCH = RANLIB = ranlib SAFE_FFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -msse2 -mfpmath=sse

A version of SHLIB_LIBADD not overridden in install.R.

SAN_LIBS = SED = /bin/sed SHELL = /bin/bash SHLIB_CFLAGS = SHLIB_CXXFLAGS = SHLIB_CXXLD = $(CXX) SHLIB_CXXLDFLAGS = -shared# $(CXXFLAGS) $(CXXPICFLAGS) $(LTO_LD) SHLIB_CXX11LD = $(CXX11) $(CXX11STD) SHLIB_CXX11LDFLAGS = -shared# $(CXX11FLAGS) $(CXX11PICFLAGS) $(LTO_LD) SHLIB_CXX14LD = $(CXX14) $(CXX14STD) SHLIB_CXX14LDFLAGS = -shared# $(CXX14FLAGS) $(CXX14PICFLAGS) $(LTO_LD) SHLIB_CXX17LD = $(CXX17) $(CXX17STD) SHLIB_CXX17LDFLAGS = -shared# $(CXX17FLAGS) $(CXX17PICFLAGS) $(LTO_LD) SHLIB_CXX20LD = $(CXX20) $(CXX20STD) SHLIB_CXX20LDFLAGS = -shared# $(CXX20FLAGS) $(CXX20PICFLAGS) $(LTO_LD) SHLIB_CXX23LD = $(CXX23) $(CXX23STD) SHLIB_CXX23LDFLAGS = -shared# $(CXX23FLAGS) $(CXX23PICFLAGS) $(LTO_LD) SHLIB_EXT = .so SHLIB_FCLD = $(FC) SHLIB_FCLDFLAGS = -shared# $(FCFLAGS) $(FPICFLAGS) SHLIB_FFLAGS = SHLIB_LD = $(CC)

used for add-on packages linked by C

SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS) $(LTO_LD)

used for standard packages

SHLIB_LDFLAGS_R = -shared# $(CFLAGS) $(CPICFLAGS) $(LTO_LD)

used in install.R to add OBJC_LIBS, FLIBS ....

SHLIB_LIBADD =

We want to ensure libR is picked up from $(R_HOME)/lib

before e.g. /usr/local/lib if a version is already installed.

SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS) SHLIB_OPENMP_CFLAGS = -fopenmp SHLIB_OPENMP_CXXFLAGS = -fopenmp SHLIB_OPENMP_FFLAGS = -fopenmp STRIP_STATIC_LIB = strip --strip-debug STRIP_SHARED_LIB = strip --strip-unneeded TCLTK_CPPFLAGS = -I/usr/include/tcl8.6 -I/usr/include/tcl8.6 TCLTK_LIBS = -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -L/usr/lib/x86_64-linux-gnu -ltk8.6 -lX11 -lXss -lXext YACC = bison -y

for linking to libR.a

STATIC_LIBR = # -Wl,--whole-archive "$(R_HOME)/lib$(R_ARCH)/libR.a" -Wl,--no-whole-archive $(BLAS_LIBS) $(FLIBS) $(LIBINTL) -lreadline $(LIBS)

These are recorded as macros for legacy use in packages

set on AIX, formerly for old glibc (-D__NO_MATH_INLINES)

R_XTRA_CFLAGS =

was formerly set on HP-UX

R_XTRA_CPPFLAGS = -I"$(R_INCLUDE_DIR)" -DNDEBUG

currently unset

R_XTRA_CXXFLAGS =

used for gfortran >= 7 in R 3.6.1 - 4.2.x

R_XTRA_FFLAGS =

SHLIB_CFLAGS SHLIB_CXXFLAGS SHLIB_FFLAGS are apparently currently unused

SHLIB_CXXFLAGS is undocumented, there is no SHLIB_FCFLAGS

ALL_CFLAGS = $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)

XDEFS was a temporary measure for use by R CMD INSTALL

ALL_CPPFLAGS = -I"$(R_INCLUDE_DIR)" -DNDEBUG $(PKG_CPPFLAGS) $(CLINK_CPPFLAGS) $(CPPFLAGS) $(XDEFS)

CXX_DEFS allows adding defines only for C++, e.g. -DR_NO_REMAP

ALL_CXXFLAGS = $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS) $(CXX_DEFS) ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS) ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS) ALL_FFLAGS = $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)

can be overridden by R CMD SHLIB

P_FCFLAGS = $(PKG_FFLAGS) ALL_FCFLAGS = $(P_FCFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FCFLAGS)

LIBR here as a couple of packages use this without SHLIB_LINK

ALL_LIBS = $(PKG_LIBS) $(SHLIB_LIBADD) $(SAN_LIBS) $(LIBR)# $(LIBINTL)

.SUFFIXES: .SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o

.c.o: $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@ .c.d: @echo "making $@ from $<" @$(CC) -MM $(ALL_CPPFLAGS) $< > $@ .m.d: @echo > $@ .cc.o: $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@ .cpp.o: $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@ .cc.d: @echo "making $@ from $<" @$(CXX) -M $(ALL_CPPFLAGS) $< > $@ .cpp.d: @echo "making $@ from $<" @$(CXX) -M $(ALL_CPPFLAGS) $< > $@ .m.o: $(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $@ .mm.o: $(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@ .M.o: $(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@ .f.o: $(FC) $(ALL_FFLAGS) -c $< -o $@ .f95.o: $(FC) $(ALL_FCFLAGS) -c $< -o $@ .f90.o: $(FC) $(ALL_FCFLAGS) -c $< -o $@

On Fri, May 24, 2024 at 8:50 PM John Everett @.***> wrote:

Thanks ! Great observation. Curious though because CXX is set to C++ 17 (below). Perhaps something in the MakeFile is calling for 11. I will dig deeper.

Best, John

(base) @.***:~$ R CMD config CXX g++ -std=gnu++17

(base) @.***:~$ grep ^CXX $(R RHOME)/etc/Makeconf CXX = g++ -std=gnu++17 CXXFLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXXPICFLAGS = -fpic CXX11 = g++ CXX11FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX11PICFLAGS = -fpic CXX11STD = -std=gnu++11 CXX14 = g++ CXX14FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX14PICFLAGS = -fpic CXX14STD = -std=gnu++14 CXX17 = g++ CXX17FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX17PICFLAGS = -fpic CXX17STD = -std=gnu++17 CXX20 = g++ CXX20FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX20PICFLAGS = -fpic CXX20STD = -std=gnu++20 CXX23 = g++ CXX23FLAGS = -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 $(LTO) CXX23PICFLAGS = -fpic CXX23STD = -std=gnu++23 CXX_VISIBILITY = -fvisibility=hidden

On Fri, May 24, 2024 at 1:57 PM Joseph Wood @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/jwood000/RcppAlgos/issues/51#issuecomment-2130089420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2ISQ2P7FRIOVJBV4W57JTZD55PPAVCNFSM6AAAAABIHYXUUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZQGA4DSNBSGA . You are receiving this because you authored the thread.Message ID: @.***>

-- John K. Everett, Ph.D. http://www.linkedin.com/in/JohnEverettPhD

-- John K. Everett, Ph.D. http://www.linkedin.com/in/JohnEverettPhD

helixscript avatar May 25 '24 01:05 helixscript

@helixscript,

Before spending too much time on your setup, let me point out a few things:

  1. There is a Makevars file and a DESCRIPTION that could possibly affect compilation.
  2. For the current Makevars file there is no specification for C++ standard nor is there anything in the SystemRequirements field of the DESCRIPTION file.
  3. 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.
  4. 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.
  5. 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

jwood000 avatar May 25 '24 15:05 jwood000

@helixscript I am closing this issue as there has been no reply for some time. If you have any further information or questions, please don't hesitate to reach out.

jwood000 avatar Jun 09 '25 18:06 jwood000