Apple Silicon

RSS for tag

Build apps, libraries, frameworks, plug-ins, and other executable code that run natively on Apple silicon.

Apple Silicon Documentation

Posts under Apple Silicon tag

127 Posts
Sort by:
Post marked as solved
1 Replies
227 Views
Attempting to compile dieharder from source on an M1 Max MacBookPro18,2 (macOS 12 + Xcode 13.3.1 + command line tools) and running into an error: ... /bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -L/opt/local/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/local/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas Undefined symbols for architecture arm64: "_insert", referenced from: _dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) _main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) "_insertBit", referenced from: _dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ... I got to this failure with a MacPorts installed gsl and by executing the following: $ mkdir dieharder; cd dieharder $ wget --no-check-certificate https://webhome.phy.duke.edu/~rgb/General/dieharder/dieharder-3.31.1.tgz $ tar xf dieharder-3.31.1.tgz $ cd dieharder-3.31.1 $ sudo port install gsl $ ./configure LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include CFLAGS=-I/opt/local/include --disable-shared ... $ make ... I reproduced the failure with Homebrew: $ brew install gsl $ make distclean $ ./configure LDFLAGS=-L/opt/homebrew/lib CPPFLAGS=-I/opt/homebrew/include CFLAGS=-I/opt/homebrew/include --disable-shared ... $ make ... /bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -L/opt/homebrew/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/homebrew/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas Undefined symbols for architecture arm64: "_insert", referenced from: _dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) _main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) "_insertBit", referenced from: _dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [dieharder] Error 1 make: *** [dieharder.time] Error 2 Anyone know what might be going on here and how to properly configure this to complete compilation on and for Apple Silicon systems?
Posted Last updated
.
Post not yet marked as solved
3 Replies
263 Views
I have an application made for iPhone and iPad with enabled capability to run natively on M1 Macs. When I try to resign it with an AdHoc profile: codesign --force --deep -s - MyApp.app Application can not be launched anymore with error: "MyApp.app" cannot be opened because the developer did not intend for it to run on this Mac. Contact the developer for support. Is there way to resign it without loosing an ability to run on M1 Mac? Thanks!
Posted
by ToyoApps.
Last updated
.
Post not yet marked as solved
0 Replies
117 Views
Hi, I am looking for the way to achieve the same effect as Linux system call membarrier [1] on Apple Silicon Mac. The syscall issues memory barriers on the other threads. Windows has the similar function FlushProcessWriteBuffers [2]. Is there an equivalent function? [1] https://man7.org/linux/man-pages/man2/membarrier.2.html [2] https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-flushprocesswritebuffers On Intel machines, changing the memory page settings by mprotect system calls makes write buffers of other processors flushed, but it does not seem to work on Apple Silicon.
Posted
by saiaki.
Last updated
.
Post not yet marked as solved
6 Replies
356 Views
This might seem flippant, but it's very serious. My use case, this is literally torturing me to death: We have a language (Allegro Common Lisp) which has a module for making SSL connections. This module is requires OpenSSL. We don't want to supply OpenSSL with our product for obvious reasons--I'm not going to go into that here. So, what's the problem? Well, first, the problem is that Apple decided long ago to not allow developers to build against their version of SSL (which is based on LibreSSL). So, we must depend on Macports or Homebrew for the installation of OpenSSL. Those libraries are in non-standard places and require DYLD_LIBRARY_PATH to be set so that the libraries can be dynamically loaded. The problem is, with SIP, any environment variables that start with DYLD_ or LD_ are stripped from the environment passed to programs. That is, if I set DYLD_LIBRARY_PATH in BASH and start my product, I can't load a signed .dylib that depends on some version of the OpenSSL libraries. To make matters worse, this works on macOS 11.6.5 (20G527) x86_64: DYLD_LIBRARY_PATH=... ./mlisp (sys:getenv "DYLD_LIBRARY_PATH")` That is, it returns the value ... set on the command line. It does not work on macOS 11.6.5 (20G527) arm64. To dynamically load the OpenSSL libraries, we have a glue library (that adds functionality) called acliss11.dylib which depends on @rpath/libssl.1.1.dylib and @rpath/libcrypto.1.1.dylib. For x86_64 we have a solution, but the same solution does NOT work for arm64. How are we supposed to do this?
Posted
by dklayer.
Last updated
.
Post not yet marked as solved
5 Replies
3.3k Views
Hi there. I'm using Unity to develop a WebGL application that has been working for years on Macs. With the new M1 Macs, though, I notice an issue where some of our 3d models flicker specifically on M1 Macs only. Updated Unity versions don't seem to fix anything, and editing the shaders doesn't seem to cause any change either. In the Unity Editor on this computer, everything renders just fine; it's only in an actual build that it's a problem. Has anyone seen an issue like this, either with Unity or with other WebGL? Does anyone have ideas on things I could try? Could this be a browser issue?
Posted Last updated
.
Post marked as solved
6 Replies
555 Views
I have a nodejs app, made into a single executable using pkg which signs the app with an ad-hoc signature. This single executable (xkeys-server-arm64)works fine on the machine which made it but fails on another machine of the same type - presumably because the ad-hoc signature is insufficient in this case. I've tried to replace the ad-hoc signature with my own, using: codesign --force --verify --verbose --sign "Developer ID Application: Christoph Willing (..........)" xkeys-server-arm64 but that fails with xkeys-server-arm64: replacing existing signature xkeys-server-arm64: errSecInternalComponent Checking my own signature with: find-identity -v -p appleID shows a bunch of stuff which doesn't look good. My Christoph_Willing_dev_CA entry says (CSSMERR_TP_NOT_TRUSTED) All other entries, including the Developer ID Application entry I'm trying to codesign with have the comment: (Missing required extension) My questions are: what causes the errSecInternalComponent error (and how can I fix it)? why isn't my dev_CA trusted (and how to fix)? what are the missing extensions for the other certificates (and how to provide them)? Thanks for any tips, chris
Posted Last updated
.
Post not yet marked as solved
1 Replies
459 Views
I spent many hours to figure out why my app is now other item not the iOS app you will see the Distribute Content instead of Distribute App Version and Identifier are now gone I test it on Xcode 13.3 the last archive you will see in the image is the one that Creation Date is 3 Apr 2022 17:55 I try to build with the previous version (Xcode 13.2.1) The error appears Package.resolved file is corrupted or malformed I delete the Package.resolved Then the error is gone I try to archive again and it works Creation Date is 3 Apr 2022 18:30 The problem seems to occur when using an older Xcode project opened with the current version of Xcode (13.3).
Posted
by chatdep.
Last updated
.
Post not yet marked as solved
0 Replies
299 Views
Hello! I have an app that was developed on intel mac using react-native, when developing on M1, the app "quits unexpectedly" on simulator but works fine if I plug my device. Any idea? Problem Details and System Configuration
Posted Last updated
.
Post not yet marked as solved
1 Replies
164 Views
Today I was reminded that apps on the Mac do not have to be Mach-O Executables: They can be scripts! For example, a python script. But what I found out that if the app is started directly from the terminal, the app starts as ARM64. But if starting from the Finder (i.e. launchd), it is launched as Intel. Is there an Info.plist key that fixes this?
Posted
by below.
Last updated
.
Post not yet marked as solved
0 Replies
856 Views
I'm trying to learn Xcode and iOS development with swift. I'm going through the PyTorch tutorial to configure the Xcode env and I'm unable to get it working. Specifically I'm just doing the simple helloWorld project. The installation of the libraries seems to have gone fine as has the pytorch pod install command. However when I try to build, it fails with this error: ld: in /Users/user/Development/mobileTorch/ios-demo-app/HelloWorld/HelloWorld/Pods/LibTorch/install/lib/libtorch.a(empty.cpp.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Development/mobileTorch/ios-demo-app/HelloWorld/HelloWorld/Pods/LibTorch/install/lib/libtorch.a' for architecture arm64 clang: error: linker command failed with exit code 1 System: 2020 Macbook Air Apple M1 silicon Steps taken: Installed libtorch 1.7 with sudo gem install ffi and then pod install Tried to build with various different iOS emulators Installing the gems both with Rosetta and natively I presume the issue lies somewhere in the apple silicon but I'm not sure what else to try.
Posted Last updated
.
Post not yet marked as solved
1 Replies
406 Views
Hello, I have a macOS application which can utilize several CPU cores at the same time. For optimal performance, I need to know the number of CPU cores at runtime. On Intel-based Macs it was possible to get the number of available cores by running sysctl hw.ncpu. Now on Apple Silicon SoCs, sysctl hw.ncpu returns the total count of performance and efficiency cores. This is problematic for me since I need to use the performace cores only. Using the performance and efficiency cores at the same time causes the performance cores to run at the same speed as the efficiency cores (which is very slow). Is there some way to detect the number of performance cores at runtime?
Posted
by atanasK.
Last updated
.
Post not yet marked as solved
1 Replies
790 Views
Hello, So I have been coding in React Native. I decided download the app to my phone. So after some configuration I had the IOS code and decided to open it in the XCode and use it on my iPhone to make sure there is no error or bugs. When I open up my project in Xcode I get an error saying Executable not found and it give me a path like this. /Users/{user}/Library/Developer/Xcode/DerivedData/instagramclone-dryvgcjhtprxzfaqclglbqtiuwvr/Build/Products/Debug-iphonesimulator/instagram.app So I check the path and instagram.app is there. So the file exists however, the app has this cross logo on it and when I double click it gives me an error saying "You can't open the application "instagram" because it may be damaged or incomplete. This is how the file looks like. I don't get it why it says's that. Just letting everyone know I am coding in Apple M1 because I know sometimes some things may not be supported in every chip or setup is different so I am using M1 (Apple Mac Mini) Thank you
Posted Last updated
.
Post not yet marked as solved
2 Replies
846 Views
On xcode 13, I have macos project that runs fine on intel machine. On apple silicon (M1 Plus) I get the error "A build only device cannot be used to run this target.", when I try to run from Xcode. This seems to be an ios error. All Google suggested fixes involve picking a new device which is an ios fix. Right? Bulids fine and Archive app runs fine. I get the error for both intel and Arm64 architectures. I tried building for Target deployment target device families and Deployment as: macos 12.0 sdk any suggestions?
Posted
by jhjames3.
Last updated
.
Post not yet marked as solved
3 Replies
362 Views
I'm facing a weird situation. Everytime a try to dlopen my library the application totally freezes. Does anyone have faced the same issue or have some suggestion?
Posted
by lmbelo.
Last updated
.
Post not yet marked as solved
0 Replies
297 Views
Hello, is there something to do for developers for the M1 Ultra chip to use all GPU cores? When you output the power used, you may see that with heavy load, the GPU may not use full 120 W of power and it looks like some GPU cores may be idle. Is some entitlement needed, something for configuration? Or how can you get maximum performance there? Greetings Christian
Posted Last updated
.
Post not yet marked as solved
1 Replies
271 Views
Hi all, so, in my app Transloader, when the app is terminated, I sync the Mac's "turned off" status to iCloud. This works on Intel Macs and on Apple silicon Macs when the user manually quits the app. However, on Apple silicon Macs, when the user shuts down or restarts the Mac and the app is terminated that way, the app is terminated right away (doesn't even receive the -applicationWillTerminate: call), so I'm unable to properly sync the status. This still works on Intel Macs, as far as I know. So, is there any new API to extend the Mac's shutdown a little longer to finish my sync? Currently, I use -applicationShouldTerminate:, returning NSTerminateLater, and after syncing, calling -replyToApplicationShouldTerminate:YES . Again, this works fine on Intel Macs if the user manually quits, as well as if the Intel Mac shuts down, but on Apple silicon, it only works if the user manually quits - a shutdown results in the app being terminated without even receiving a -applicationWillTerminate: call. Both NSSupportsSuddenTermination and NSSupportsAutomaticTermination are disabled in the app's Info.plist. Thank you for any insights, Matt
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
I'm now running Tensorflow models on my Macbook Air 2020 M1, but I can't find a way to monitor the Neural Engine 16 cores usage to fine tune my ML tasks. The Activity Monitor only reports CPU% and GPU% and I can't find any APIs available on Mach include files in the MacOSX 11.1 sdk or documentation available so I can slap something together from scratch in C. Could anyone point me in some direction as to get a hold of the API for Neural Engine usage. Any indicator I could grab would be a start. It looks like this has been omitted from all sdk documentation and general userland, I've only found a ledger_tag_neural_footprint attribute, which looks memory related, and that's it.
Posted
by rgolive.
Last updated
.
Post not yet marked as solved
1 Replies
422 Views
When i compile the c program with mysql i get the next error: ld: library not found for -lzstd clang: error: linker command failed with exit code 1 (use -v to see invocation) So i use the zstd (that i installed) directory link in my command line gcc parking.o -o parking.exe `mysql_config --libs` -L/opt/homebrew/Cellar/zstd/1.5.2/lib It creates the .exe but when i launch it i get How can i solve it ? Need help please.
Posted
by flo99.
Last updated
.
Post not yet marked as solved
6 Replies
14k Views
I just got my new MacBook Pro with M1 Max chip and am setting up Python. I've tried several combinational settings to test speed - now I'm quite confused. First put my questions here: Why python run natively on M1 Max is greatly (~100%) slower than on my old MacBook Pro 2016 with Intel i5? On M1 Max, why there isn't significant speed difference between native run (by miniforge) and run via Rosetta (by anaconda) - which is supposed to be slower ~20%? On M1 Max and native run, why there isn't significant speed difference between conda installed Numpy and TensorFlow installed Numpy - which is supposed to be faster? On M1 Max, why run in PyCharm IDE is constantly slower ~20% than run from terminal, which doesn't happen on my old Intel Mac. Evidence supporting my questions is as follows: Here are the settings I've tried: 1. Python installed by Miniforge-arm64, so that python is natively run on M1 Max Chip. (Check from Activity Monitor, Kind of python process is Apple). Anaconda.: Then python is run via Rosseta. (Check from Activity Monitor, Kind of python process is Intel). 2. Numpy installed by conda install numpy: numpy from original conda-forge channel, or pre-installed with anaconda. Apple-TensorFlow: with python installed by miniforge, I directly install tensorflow, and numpy will also be installed. It's said that, numpy installed in this way is optimized for Apple M1 and will be faster. Here is the installation commands: conda install -c apple tensorflow-deps python -m pip install tensorflow-macos python -m pip install tensorflow-metal 3. Run from Terminal. PyCharm (Apple Silicon version). Here is the test code: import time import numpy as np np.random.seed(42) a = np.random.uniform(size=(300, 300)) runtimes = 10 timecosts = [] for _ in range(runtimes): s_time = time.time() for i in range(100): a += 1 np.linalg.svd(a) timecosts.append(time.time() - s_time) print(f'mean of {runtimes} runs: {np.mean(timecosts):.5f}s') and here are the results: +-----------------------------------+-----------------------+--------------------+ | Python installed by (run on)→ | Miniforge (native M1) | Anaconda (Rosseta) | +----------------------+------------+------------+----------+----------+---------+ | Numpy installed by ↓ | Run from → | Terminal | PyCharm | Terminal | PyCharm | +----------------------+------------+------------+----------+----------+---------+ | Apple Tensorflow | 4.19151 | 4.86248 | / | / | +-----------------------------------+------------+----------+----------+---------+ | conda install numpy | 4.29386 | 4.98370 | 4.10029 | 4.99271 | +-----------------------------------+------------+----------+----------+---------+ This is quite slow. For comparison, run the same code on my old MacBook Pro 2016 with i5 chip - it costs 2.39917s. another post reports that run with M1 chip (not Pro or Max), miniforge+conda_installed_numpy is 2.53214s, and miniforge+apple_tensorflow_numpy is 1.00613s. you may also try on it your own. Here is the CPU information details: My old i5: $ sysctl -a | grep -e brand_string -e cpu.core_count machdep.cpu.brand_string: Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz machdep.cpu.core_count: 2 My new M1 Max: % sysctl -a | grep -e brand_string -e cpu.core_count machdep.cpu.brand_string: Apple M1 Max machdep.cpu.core_count: 10 I follow instructions strictly from tutorials - but why would all these happen? Is it because of my installation flaws, or because of M1 Max chip? Since my work relies heavily on local runs, local speed is very important to me. Any suggestions to possible solution, or any data points on your own device would be greatly appreciated :)
Posted Last updated
.