【发布时间】:2022-01-16 22:48:41
【问题描述】:
我正在运行一个程序 (OpenModelica OMEdit 1.18.0~dev-109-ged8ef0a),其中一项操作需要 gmake。 gmake 没有安装在我的 Mac (Big Sur 11.5.2) 上,但 make 是。我试图符号链接gmake 指向make,但它不起作用:
➜ where make
/usr/bin/make
➜ make -v | HEAD -n 1
GNU Make 3.81
➜ pwd
/opt/openmodelica/bin
➜ sudo ln -s /usr/bin/make /opt/openmodelica/bin/gmake
➜ ls -lh gmake
lrwxr-xr-x 1 root wheel 13B 13 Dec 09:15 gmake -> /usr/bin/make
➜ /opt/openmodelica/bin/gmake -v
gmake: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find gmake 2> /dev/null' failed with exit code 17664: (null) (errno=Invalid argument)
xcode-select: Failed to locate 'gmake', requesting installation of command line developer tools.
它每次都会提示安装我已经完成的 XCode 命令行开发工具。从错误消息看来,尽管指向了make 可执行文件,但它似乎正在尝试查找gmake? (为什么会出错?)有没有办法让它按我的预期工作,还是我必须使用 brew 安装 gmake 然后符号链接到那个?
命令行工具版本:
➜ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 12.5.1.0.1.1623191612
volume: /
location: /
install-time: 1639360537
groups: com.apple.FindSystemFiles.pkg-group
** 编辑 **
我使用的是 zsh 5.8 (x86_64-apple-darwin20.0),我不知道这是否是导致 gmake 符号链接到 make 无法正常工作的一个因素?
【问题讨论】:
-
您可以使用 Homebrew 中的
brew install make安装gmake作为 Apple 的 BSD 风格make的替代品。