在Mac上使用MacPorts安装GDAL时遇到错误

4

我正在使用 Mac 10.7.5,并希望使用 MacPorts 安装 GDAL。我按照以下步骤进行:

sudo port install gdal

但是我遇到了这个错误:
--->  Computing dependencies for gdal
--->  Building gdal
Error: org.macports.build for port gdal returned: command execution failed
Please see the log file for port gdal for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port gdal failed

主日志文件中错误的最后一部分是:
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/work/gdal-2.0.2" && /usr/bin/make -j24 -w 
:info:build Exit code: 2
:error:build org.macports.build for port gdal returned: command execution failed
:debug:build Error code: CHILDSTATUS 78620 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"portbuild::build_main org.macports.build"
    ("eval" body line 1)
    invoked from within
"eval $procedure $targetname"
:info:build Warning: targets not executed for gdal: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Please see the log file for port gdal for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/main.log

如何解决这个问题?

不想使用Homebrew,因为与MacPorts共同安装它并不推荐。 - user308827
1
如果您在互联网上进行任何操作或使用公共Wi-Fi网络时使用Mac,那么您将面临严重的风险。 10.7.5已经过时了。是否有任何方法可以接近受支持的安装? - hrbrmstr
谢谢@hrbrmstr,如果没有更新到新的Mac版本就无法使其工作,我可以考虑升级。然而,这台Mac作为内部集群使用,我不确定升级是否会对所有人造成影响。 - user308827
你是否查看了错误信息中提到的 /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_gdal/gdal/main.log 以获取更多详细信息? - mico
谢谢@mico,我已经知道了。我问题中的错误信息来自那个main.log文件。 - user308827
也许您可以粘贴更多的日志文件,因为似乎缺少相关部分(make命令的实际错误消息)。此外,您应该按照指示向macports提交错误报告。 - m7thon
2个回答

3
请确保您已经安装了Xcode和Xcode命令行工具,否则port将无法安装任何内容,您会收到此类错误。 Xcode命令行工具提供被MacPorts调用的/usr/bin/make应用程序。

如果确认您已经安装了Xcode和Xcode命令行工具后仍然无法正常运行,则很可能是因为10.7.5操作系统已死亡,不仅苹果不再支持该操作系统大多数其他软件供应商也不再支持它

很抱歉告诉您这个消息,但现在可能是时候升级了。好消息是,升级很可能是免费的


1
你可以同时安装Homebrew和MacPorts,鉴于你提供的信息很少,这是我会选择的方案。如果你在每个软件包管理器中安装内容时不小心,可能会遇到问题,但如果你无法解决像你报告的那样的问题,你也没有更多的选择了。
无论如何,你的问题可能是你没有/usr/bin/make。 尝试在终端中输入“/usr/bin/make”,并报告你得到了什么。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接