getspams / spams-R

R interface for SPAMS (SPArse Modeling Software)
https://thoth.inrialpes.fr/people/mairal/spams/
GNU General Public License v3.0
1 stars 1 forks source link

Can't seem to be able to install the package in R version 4.3.1 #4

Open NeginValizadegan opened 11 months ago

NeginValizadegan commented 11 months ago

Can you help me install this in R 4.3.1? I'm trying the code below and here is the error I get:

> library(remotes) # or library(devtools) > install_github("getspams/spams-R")

error:

Downloading GitHub repo getspams/spams-R@HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/p2/rr2lfpdd3_79mrd6rf_khd1c0000gq/T/RtmpYudz51/remotes2d96ac38202/getspams-spams-R-0c812f8/DESCRIPTION’ ...
─  preparing ‘spams’:
✔  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
─  building ‘spams_2.6.tar.gz’

* installing *source* package ‘spams’ ...
** using staged installation
** libs
using C++ compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘’
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -Ispams/dags    -DUSE_BLAS_LIB -DNDEBUG -O3 -mtune=native -fPIC  -falign-functions=64 -Wall -g -O2  -c spams.cpp -o spams.o
In file included from spams.cpp:1301:
In file included from ./spams.h:25:
In file included from spams/dictLearn/dicts.h:36:
In file included from spams/prox/fista.h:24:
spams/prox/project.h:2054:14: warning: variable 'size_list' set but not used [-Wunused-but-set-variable]
         int size_list=0;
             ^
spams/prox/project.h:2040:8: warning: variable 'num' set but not used [-Wunused-but-set-variable]
   int num=0;
       ^
spams/prox/project.h:2041:9: warning: variable 'num1' set but not used [-Wunused-but-set-variable]
   long num1=0;
        ^
spams/prox/project.h:2042:9: warning: variable 'num2' set but not used [-Wunused-but-set-variable]
   long num2=0;
        ^
spams/prox/project.h:2043:9: warning: variable 'num3' set but not used [-Wunused-but-set-variable]
   long num3=0;
        ^
spams/prox/project.h:2044:9: warning: variable 'num4' set but not used [-Wunused-but-set-variable]
   long num4=0;
        ^
spams/prox/project.h:2129:8: warning: variable 'num' set but not used [-Wunused-but-set-variable]
   int num=1;
       ^
spams/prox/project.h:2130:9: warning: variable 'num1' set but not used [-Wunused-but-set-variable]
   long num1=0;
        ^
spams/prox/project.h:2131:9: warning: variable 'num2' set but not used [-Wunused-but-set-variable]
   long num2=0;
        ^
spams/prox/project.h:2132:9: warning: variable 'num3' set but not used [-Wunused-but-set-variable]
   long num3=0;
        ^
spams/prox/project.h:2133:9: warning: variable 'num4' set but not used [-Wunused-but-set-variable]
   long num4=0;
        ^
