小编Fra*_*ant的帖子

VS Code N:跳过配置文件“main/binary-arm64/Packages”的获取

我正在运行 POP OS 20.04 并且已经安装/卸载了 VS 代码。当我运行时sudo apt-get update,我得到:

N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'http://packages.microsoft.com/repos/vscode stable InRelease' doesn't support architecture 'arm64'
N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://packages.microsoft.com/repos/vscode stable InRelease' doesn't support architecture 'armhf'
Run Code Online (Sandbox Code Playgroud)

linux

27
推荐指数
1
解决办法
1万
查看次数

在 Apple M1 上设置 terraform v0.14.0

有关如何在 Apple M1 上设置 Terraform v0.14.0 的任何指示,因为 tfenv 不支持 Apple M1 上的 v0.14.0

tfenv install v0.14.0
Installing Terraform v0.14.0
Downloading release tarball from https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_darwin_arm64.zip
curl: (22) The requested URL returned error: 403

Tarball download failed
Run Code Online (Sandbox Code Playgroud)

darwin terraform terraform-provider-azure apple-m1

19
推荐指数
2
解决办法
2万
查看次数

(mach-o 文件,但架构不兼容(有“arm64”,需要“x86_64”))

当我在 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)

python macos x86 importerror apple-silicon

16
推荐指数
3
解决办法
3万
查看次数

如何为 M1 和 Intel 构建 openssl?

我有一个需要使用 Libcrypto 的项目 - 我有两个版本的 Libcrypto(为 ARM64 构建的 libcrypto.a(来自 OpenSSL 1.1.1))和(针对 Intel 的 lcrypto.a(来自 OpenSSL 1.0.2))。撇开拥有两个不同版本是否是良好实践的问题不谈,我可以说,如果我包含 libcrypto.a,那么我可以在 M1 上构建和运行,并且它在 M1 上运行良好。如果我包含 lcrypto.a,那么我可以在 Intel 上构建和运行,并且它在 Intel 上运行良好。我不能做的就是将它们都包括在内(链接器错误 - The linked library 'lcrypto.a' is missing one or more architectures required by this target: arm64.) - 如果我不能将它们都包括在内,那么我就无法构建一个胖二进制文件,并且我的应用程序并不是完全有用!

我的问题是如何将两者都包含在我的项目中 - 或者我在哪里可以获得(以及如何包含)Libcrypto 的胖版本?我看过这个https://github.com/balthisar/openssl-xcframeworks/releases和这个https://developer.apple.com/forums/thread/670631但我一无所知。我我构建了一个 Fat Binary - 但我认为我构建的 Fat Binary 不适用于任何一种架构!

macos openssl libcrypto apple-silicon

14
推荐指数
1
解决办法
2万
查看次数

为 macOS-x86_64 构建,但尝试链接为 macOS-arm64 构建的文件

我用c++和OpenCV写了一段代码:

#include <iostream>
#include <time.h>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>

using namespace std;

