eddelbuettel / rcpptoml

Rcpp Bindings to C++ parser for TOML files
GNU General Public License v2.0
36 stars 9 forks source link

compilation failed for package ‘RcppTOML’ #45

Closed aoifgri closed 2 years ago

aoifgri commented 2 years ago

Hello,

I am trying to install Seurat and Signac on R v4.1.0 using Linux and keep getting an error about the dependency RcppTOML failing to compile. I have looked at other threads discussing this and upgraded to compilers/gcc/7.2.0 and also tried to install it using conda, but I am continuing to get this error. Any advice?

`> install.packages("Seurat") Installing package into ‘/mnt/scratch2/users//R/lib’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- Secure CRAN mirrors Selection: 75 also installing the dependencies ‘RcppTOML’, ‘leiden’, ‘reticulate’

  • installing source package ‘RcppTOML’ ... package ‘RcppTOML’ successfully unpacked and MD5 sums checked using staged installation libs /usr/bin/g++ -std=gnu++11 -I"/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.0/gcc-4.8.5+lapack-3.5.0+blas-3.6.0/lib64/R/include" -DNDEBUG -I../inst/include/ -DCPPTOML_USE_MAP -I'/mnt/scratch2/users//R/lib/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o /usr/bin/g++ -std=gnu++11 -I"/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.0/gcc-4.8.5+lapack-3.5.0+blas-3.6.0/lib64/R/include" -DNDEBUG -I../inst/include/ -DCPPTOML_USE_MAP -I'/mnt/scratch2/users//R/lib/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c parse.cpp -o parse.o In file included from parse.cpp:28:0: ../inst/include/toml.hpp: In static member function ‘static std::string includize::toml_spec::unescape_filename(const string&)’: ../inst/include/toml.hpp:29:66: error: no matching function for call to ‘regex_replace(const string&, std::regex, const char [2])’ return std::regex_replace(str, std::regex("\\\""), "\""); ^ ../inst/include/toml.hpp:29:66: note: candidates are: In file included from /usr/include/c++/4.8.2/regex:62:0, from ../inst/include/includize.hpp:7, from ../inst/include/toml.hpp:4, from parse.cpp:28: /usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template<class _Out_iter, class _Bi_iter, class _Rx_traits, class _Ch_type> _Out_iter std::regex_replace(_Out_iter, _Bi_iter, _Bi_iter, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type) regex_replace(_Out_iter out, _Bi_iter first, _Bi_iter last, ^ /usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template argument deduction/substitution failed: In file included from parse.cpp:28:0: ../inst/include/toml.hpp:29:66: note: deduced conflicting types for parameter ‘_Bi_iter’ (‘std::basic_regex’ and ‘const char*’) return std::regex_replace(str, std::regex("\\\""), "\""); ^ In file included from /usr/include/c++/4.8.2/regex:62:0, from ../inst/include/includize.hpp:7, from ../inst/include/toml.hpp:4, from parse.cpp:28: /usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template<class _Rx_traits, class _Ch_type> std::basic_string<_Ch_type> std::regex_replace(const std::basic_string<_Ch_type>&, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type) regex_replace(const basic_string<_Ch_type>& s, ^ /usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template argument deduction/substitution failed: In file included from parse.cpp:28:0: ../inst/include/toml.hpp:29:66: note: mismatched types ‘const std::basic_string<_Ch_type>’ and ‘const char [2]’ return std::regex_replace(str, std::regex("\\\""), "\""); ^ make: * [parse.o] Error 1 ERROR: compilation failed for package ‘RcppTOML’
  • removing ‘/mnt/scratch2/users//R/lib/RcppTOML’ ERROR: dependency ‘RcppTOML’ is not available for package ‘reticulate’
  • removing ‘/mnt/scratch2/users//R/lib/reticulate’ ERROR: dependency ‘reticulate’ is not available for package ‘leiden’
  • removing ‘/mnt/scratch2/users//R/lib/leiden’ ERROR: dependencies ‘leiden’, ‘reticulate’ are not available for package ‘Seurat’
  • removing ‘/mnt/scratch2/users//R/lib/Seurat’

The downloaded source packages are in ‘/tmp/Rtmp8SCqqy/downloaded_packages’ Warning messages: 1: In install.packages("Seurat") : installation of package ‘RcppTOML’ had non-zero exit status 2: In install.packages("Seurat") : installation of package ‘reticulate’ had non-zero exit status 3: In install.packages("Seurat") : installation of package ‘leiden’ had non-zero exit status 4: In install.packages("Seurat") : installation of package ‘Seurat’ had non-zero exit status `

eddelbuettel commented 2 years ago

I see gcc-4.8.5 in your logs. That is a very old compiler which was released 2013 (for 4.8.0) to 2015 (for 4.8.5).

It is 2022 now, and my computer has gcc-11.3 with a matching g++-11.3 for current compilation standards. RcppTOML is not even that demanding.

Is there any chance you could update your system / build on a different system with more current tools?

aoifgri commented 2 years ago

I have gcc-10.3.0 loaded before opening the R module so it is in my environment. It only says gcc-4.8.3 in my log as that's what our R module was compiled with I think.

eddelbuettel commented 2 years ago

Ok. Try to isolate it -- Seurat (and Signat) have a long tail but RcppTOML "should be" pretty standard by now. We had issues with it when we wrote the very first versions as C++11 was not widely available then, but then days even R 4.0.0 made C++11 them minimum and R 4.1.0 made it C++14 -- all provided the compilers used can support it. You should not need anything special.

eddelbuettel commented 2 years ago

By "isolate" I mean try to work on RcppTOML (and other problematic-to-you-here) packages one by one as you do. That is the right approach.