In file included from spams.cpp:1301:
./spams.h:35:57: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
template<typename T> void _sort(Vector<T> *v,bool mode) throw(const char *){
                                                        ^~~~~~~~~~~~~~~~~~~
./spams.h:35:57: note: use 'noexcept(false)' instead
template<typename T> void _sort(Vector<T> *v,bool mode) throw(const char *){
                                                        ^~~~~~~~~~~~~~~~~~~
                                                        noexcept(false)
./spams.h:40:61: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
template<typename T> void _AAt(SpMatrix<T> *A,Matrix<T> *B) throw(const char *) {
                                                            ^~~~~~~~~~~~~~~~~~~
./spams.h:40:61: note: use 'noexcept(false)' instead
template<typename T> void _AAt(SpMatrix<T> *A,Matrix<T> *B) throw(const char *) {
                                                            ^~~~~~~~~~~~~~~~~~~
                                                            noexcept(false)
./spams.h:47:76: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
template<typename T> void _XAt(SpMatrix<T> *A,Matrix<T> *X,Matrix<T> *XAt) throw(const char *) {
                                                                           ^~~~~~~~~~~~~~~~~~~
./spams.h:47:76: note: use 'noexcept(false)' instead
template<typename T> void _XAt(SpMatrix<T> *A,Matrix<T> *X,Matrix<T> *XAt) throw(const char *) {
                                                                           ^~~~~~~~~~~~~~~~~~~
                                                                           noexcept(false)
./spams.h:54:29: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
      const T a, const T b) throw(const char *) {
                            ^~~~~~~~~~~~~~~~~~~
./spams.h:54:29: note: use 'noexcept(false)' instead
      const T a, const T b) throw(const char *) {
                            ^~~~~~~~~~~~~~~~~~~
                            noexcept(false)
./spams.h:76:71: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
template<typename T> void _applyBayerPattern(Vector<T> *v,int offset) throw(const char *){
                                                                      ^~~~~~~~~~~~~~~~~~~
./spams.h:76:71: note: use 'noexcept(false)' instead
template<typename T> void _applyBayerPattern(Vector<T> *v,int offset) throw(const char *){
                                                                      ^~~~~~~~~~~~~~~~~~~
                                                                      noexcept(false)
./spams.h:80:116: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
template<typename T> void _conjugateGradient(Matrix<T> *A,Vector<T> *b,Vector<T> *x,const T tol,const int itermax) throw(const char *){
                                                                                                                   ^~~~~~~~~~~~~~~~~~~
./spams.h:80:116: note: use 'noexcept(false)' instead
template<typename T> void _conjugateGradient(Matrix<T> *A,Vector<T> *b,Vector<T> *x,const T tol,const int itermax) throw(const char *){
                                                                                                                   ^~~~~~~~~~~~~~~~~~~
                                                                                                                   noexcept(false)
./spams.h:101:29: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
      const int numThreads) throw(const char *) {
                            ^~~~~~~~~~~~~~~~~~~
./spams.h:101:29: note: use 'noexcept(false)' instead
      const int numThreads) throw(const char *) {
                            ^~~~~~~~~~~~~~~~~~~
                            noexcept(false)
./spams.h:112:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:112:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
./spams.h:150:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:150:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
./spams.h:194:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:194:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
./spams.h:221:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:221:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
./spams.h:251:196: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
SpMatrix<T> *_omp(Matrix<T> *X,Matrix<T> *D,Matrix<T> **path,bool return_reg_path,bool given_L,Vector<int>*L,bool given_eps,Vector<T>*eps,bool given_Lambda,Vector<T>*Lambda,const int numThreads) throw(const char *){
                                                                                                                                                                                                   ^~~~~~~~~~~~~~~~~~~
./spams.h:251:196: note: use 'noexcept(false)' instead
SpMatrix<T> *_omp(Matrix<T> *X,Matrix<T> *D,Matrix<T> **path,bool return_reg_path,bool given_L,Vector<int>*L,bool given_eps,Vector<T>*eps,bool given_Lambda,Vector<T>*Lambda,const int numThreads) throw(const char *){
                                                                                                                                                                                                   ^~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                   noexcept(false)
./spams.h:296:216: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
SpMatrix<T> *_ompMask(Matrix<T> *X,Matrix<T> *D,Matrix<bool> *B,Matrix<T> **path,bool return_reg_path,bool given_L,Vector<int>*L,bool given_eps,Vector<T>*eps,bool given_Lambda,Vector<T>*Lambda,const int numThreads) throw(const char *){
                                                                                                                                                                                                                       ^~~~~~~~~~~~~~~~~~~
./spams.h:296:216: note: use 'noexcept(false)' instead
SpMatrix<T> *_ompMask(Matrix<T> *X,Matrix<T> *D,Matrix<bool> *B,Matrix<T> **path,bool return_reg_path,bool given_L,Vector<int>*L,bool given_eps,Vector<T>*eps,bool given_Lambda,Vector<T>*Lambda,const int numThreads) throw(const char *){
                                                                                                                                                                                                                       ^~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                       noexcept(false)
./spams.h:345:130: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
SpMatrix<T> *_cd(Matrix<T> *X,Matrix<T> *D,SpMatrix<T>*alpha,T lambda1, constraint_type mode, int itermax, T tol,int numThreads) throw(const char *){
                                                                                                                                 ^~~~~~~~~~~~~~~~~~~
./spams.h:345:130: note: use 'noexcept(false)' instead
SpMatrix<T> *_cd(Matrix<T> *X,Matrix<T> *D,SpMatrix<T>*alpha,T lambda1, constraint_type mode, int itermax, T tol,int numThreads) throw(const char *){
                                                                                                                                 ^~~~~~~~~~~~~~~~~~~
                                                                                                                                 noexcept(false)
./spams.h:363:97: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
SpMatrix<T> *_somp(Matrix<T> *X,Matrix<T> *D,Vector<int> *groups,int LL, T eps, int numThreads) throw(const char *){
                                                                                                ^~~~~~~~~~~~~~~~~~~
./spams.h:363:97: note: use 'noexcept(false)' instead
SpMatrix<T> *_somp(Matrix<T> *X,Matrix<T> *D,Vector<int> *groups,int LL, T eps, int numThreads) throw(const char *){
                                                                                                ^~~~~~~~~~~~~~~~~~~
                                                                                                noexcept(false)
./spams.h:419:144: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
void _l1L2BCD(Matrix<T> *X,Matrix<T> *D,Matrix<T>*alpha0,Vector<int> *groups,T lambda1, constraint_type mode,int itermax,T tol,int numThreads) throw(const char *){
                                                                                                                                               ^~~~~~~~~~~~~~~~~~~
./spams.h:419:144: note: use 'noexcept(false)' instead
void _l1L2BCD(Matrix<T> *X,Matrix<T> *D,Matrix<T>*alpha0,Vector<int> *groups,T lambda1, constraint_type mode,int itermax,T tol,int numThreads) throw(const char *){
                                                                                                                                               ^~~~~~~~~~~~~~~~~~~
                                                                                                                                               noexcept(false)
./spams.h:500:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:500:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
./spams.h:652:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:652:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
./spams.h:820:1: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
./spams.h:820:1: note: use 'noexcept(false)' instead
throw(const char *) 
^~~~~~~~~~~~~~~~~~~
noexcept(false)
fatal error: too many errors emitted, stopping now [-ferror-limit=]
11 warnings and 20 errors generated.
make: *** [spams.o] Error 1
ERROR: compilation failed for package ‘spams’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/spams’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/p2/rr2lfpdd3_79mrd6rf_khd1c0000gq/T//RtmpYudz51/file2d922229a90/spams_2.6.tar.gz’ had non-zero exit status
> library(spams)
Error in library(spams) : there is no package called ‘spams’
cjfields commented 11 months ago

5 addresses this issue.