簡體   English   中英

在 macOS 上更新 gdal 后安裝 R 包 sf 0.9.0 時出錯

[英]Error installing R package sf 0.9.0 after updating gdal on macOS

我讓sfrproj永遠在 mac 上工作,自從升級到 Catalina / R 3.6.2 后仍在工作。

我嘗試從 CRAN 和開發版本安裝最新版本的sf (0.9.0),但兩種方式都出現錯誤, configure: error: libproj not found in standard or given locations.

我已經檢查並刪除了計算機上 gdal 和 proj 的最后痕跡,卸載了兩者,重新安裝,但仍然是同樣的問題。 現在,嘗試安裝我知道在我的計算機上工作的舊版本sf (0.8.1) 也失敗了。 完全被這里難住了!

GDAL 2.4.4,2020/01/08 發布

R v3.6.2

macOS 10.15.3

configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking GDAL version >= 2.0.1... yes
checking for gcc... clang
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 clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -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... yes
checking GDAL: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 2.4.4
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.

對於rgdal ...

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... yes
configure: svn revision: 845
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking C++11 support for GDAL >= 2.3.0... yes
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking gdal: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
configure: pkg-config proj not available
  set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj
configure: proj CPP flags:  -I/usr/local/Cellar/gdal/2.4.4_2/include
configure: PROJ LIBS:  -lproj
checking PROJ header API:... proj_api.h
checking proj_api.h presence and usability... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rgdal

終於找到了幾個小時的挖掘后的解決方案在這里,如果其他人遇到這個問題。

一個對我有用的解決方案。 我已將其發布在: https : //biostatsr.blogspot.com/2021/05/install-sf-from-github-source-in-macosx.html

在終端。 您必須安裝了 MacBrew。 如果沒有,請使用:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

然后

brew install proj

brew install gdal

brew install geos

sudo R

然后在R中:

 library("devtools")

 install_github("r-spatial/sf", configure.args = "--with-proj-include=/usr/local/include --with-proj-lib=/usr/local/lib")

和...

包版本(“SF”)

[1] '0.9.9'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM