Проблема с установкой пакета sf в R (Linux Mint)

Я попытался установить пакет sf в R и получил следующее сообщение об ошибке:

      > ERROR: dependency ‘s2’ is not available for package ‘sf’
> * removing ‘/home/luisa/R/i686-pc-linux-gnu-library 
> /4.1/sf’

> The downloaded source packages are in
>   ‘/tmp/RtmpGe94R6/downloaded_packages’
> Warning messages:
> 1: In install.packages("sf") :
> installation of package ‘s2’ had non-zero exit status
> 2: In install.packages("sf") :
> installation of package ‘sf’ had non-zero exit status

Когда я пытаюсь установить пакет s2, я получаю следующее сообщение об ошибке:

      In file included from ../src/s2/util/math/vector.h:24:0,
                 from ../src/s2/s2point.h:22,
                 from ../src/s2/s2wedge_relations.h:24,
                 from s2/s2wedge_relations.cc:18:
/usr/include/c++/7/cmath:245:3: note: previous definition of ‘constexpr long double std::fabs(long double)’ was here
   fabs(long double __x)
   ^~~~
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/strings/ostringstream.cc -o s2/strings/ostringstream.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/strings/serialize.cc -o s2/strings/serialize.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/util/bits/bit-interleave.cc -o s2/util/bits/bit-interleave.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/util/bits/bits.cc -o s2/util/bits/bits.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/util/coding/coder.cc -o s2/util/coding/coder.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/util/coding/varint.cc -o s2/util/coding/varint.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/Rcpp/include' -I'/home/luisa/R/i686-pc-linux-gnu-library/4.1/wk/include'   -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-cyamqN/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c s2/util/math/exactfloat/exactfloat.cc -o s2/util/math/exactfloat/exactfloat.o
s2/util/math/exactfloat/exactfloat.cc: In function ‘uint64 BN_ext_get_uint64(const BIGNUM*)’:
s2/util/math/exactfloat/exactfloat.cc:104:9: error: invalid use of incomplete type ‘const BIGNUM {aka const struct bignum_st}’
   if (bn->top == 0) return 0;
         ^~
In file included from /usr/include/openssl/bn.h:19:0,
                 from ../src/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
s2/util/math/exactfloat/exactfloat.cc:105:9: error: invalid use of incomplete type ‘const BIGNUM {aka const struct bignum_st}’
   if (bn->top == 1) return BN_get_word(bn);
         ^~
In file included from /usr/include/openssl/bn.h:19:0,
                 from ../src/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
In file included from ../src/s2/util/math/exactfloat/exactfloat.h:122:0,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
s2/util/math/exactfloat/exactfloat.cc:106:18: error: invalid use of incomplete type ‘const BIGNUM {aka const struct bignum_st}’
   S2_DCHECK_EQ(bn->top, 2);
                  ^
../src/s2/base/logging.h:151:22: note: in definition of macro ‘S2_DCHECK’
     while (false && (condition)) S2NullStream()
                      ^~~~~~~~~
../src/s2/base/logging.h:164:34: note: in expansion of macro ‘S2_DCHECK_OP’
 #define S2_DCHECK_EQ(val1, val2) S2_DCHECK_OP(==, val1, val2)
                                  ^~~~~~~~~~~~
s2/util/math/exactfloat/exactfloat.cc:106:3: note: in expansion of macro ‘S2_DCHECK_EQ’
   S2_DCHECK_EQ(bn->top, 2);
   ^~~~~~~~~~~~
In file included from /usr/include/openssl/bn.h:19:0,
                 from ../src/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
s2/util/math/exactfloat/exactfloat.cc:107:33: error: invalid use of incomplete type ‘const BIGNUM {aka const struct bignum_st}’
   return (static_cast<uint64>(bn->d[1]) << 32) + bn->d[0];
                                 ^~
In file included from /usr/include/openssl/bn.h:19:0,
                 from ../src/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
s2/util/math/exactfloat/exactfloat.cc:107:52: error: invalid use of incomplete type ‘const BIGNUM {aka const struct bignum_st}’
   return (static_cast<uint64>(bn->d[1]) << 32) + bn->d[0];
                                                    ^~
In file included from /usr/include/openssl/bn.h:19:0,
                 from ../src/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
/usr/lib/R/etc/Makeconf:175: recipe for target 's2/util/math/exactfloat/exactfloat.o' failed
make: *** [s2/util/math/exactfloat/exactfloat.o] Error 1
ERROR: compilation failed for package ‘s2’
* removing ‘/home/luisa/R/i686-pc-linux-gnu-library/4.1/s2’

The downloaded source packages are in
    ‘/tmp/RtmpGe94R6/downloaded_packages’
Warning message:
In install.packages("s2") :
  installation of package ‘s2’ had non-zero exit status

Я использую Linux Mint 19.3 Tricia, моя версия R - 4.1.2, а моя версия GDAL - 3.0.4.

Когда я попытался установить пакет s2 из терминала Linux, у меня было такое же сообщение об ошибке:

      In file included from /usr/include/openssl/bn.h:19:0,
                 from ../inst/include/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
s2/util/math/exactfloat/exactfloat.cc:107:52: error: invalid use of incomplete type ‘const BIGNUM {aka const struct bignum_st}’
   return (static_cast<uint64>(bn->d[1]) << 32) + bn->d[0];
                                                    ^~
In file included from /usr/include/openssl/bn.h:19:0,
                 from ../inst/include/s2/util/math/exactfloat/exactfloat.h:119,
                 from s2/util/math/exactfloat/exactfloat.cc:18:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^~~~~~~~~
/usr/lib/R/etc/Makeconf:175: recipe for target 's2/util/math/exactfloat/exactfloat.o' failed
make: *** [s2/util/math/exactfloat/exactfloat.o] Error 1
ERROR: compilation failed for package ‘s2

Кто-нибудь знает, как решить эту проблему? Пожалуйста, дайте мне знать, если мне понадобится дополнительная информация.

0 ответов

Другие вопросы по тегам