macOS命令行工具和gcc在Catalina上突然失败(在Mojave上工作)

rrz0

尝试安装MuJoCo时,命令行工具会给出许多错误。我非常有信心地怀疑这是我的macOS Catalina上的命令行工具存在的问题,因为我以前已经在Mojave和多台ubuntu机器上安装了mujoco。以下安装在Mojave上起作用。

首先,我执行:

xcode-select --install

更多的信息:

(base) ryanr@RRMBP ~ % /usr/bin/gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

我安装使用 pip3 install 'mujoco-py<2.1,>=2.0'

我收到以下错误消息:

> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:34:
> error: expected declaration specifiers before
> '__OSX_AVAILABLE_STARTING'    int     getiopolicy_np(int, int)
> __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
>                                     ^~~~~~~~~~~~~~~~~~~~~~~~

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:144:1: error: expected declaration specifiers before 'div_t'
   div_t  div(int, int) __pure2;
   ^~~~~

In file included from /Users/ryanr/.mujoco/mujoco200/include/mujoco.h:34:0,
                   from /private/var/folders/q7/q_59j36d5n31209r5c01mx2w0000gp/T/pip-install-4_wykvnc/mujoco-py/mujoco_py/gl/glshim.h:4,
                   from /private/var/folders/q7/q_59j36d5n31209r5c01mx2w0000gp/T/pip-install-4_wykvnc/mujoco-py/mujoco_py/gl/dummyshim.c:1:
  /usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/math.h:59:19: error: storage class specified for parameter 'float_t'
       typedef float float_t;
                     ^~~~~~~
  /usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/math.h:60:20: error: storage class specified for parameter 'double_t'
       typedef double double_t;
                      ^~~~~~~~
  /usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/math.h:126:12: error: storage class specified for parameter '__math_errhandling'
   extern int __math_errhandling(void);
              ^~~~~~~~~~~~~~~~~~
  /usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/math.h:146:12: error: storage class specified for parameter '__fpclassifyf'
   extern int __fpclassifyf(float);
              ^~~~~~~~~~~~~
  /usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/math.h:147:12: error: storage class specified for parameter '__fpclassifyd'
   extern int __fpclassifyd(double);
              ^~~~~~~~~~~~~
  /usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/math.h:148:12: error: storage class specified for parameter '__fpclassifyl'
   extern int __fpclassifyl(long double);
              ^~~~~~~~~~~~~

                                                  ^
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h:110:0,
                   from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:66,
                   from /Users/ryanr/.mujoco/mujoco200/include/mujoco.h:33,
                   from /private/var/folders/q7/q_59j36d5n31209r5c01mx2w0000gp/T/pip-install-jye6hn52/mujoco-py/mujoco_py/gl/glshim.h:4,
                   from /private/var/folders/q7/q_59j36d5n31209r5c01mx2w0000gp/T/pip-install-jye6hn52/mujoco-py/mujoco_py/gl/dummyshim.c:1:
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:9: error: old-style parameter declarations in prototyped function definition
   int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
           ^~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:1: error: parameter name omitted
   int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
   ^~~
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:1: error: parameter name omitted
  /private/var/folders/q7/q_59j36d5n31209r5c01mx2w0000gp/T/pip-install-jye6hn52/mujoco-py/mujoco_py/gl/dummyshim.c:37:1: error: expected '{' at end of input
   }
   ^
  error: command '/usr/local/bin/gcc-6' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mujoco-py

关于为什么我的命令行工具在macOS Catalina上失败的任何建议?应该采取什么步骤来确保Catalina上的命令行工具和gcc能够按预期工作?

理查德·巴伯

通过sysroot而不是未版本化的sdk传递以前版本的OS X sdk。

  1. 由于SDK目录不正确,导致MacOS Catalina上的命令行工具失败。

  2. 应该采取什么步骤来确保Catalina上的命令行工具和gcc能够按预期工作?引用版本化的SDK:./configure --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1和/或./configure --with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

C 中的 FTDI D2XX API 在命令行控制台上工作,但在 macOS 上由 Xcode 和 Swift 编程构建的应用程序中始终返回零

机械Turk命令行工具突然不起作用

Mac上的小指命令行工具?

Psexec在命令行上工作,但不在ASP中

如何在MacOS上切换命令行工具

在macOS命令行工具项目中读取文件

Maven项目测试找不到黄瓜测试以在命令行上运行功能测试(在黄瓜上工作)

命令行工具,用于搜索和替换PDF上的文本

Gearman gearadmin - 命令行工具 - 清除顽固的工作

如何从dotnet命令行在macOS上安装和运行MDbg?

macos命令行参数最终无法正常工作

命令行工具不起作用-OS X El Capitan,Sierra,High Sierra,Mojave

macOS Mojave上的gcc损坏

即使安装了命令行工具,GCC也无法在OS X上找到stdio.h

OpenCV命令行应用程序无法在macOS Mojave下访问相机

哪些命令行工具可以在Windows上生成密码?

OSX上的命令行中的Javapackager工具?

Mac上的通用命令行取消存档工具

在Mac上安装CMake命令行工具

命令在命令行上工作,但在批处理文件中意外运行

rm在命令行上工作,但不在脚本中工作

SCP不在crontab中工作,但在命令行上工作

Bash在命令行上工作,但不在Perl脚本中工作

命令行差异工具

OSX 10.9和命令行工具,PIL

命令行在MacOS上每个进程的线程数

具有“用户机密”的 ASP.NET Core 应用程序仅在 macOS 命令行上失败

python 包中的命令行腳本:它們在 Windows 機器上工作還是只在 Linux 上工作?

GCC,命令行上的-&&是什么意思?