Why can I run x86 binary on ARM? [closed] - macos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I recently compiled a C program I wrote with gcc on my x86 intel MacBook - I downloaded this binary onto my M1 MacBook and it seems to run fine... This challenges my understanding because I figured it had to be complied for a specific instruction set (x86 in this case).. I wonder if there is some software layer in my MacBook automatically 'assembling' the x86 into ARM
Any ideas?

MacOS contains Rosetta 2 software that does dynamic binary translation from x86, so that x86 software can be run on the M1 CPU. Not quite as efficient as code compiled directly from C to AArch64 machine code, but it works.
You can read more here:
https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment
Stack Overflow has a tag for it: rosetta-2.
There's also a question on the Apple site: How does Rosetta 2 work? where answers point out that the translation is done once and cached, so it can spend significant time optimizing the translation. (For non-JITed x86 code.)

Apple decided to transition from Intel to arm processors, which is a big decision due to the number of applications developed for the intel architecture over the years.
The Arm and the Intel instruction set are different, and programs compiled for Intel's architecture cannot natively run on the Arm's architecture. The instruction sets are protected, and it is illegal for a company to copy the instruction set of a competitor.
Rosetta is the solution to this instruction set incompatibility problem. Rosetta is an instruction translation that transforms Intel instructions into arm instructions. The performance impact can be negligible due to the performances of the M1 chip but the long term solution is to recompile the x86_64 application to the M1 architecture. XCode has already released the toolchain for this.
If you want to dig into the subject I recommend this article about the difference between the Intel and Arm architecture.

Related

Replacement for (mkl) pardiso for arm64 (Apple Silicon) [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed yesterday.
Improve this question
For an academic numerical project we use as direct solvers mostly pardiso (from mkl) and cholmod. Now I switch to Apple Silicon (amazing fast, a quarter of the build time!) and cannot use Intel's mkl for native compiling any more.
For BLAS openblas runs fine
For positive definite systems cholmod
works fine
For non positive definite systems (where pardiso is great), I'm searching for a replacement
By 01.2022 there is no academic Pardiso available any more.
One could use Apple's Accelerate Framework instead of openBLAS. SuiteSparse finds it by default.
For non-positive definite systems, one can use umfpack from SuiteSparse. However it is (in my experience) slow compared to cholmod.

Difference between ARM and Intel? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
"Technically, however, they represent different philosophies: the ARM architecture is designed to be as simple as possible, to keep energy wastage to a minimum, whereas Intel's range uses a more complex design that benefits from compatibility with the company's (much more power-hungry) desktop and laptop CPUs." Well then why can't I run Windows on a raspberry Pi? Also, what is start4.elf?
Microsoft seems to know there are issues with Windows on ARM because it won't even sell you a copy of it. The company licenses the ARM version only to OEMs to pre-install on new systems. When asked if it would open up sales so people could run Windows on the new Macs, Microsoft said it had no plans at this time.
Start4.elf is a file that raspberry pi uses to boot.
Hope this helps!

What is the reason why virtual technology is not enabled in the bios of windows 7? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I recently had to enable VT for windows7 since I want to run ubuntu on vmware so I was wondering why isnt it enabled by default is it some kind of security issue or just not necessary for the average user?
There are several reasons, including "security" and "performance":
https://superuser.com/questions/291340/why-do-pc-manufacturers-disable-advanced-cpu-features-in-the-bios-by-default
http://www.vmware.com/pdf/asplos235_adams.pdf
Intel virtualization technology can get hardware intensive and although the software requirement is low (Windows Vista) only modern CPUs made by INTEL ONLY such as Intel i7 support it.
Not all windows computers have an Intel CPU though (a good amount of them do). The only people that use the VTX technology are developers and people who want to run a different operating system than their computer came with, so not everyone. As for security issue, I'm not sure but it can get very RAM intensive. (i.e. the Android HAXM for developers has a default RAM usage of 2GB, and the minimum is 512 MB!).
If you want to know more you can check out this article
or the website:
http://www.intel.com/content/www/us/en/virtualization/virtualization-technology/intel-virtualization-technology.html

Completely open sourced ARM board [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
I am learning to customize the Linux kernel to make it portable on embedded systems. To test my customized kernel , i want a completely open sourced ARM board. I investigated the Raspberry pi but some it's firmware (i.e. "start.elf") is not open source. Can anybody name an ARM board which is completely open source?
Also are there any such board whose ROM/AVRAM contents can also be replaced?
Thank you !
If by "completely open source" you mean open source bootloader, kernel and OS (correct me if I'm wrong), then I would recommend one of Beagle family boards -- they are inexpensive, user friendly and have a good community support. Their open source stack consists of U-Boot, Linux kernel and one of few available distributions. If you need advanced features, check out EVM's by Texas Instrument, but they cost much more.
Jetson-TK1 from nvidia, is a developer platform,
does have u-boot loader, Linux Kernel and rootfs,
The board layout is also shared, you can recompile things for you.
It comes with 2GB RAM, a 2.3GHz Quad core processor, with GPU that is ready for CUDA kind of high level programming
http://www.newegg.com/Product/Product.aspx?Item=N82E16813190005

which os supports which compilers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I'm working on a paper for school and I was wondering which compilers are supported by which operating systems.
I know Mac supports C and C++ (I know they're not that different but to me they are 2 different languages)
I was wondering which compilers/languages are supported by windows, which by Ubuntu and which by Mac.
Sorry for asking a straight question but i think there's people who know this straight away.
thanks
"Support" is a relative term here. At one extreme, I think if you have a computer with just about any version of Linux installed (Ubuntu is just one variety), if that version of the O/S isn't too stripped-down you will already have a compiler for C and C++ . If you just installed Windows, however (or got a new Windows computer from the factory), you almost certainly have no C or C++ compiler there and must obtain and install one. (There are various choices.) So Windows does not "support" C and C++ as well as Linux does, in that sense.
At the other extreme, just about any compilable language can be compiled on any of those three platforms ... if you are willing and able to write your own compiler.
In between those two extremes, you would have to ask whether someone anywhere has already written a compiler for that language on that platform, and whether you can obtain a copy of that compiler. Most of these are "third-party" software packages, so knowing which ones exist is partly a function of how well the compilers have been advertised. Even the Wikipedia page on this topic says its list may be incomplete. On the other hand, it's likely you have never heard of most of the languages that are listed there.
Wikipedia has a list of compilers and OS support here: https://en.wikipedia.org/wiki/List_of_compilers

Resources