我在 terra 安裝方面遇到了困難。為了完整起見,我嘗試了在谷歌中找到的所有提示,但沒有任何改變這個錯誤訊息。如果我理解得很好,我需要 rgdal 作為「terra」依賴項,但是當我嘗試安裝 terra 或 rgdal 時,我收到相同的訊息。我嘗試過卸載、重新安裝、透過 pip、conda 安裝,但沒有任何效果。我相當絕望。 gdal是透過brew安裝的:
gdal-config --version
給出3.5.0
登入 R :
> install.packages("terra")
Installation du package dans ‘/home/col1/R/x86_64-pc-linux-gnu-library/4.2’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://cloud.r-project.org/src/contrib/terra_1.5-34.tar.gz'
Content type 'application/x-gzip' length 667829 bytes (652 KB)
==================================================
downloaded 652 KB
* installing *source* package ‘terra’ ...
** package ‘terra’ correctement décompressé et sommes MD5 vérifiées
** using staged installation
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /home/linuxbrew/.linuxbrew/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.5.0
checking GDAL version >= 2.0.1... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... no
checking GDAL: linking with --libs and --dep-libs... no
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gdal/3.5.0_1/lib/libgdal.so: undefined reference to `opj_decoder_set_strict_mode'
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gdal/3.5.0_1/lib/libgdal.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gdal/3.5.0_1/lib/libgdal.so: undefined reference to `opj_encoder_set_extra_options'
collect2: error: ld returned 1 exit status
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gdal/3.5.0_1/lib/libgdal.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘terra’
* removing ‘/home/col1/R/x86_64-pc-linux-gnu-library/4.2/terra’
Warning in install.packages :
l'installation du package ‘terra’ a eu un statut de sortie non nul
Les packages source téléchargés sont dans
‘/tmp/RtmpaCYwto/downloaded_packages’
如果有人有線索,我將非常感激,