int main()
{
    ...
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

然后我尝试在终端上运行我的代码并使用 g++ 进行构建:

g++ $(pkg-config --cflags --libs opencv) -std=c++11  yourFile.cpp -o yourFileProgram
Run Code Online (Sandbox Code Playgroud)

但我收到此错误:

...
ld: warning: ignoring file /opt/homebrew/Cellar/opencv/4.5.1_2/lib/libopencv_core.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/opencv/4.5.1_2/lib/libopencv_photo.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "cv::Mat::Mat()", referenced from:
      _main in cv_test-ff1014.o
  "cv::Mat::~Mat()", referenced …
Run Code Online (Sandbox Code Playgroud)

c++ macos opencv g++

10
推荐指数
1
解决办法
3万
查看次数

Apple M1 docker 镜像使用什么架构:arm/v5、arm/v7、arm64/v8?

我想为新的 Apple M1 CPU 构建 docker 映像。我查看了官方 docker 镜像之一中的架构,发现列出了以下 ARM 架构:

linux/arm/v5
linux/arm/v7
linux/arm64/v8
Run Code Online (Sandbox Code Playgroud)

有什么区别以及我应该使用哪一个?

macos docker apple-m1

10
推荐指数
2
解决办法
5591
查看次数

ARM64 架构(M1 芯片):无法安装 pg gem(使用 PostgresApp)

我一直在尝试在运行 Big Sur 的计算机(带有 M1 的 Macbook Pro 2020)上安装一个 rails 项目。

我安装了 PostgresApp。

运行时bundle install它无法构建pggem,所以我尝试手动安装 gem(通过这样做gem install pg- 也尝试使用gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/10/bin/pg_config)。

我收到一条错误消息:

ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Run Code Online (Sandbox Code Playgroud)

检查错误日志时,我看到:

have_library: checking for PQconnectdb() in -lpq... -------------------- no

ld: warning: ignoring file /Applications/Postgres.app/Contents/Versions/13/lib/libpq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 …
Run Code Online (Sandbox Code Playgroud)

rubygems ruby-on-rails pg postgresapp apple-silicon

6
推荐指数
3
解决办法
2857
查看次数

如何在 arm64 主机平台上运行 amd64 docker 镜像

我有一台 m1 mac,我正在尝试在基于 arm64 的主机平台上运行基于 amd64 的 docker 映像。但是,当我尝试这样做时(使用 docker run),我收到以下错误:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested. 
Run Code Online (Sandbox Code Playgroud)

当我尝试添加标签时--platform linux/amd64,错误消息没有出现,但我似乎无法进入相关的 shell 并docker ps -a显示容器在启动时立即退出。有谁知道在这种情况下我如何在我的机器上运行这个精确的图像/如何使--platform标签工作?

macos containers x86-64 docker apple-silicon

6
推荐指数
2
解决办法
5400
查看次数

M1 Arm USB 直通,带有适用于 Android 模拟器的 QEMU

详细描述问题:使用 Android 模拟器在 Mac OS Monteray 上的 M1 上进行 Qemu USB 直通。据我所知,由于缺少 libusb,这是不可能的,但即使在尝试手动添加它之后,也没有运气。当尝试直通时,我得到“usb-host”不是有效的设备型号名称。无论设备是否插入,都会发生这种情况。

重现步骤:

  1. 在 M1 Mac 上创建 Android 模拟器
  2. 在模拟器位置打开终端窗口
  3. 运行./emulator -avd Pixel_C_API_Sv2 -qemu -device usb-host,bus=ehci.0,vendorid=0x045e,productid=0x0b00 并将 Pixel_C_API_SV2 更改为模拟器的名称。

终端日志如下:

jonathankats@Jonathans-Macbook-Pro-2 emulator-2 % ./emulator -avd Pixel_C_API_Sv2 -qemu -device usb-host,bus=ehci.0,vendorid=0x045e,productid=0x0b00

信息| Android 模拟器版本 30.9.4.0 (build_id 7759208) (CL:N/A) 警告 | 意外的系统映像特征字符串,模拟器可能无法正常工作,请尝试更新模拟器。警告| 无法添加库 /Users/jonathankats/Library/Android/sdk/emulator-2/qemu/darwin-aarch64/lib64/vulkan/libvulkan.dylib:失败警告 | 无法添加库 /Users/jonathankats/Library/Android/sdk/emulator-2/lib64/vulkan/libvulkan.dylib:失败警告 | 无法添加库 /Users/jonathankats/Library/Android/sdk/emulator-2/qemu/darwin-aarch64/lib64/vulkan/libMoltenVK.dylib:失败信息 | 添加了库 /Users/jonathankats/Library/Android/sdk/emulator-2/lib64/vulkan/libMoltenVK.dylib createOrGetGlobalVkEmulation:警告:实例不支持外部内存功能,选择第一个物理设备 configAndStartRenderer:将垂直同步设置为 60 Hz 发送adb公钥[QAAAAMkMadeHMsP2UwMVNGDHD0gCW7lSQOhwj9YZ32g8+dSsTf6HzNiybyLFzgpPkk+9YSRmuvPLjMcG1s05bD3QieBjH3kbM2mUvPw2g3i+2VK5DusFriJATsGRykGvjMdmoN00pEBM7ym 5DKmOalYCj5Mth4vLbfylebMq5MWA64vgNZyEs6+FV6bQbR33V7dSmzN7KIKWJ523gKwhrJBbNSNst52PXTeFaLJt9nnx6dRWrPfzY6o3mqVbLmpbmjRh7i1CH3T+ul1suQBOYs3r6Vz9rkPGo 7RZUyMMvv2ZAzNUjmqfyzpSNDewITobGVfUXIXX0dldk5Zz0aqhhioMPEGEgtOwziOhpNOTDforGqjOdRXPYM9QkjWHT+bbfDgnFoK7hB2O2hV88KLZQoDDnOoVscK86qj8ChTb3yjT+PnVlpZGYKf+/XHU nkjLTL7/BSXx5iqZDz76yDLyIPv6SlJCqvZzZo8Y+TFHr/bix1V4Zoj+8IVDfSkQrceCYeXxp/dsRrl9Q8HYZ03TXM+cJG898b5B292xjOiVMX9RNwrSamOhvWlhLYE8EpLkxAkl1MEtfDIx8T1 05TII1mzPkHQfjuq1s9mXX+dMgecARMZueBQvgr8fzg2WbxCirExo5NGHpC5oxEG7EMZUBnRymiNl/svZSrBYWu1MsAreM/+8D1ollgEAAQA= jonathankats@unknown] 警告 | 在已连接的摄像机列表中找不到摄像机名称“webcam0”。使用“-webcam-list”模拟器选项获取已连接摄像机名称的列表。

信息| 根管尚未激活。信息| 在 …

qemu emulation android-emulator apple-silicon apple-m1

6
推荐指数
0
解决办法
1311
查看次数

Cmake:指定一个单独的构建工具链进行测试?

我正在使用 CMake 构建嵌入式系统的项目,但我的单元测试是在 x86 主机上完成的。因此,我需要使用一种完全不同的编译器来构建用于交叉编译二进制文件的测试。

我的项目顶层有一个主 CMakeLists.txt 文件,然后在我的测试文件夹中添加了另一个文件add_subdirectory到顶层。我应该将它们完全分开还是有更好的方法来实现这一点?

在没有交叉编译器的情况下运行我的主构建将导致它失败,因此它确实需要是一个单独的测试过程。

unit-testing cmake

5
推荐指数
1
解决办法
821
查看次数