Bereiche
News
Rewind
Tipps & Berichte
Forum
Galerie
Journals
Events
Umfragen
Themenwoche
Kleinanzeigen
Interaktiv
Anmelden
Registrierung
Zu allen empfangenen Nachrichten
Suche...
Zur erweiterten Suche
Push-Nachrichten von MacTechNews.de
Würden Sie gerne aktuelle Nachrichten aus der Apple-Welt direkt über Push-Nachrichten erhalten?
Forum
>
Software
>
FORTRAN: Kann man auf M1 executables für Intels erzeugen?
FORTRAN: Kann man auf M1 executables für Intels erzeugen?
virk
05.05.23
08:26
Ich "nutze" gfortran 12.1 auf dem M1 alle Jubeljahre mal, um bestehende Software moderat anzupassen. Damit das Programm allen zur Verfügung steht, kompiliere ich den Quellcode auch auf einem Intel-Mac, um für diese auch ein executable zu haben.
Frage: Könnte ich auch ein executable für Intel auf einem M1 erzeugen oder so etwas wie ein universal binary?
„Gaststättenbetrieb sucht für Restaurant und Biergarten Servierer:innen und außen.“
Hilfreich?
0
Kommentare
MrChad
05.05.23
08:42
Möglicherweise. Du müsstest dem Linker erzählen, dass er Universal Code produzieren soll.
Ich weiß nicht, wie aktuell dein Compiler ist. Moderne Entwicklungsumgebungen würden das für dich wohl mit erledigen. Siehe z.B.
https://github.com/fortran-lang/vscode-fortran-support
(aus dem Bauch heraus, ohne konkrete Erfahrung)
Hilfreich?
0
Bodo_von_Greif
05.05.23
08:44
Hi,
hab spasseshalber mal fastgpt gefragt:
ist it possible to generate intel code with gfortran for macos m1?
It is currently not possible to generate Intel code with gfortran for macOS M1.
The reasons are:
1. gfortran is a open source Fortran compiler that generates code for x86_64 and AArch64 architectures. It does not have a target for Apple Silicon (M1) processors.
2. The M1 chip uses the ARM architecture and a different instruction set than Intel x86_64 processors. Code generated for x86_64 will not run on M1 without translation.
3. Apple does not currently provide a Fortran compiler that generates native M1 code. They recommend using the Clang compiler for C and C++ which can generate native M1 binaries.
4. Porting the gfortran compiler to also support M1 generation would be a major effort and there are no announced plans to do so.
Some options and workarounds for using Fortran on M1 Macs include:
1. Use the Clang compiler to generate C interfaces and call Fortran code from C. This requires recompiling the Fortran code as a C library.
2. Use a compiler that supports M1 and AArch64 like the Clang compiler to generate Fortran M1 binaries. This requires a port of the Fortran language and standard library to M1. No such port exists yet.
3. Run the Fortran code through a translator tool that can convert x86_64 to AArch64 code. Some options for this exist but may not generate optimal M1 code.
4. Use a compiler-as-a-service approach and compile the code on an Intel Mac or Linux system for M1 deployment. This requires access to another platform.
In summary, while it is an active area of development, generating Intel (x86_64) Fortran code for Apple Silicon (M1) Macs is not possible with today's tools and compilers. Let me know if you have any other questions!
„[x] nail here for new monitor“
Hilfreich?
-3
void
05.05.23
08:53
Bodo_von_Greif
1. gfortran is a open source Fortran compiler that generates code for x86_64 and AArch64 architectures. It does not have a target for Apple Silicon (M1) processors.
Deshalb sollte man nicht alles glauben, was ein statistisch gesehen gültiger Satz ist.
M1 = arm64 = AArch64
Also am instruction set scheitert es schonmal nicht, das heißt aber nicht, dass es nicht andere Hürden gibt.
„Developer of the Day 11. Februar 2013“
Hilfreich?
+5
gfhfkgfhfk
05.05.23
09:37
virk
Frage: Könnte ich auch ein executable für Intel auf einem M1 erzeugen oder so etwas wie ein universal binary?
Das komplette GCC Paket (so auch die GNU binutils) erlaubt es Crosscompiler zu bauen, und somit Binaries für System A auf System B zu bauen. A und B müssen von GCC unterstützte Plattformen sein. In der Regel wirst Du den Crosscompiler selbst bauen müssen, da Apple nur die eigene Toolchain pflegt.
Hilfreich?
+2
Bodo_von_Greif
05.05.23
09:56
Das sagt stable picuna dazu:
Yes, it is possible to generate Intel code with Gfortran for macOS M1. The only potential issue you might face is that you need a newer version of Gfortran than the one that comes pre-installed with macOS M1. So you may need to manually install a supported version from a third-party repository. Alternatively, you can also use a cross-compilation toolchain like Mapple or Clang that is specifically designed to work on M1 devices.
That being said, keep in mind that generating non-optimized and uncompiled code can potentially be much slower than just using a pre-compiled library. So it’s advised to only use this method if you really need the flexibility or if the performance gain from not compiling is significant.
„[x] nail here for new monitor“
Hilfreich?
-4
pünktchen
05.05.23
10:34
Also für mich als Laien klingt das nach komplettem Bullshit?
Was soll eigentlich "stable picuna" sein, hast du dir das gerade selbst ausgedacht? Variante von "stable genius"?
Hilfreich?
+1
Peter Eckel
05.05.23
11:37
Und an diesem Thread sieht man sehr schön, wohin der AI-Hype führen kann.
Anstatt mit eigener Experise antworten die Leute mit irgendwelchem Scheiß, den irgendeine AI ausgespuckt hat. Das ist genau der Sinn einer Frage an ein Forum, daß man mit ungeprüftem Bullshit aus irgendwelchen Bullshit-AIs zugeschmissen wird.
„Ceterum censeo librum facierum esse delendum.“
Hilfreich?
+11
Kommentieren
Diese Diskussion ist bereits mehr als 3 Monate alt und kann daher nicht mehr kommentiert werden.
iOS 26, macOS 26: Beta 2 ist da – die ersten Up...
„Siri-Vaporware“: Gruber und andere Blogger tei...
iOS 26, macOS 26: Beta 3 erschienen (Aktualisie...
Umfrage: Was passiert mit alten iPhones?
Auf dem Weg zum A20-Chip – in neuartigem, forts...
Vor dem Mac: Apple Lisa im Browser erleben
Liquid Glass im Detail
iPadOS 26: Neue Features für Apples Tablets