我正在尝试Rcpp在我的 M1 Mac 上使用 R 中需要的软件包,但在购买这台计算机后我一直无法启动并运行它。我将其更新到蒙特利,希望这能解决一些安装问题,但事实并非如此。我尝试从此页面Rcpp运行检查,但出现以下错误:
> Rcpp::sourceCpp("~/github/helloworld.cpp")\nRun Code Online (Sandbox Code Playgroud)\nld: warning: directory not found for option \'-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.2.0/11.0.0\'\nld: warning: directory not found for option \'-L/opt/R/arm64/gfortran/lib\'\nld: library not found for -lgfortran\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\nmake: *** [sourceCpp_4.so] Error 1\nclang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I"/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/RcppArmadillo/include" -I"/Users/afredston/github" -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c helloworld.cpp -o helloworld.o\nclang++ -arch arm64 -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined …Run Code Online (Sandbox Code Playgroud) 显然,QEMU是唯一可以在新 Apple 芯片(M1、M2 等)上模拟 x86 操作系统的开源代码。
Apple 构建了 Rosetta 2,理论上,它与 QEMU 在这些场景中执行的操作完全相同。它将 x86 (Intel) 指令转换为新 Apple 芯片处理器支持的指令集。
Rosetta 2 具有出色的性能,某些 x86 应用程序甚至比在本机 x86 硬件上运行时具有更好的性能。另一方面,当在 Apple 芯片上运行 x86 Linux 时,QEMU 的表现还差得远。
Rosetta为何能有如此优越的性能?是否有任何只有 Apple 知道且从未与 QEMU 项目共享的架构“秘密”?QEMU 不允许访问哪些禁止的 API?
我已经在带有 Apple Silicon 的新 Mac mini 上成功安装了带有 Numpy 和 Matplotlib 的 python 3.9.1。但是,我无法安装 SciPy:使用时出现编译错误
python3 -m pip install scipy
我还尝试从 brew 安装所有内容,并且“import scipy”有效,但使用它会导致段错误。我已经安装了 lapack 和 openblas 的 ARM 版本,但这并不能解决问题。
有人成功了吗?(我有兴趣在本地运行它,而不是通过 Rosetta)。
我使用的是 MacBook Pro M1(在有人说这是因为 M1 或其他原因之前,我已经使用 Flutter 和 M1 编程了好几个星期,但之后我必须重置我的 M1)...我的大问题:
\n每次运行 Pod Install 时出错,我都无法使用包含本机代码(例如shared_preferences或 )的包来启动我的项目。sqlite
我在 Stack Overflow 上进行了搜索,但到目前为止没有任何帮助。如果我在没有包的情况下启动我的项目,那么没有问题,这是我的 Flutter 代码,非常简单:
\nimport 'dart:convert';\nimport 'package:flutter/material.dart';\nimport 'package:http/http.dart';\nimport 'package:shared_preferences/shared_preferences.dart';\n\nvoid main() {\n runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n // This widget is the root of your application.\n @override\n Widget build(BuildContext context) {\n return MaterialApp(\n home: Home(),\n );\n }\n\n}\n\n\n`class Home extends StatelessWidget {\n const Home({Key key}) : super(key: key);\n\n @override\n Widget build(BuildContext context) {\n return Scaffold(\n body: …Run Code Online (Sandbox Code Playgroud) cocoapods visual-studio-code flutter flutter-packages apple-silicon
我目前正在使用 Apple Silicon 的 2021 款 MacBook Pro 上开发 Python (3.8) 项目。最终,目标是使用 Apple 的 Tensorflow fork 从 Azure SQL DB 读取的数据构建 ML 模型。因此,我正在本地 Apple Silicon 包上开发该项目 - 不使用 Rosetta。
当我尝试导入 pyodbc 包(4.0.30)以连接到我的数据库时,出现了问题。我不断收到以下错误
File "<stdin>", line 1, in <module>
ImportError: dlopen({myvenv}/lib/python3.8/site-packages/pyodbc.cpython-38-darwin.so, 2):
Symbol not found: _SQLAllocHandle
Referenced from: {myvenv}/lib/python3.8/site-packages/pyodbc.cpython-38-darwin.so
Expected in: flat namespace
in {myvenv}/lib/python3.8/site-packages/pyodbc.cpython-38-darwin.so
Run Code Online (Sandbox Code Playgroud)
然而,如果我使用 Rosetta 做同样的事情,一切都会正常。我找不到任何其他线程描述类似的行为。
有谁知道如何解决这个问题?
关于二进制文件、处理器以及它们如何协同工作的问题,这里有点菜鸟:
我有一台带有 M1 芯片的新 Mac,想安装 Node.js。我习惯用 Homebrew 来做这件事。现在,如果我安装 Homebrew,强烈建议我使用 Rosetta,所以我这样做了。下一步:安装节点。所以,而不是brew install node我做arch -x86_64 brew install node。
这很好用,只是我想知道,我现在是否以次优方式使用节点?Node 是否也在使用 Rosetta,而不是直接在 M1 芯片上运行?
当我在 Macbook Air M1 上运行 .py 文件时遇到问题:
[Running] python3 -u "/Users/kaiyuwei/Documents/graduation project/metaheuristics/run_CRO.py"
Traceback (most recent call last):
File "/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ImportError: dlopen(/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 0x0002): tried: '/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/kaiyuwei/Documents/graduation project/metaheuristics/run_CRO.py", …Run Code Online (Sandbox Code Playgroud) 错误响应示例:
TTRAN-YK0WK9W9PM:virtual_terminal tuantran$ rvm install 2.7.6
ruby-2.7.6 - #removing src/ruby-2.7.6..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/12.3/arm64/ruby-2.7.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/tuantran/.rvm/rubies/ruby-2.7.6, this may take a while depending on your cpu(s)...
ruby-2.7.6 - #downloading ruby-2.7.6, this may take a while depending …Run Code Online (Sandbox Code Playgroud) 如何在 macOS 11(英特尔)上编译 C 项目以在 ?Silicon 上工作?
我当前的构建脚本非常简单:
./configure
make
sudo make install
Run Code Online (Sandbox Code Playgroud)
我已经使用了尝试--host和--target标志有aarch64-apple-darwin和arm-apple-darwin没有任何的运气。
二进制文件始终默认为x86_64:
> file foobar.so
foobar.so: Mach-O 64-bit bundle x86_64
Run Code Online (Sandbox Code Playgroud)
更新:
似乎在--host指定时找不到 cc 和 gcc 。
checking for arm-apple-darwin-cc... no
checking for arm-apple-darwin-gcc... no
Run Code Online (Sandbox Code Playgroud) 2021年1月6日下午突然,我在OSX下的Selenium Protractor测试停止工作,出现神秘错误
spawn Unknown system error -86
Run Code Online (Sandbox Code Playgroud)
我做了一些研究,发现错误号 86 与
Bad CPU type in executable
Run Code Online (Sandbox Code Playgroud)
并运行以下命令将我的 chromedriver 二进制文件的 CPU 架构与我的系统进行比较:
% file chromedriver_87.0.4280.88
chromedriver_87.0.4280.88: Mach-O 64-bit executable arm64
% uname -a
Darwin kobl179273m 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
% uname -p
i386
Run Code Online (Sandbox Code Playgroud)
如何修复 Selenium 使用的 chromedriver 二进制文件,以便它可以在我的 Intel x64 mac 上运行并清除“系统错误 -86”或“CPU 类型错误”消息?
macos selenium webdriver selenium-chromedriver apple-silicon