crosscompilierung
play

Crosscompilierung . . . ein Windows-Installer mit 4 Befehlen - PowerPoint PPT Presentation

Crosscompilierung . . . ein Windows-Installer mit 4 Befehlen Wolfgang Dautermann FH JOANNEUM Linuxwochen Linz 2016 Einfhrung in Crosscompiling 1 Andere Programmiersprachen 2 Installer fr Maxima 3 4 Paketieren mit CPack Ntzliche


  1. Crosscompilierung . . . ein Windows-Installer mit 4 Befehlen Wolfgang Dautermann FH JOANNEUM Linuxwochen Linz 2016

  2. Einführung in Crosscompiling 1 Andere Programmiersprachen 2 Installer für Maxima 3 4 Paketieren mit CPack Nützliche Tools 5

  3. Cross-Compiler Ein Cross-Compiler ist ein Compiler, der auf einer Plattform läuft, aber Compilate (Executables) für eine andere Plattform erzeugt. helloworld.c cc helloworld.c helloworld.exe HOST (z.B. Linux) TARGET (z.B. Windows)

  4. Cross-Compiler Dabei können sich sowohl am Build-Rechner als auch auf der Zielplattform alle Komponenten unterscheiden: Betriebssystem CPU-Typ 32/64 Bit CPU (auch 16 oder 8 Bit) Die Target-Plattform muss nicht mal real existieren!

  5. Einsatzzwecke - Embedded Systeme Speicher/CPU-Ressourcen reichen für Compiler/Toolchain nicht aus Ein komfortable Entwicklungsumgebung läuft auf anderer Plattform Zeitersparnis: anderer Rechner hat mehr Ressourcen und kann schneller compilieren.

  6. Einsatzzwecke Gewohnte Entwicklungsumgebung läuft nicht auf anderen Plattformen Build-Umgebung soll einheitlich sein Target-Plattform nicht verfügbar Softwarelizenz (Betriebssystem und/oder Entwicklungstools) nicht vorhanden (Noch) kein Compiler auf der Targetplattform verfügbar Kontinuierliche Integration – aktueller Softwarestand wird automatisch für diverse Plattformen compiliert, um Probleme früh zu erkennen.

  7. Hello world unter Linux compilieren hoffentlich bekannt... Compilieren von helloworld.c ✩ ❣❝❝ ✲❲❛❧❧ ✲♦ ❤❡❧❧♦✇♦r❧❞ ❤❡❧❧♦✇♦r❧❞✳❝ ✩ ❢✐❧❡ ❤❡❧❧♦✇♦r❞ ❤❡❧❧♦✇♦r❧❞✿ ❊▲❋ ✻✹✲❜✐t ▲❙❇ ❡①❡❝✉t❛❜❧❡✱ ①✽✻✲✻✹✱ ❬✳✳✳❪

  8. Hello world unter Linux für Windows compilieren Cross-Compiler ist installiert unter ✴✉sr✴❜✐♥✴✐✻✽✻✲✇✻✹✲♠✐♥❣✇✸✷✲❣❝❝ . Einfach den speziellen Compiler installieren und damit compilieren: Compilieren von helloworld.c ✩ ❛♣t✲❣❡t ✐♥st❛❧❧ ❣✰✰✲♠✐♥❣✇✲✇✻✹✲✐✻✽✻ ❬✳✳✳❪ ✩ ✐✻✽✻✲✇✻✹✲♠✐♥❣✇✸✷✲❣❝❝ ✲❲❛❧❧ ✲♦ ❤❡❧❧♦✇♦r❧❞✳❡①❡ ❤❡❧❧♦✇♦r❧❞✳❝ ✩ ❢✐❧❡ ❤❡❧❧♦✇♦r❞✳❡①❡ ❤❡❧❧♦✇♦r❧❞✳❡①❡✿ P❊✸✷ ❡①❡❝✉t❛❜❧❡ ✭❝♦♥s♦❧❡✮ ■♥t❡❧ ✽✵✸✽✻✱ ❢♦r ▼❙ ❲✐♥❞♦✇s erzeugt ein Windows-Executable.

  9. Programme unter Linux für Windows 64 Bit compilieren Compilieren von helloworld.c ✩ ❛♣t✲❣❡t ✐♥st❛❧❧ ❣✰✰✲♠✐♥❣✇✲✇✻✹✲①✽✻✲✻✹ ❬✳✳✳❪ ✩ ①✽✻❴✻✹✲✇✻✹✲♠✐♥❣✇✸✷✲❣❝❝ ✲❲❛❧❧ ✲♦ ❤❡❧❧♦✇♦r❧❞✳❡①❡ ❤❡❧❧♦✇♦r❧❞✳❝ ✩ ❢✐❧❡ ❤❡❧❧♦✇♦r❞✳❡①❡ ❤❡❧❧♦✇♦r❧❞✳❡①❡✿ P❊✸✷✰ ❡①❡❝✉t❛❜❧❡ ✭❝♦♥s♦❧❡✮ ①✽✻✲✻✹✱ ❢♦r ▼❙ ❲✐♥❞♦✇s erzeugt ein 64 Bit Windows-Executable.

  10. Umfangreichere Programme unter Linux für Windows compilieren Die notwendigen Bibliotheken (Libraries) müssen auch für die Zielplattform verfügbar sein 1 . Ansonsten kann ganz normal compiliert werden. Compilieren von helloworld-wx.cpp ✩ ✐✻✽✻✲✇✻✹✲♠✐♥❣✇✸✷✲❣❝❝ ✲❲❛❧❧ ✲♦ ❤❡❧❧♦✇♦r❧❞✲✇①✳❡①❡ ❤❡❧❧♦✇♦r❧❞✲✇①✳❝♣♣ ✩✭✴✉sr✴✐✻✽✻✲✇✻✹✲♠✐♥❣✇✸✷✴❜✐♥✴✇①✲❝♦♥❢✐❣ ✲✲❧✐❜s ✲✲❝①①❢❧❛❣s✮ ✩ ❢✐❧❡ ❤❡❧❧♦✇♦r❧❞✲✇①✳❡①❡ ❤❡❧❧♦✇♦r❧❞✲s❞❧✳❡①❡✿ P❊✸✷ ❡①❡❝✉t❛❜❧❡ ❢♦r ▼❙ ❲✐♥❞♦✇s ✭●❯■✮ ■♥t❡❧ ✽✵✸✽✻ ✸✷✲❜✐t erzeugt ein Windows-Executable. 1 entweder selbst übersetzen oder fertig downloaden

  11. Andere Programmiersprachen Etliche (C, C++, ObjC, Fortran durch GCC unterstützt). Beispiel Go Targetangabe durch Umgebungsvariablen ❣♦ ❜✉✐❧❞ ❤❡❧❧♦✇♦r❧❞✳❣♦ ❬✳✳✳❪ ●❖❖❙❂✇✐♥❞♦✇s ❣♦ ❜✉✐❧❞ ❤❡❧❧♦✇♦r❧❞✳❣♦ ❬✳✳✳❪ ●❖❖❙❂❧✐♥✉① ●❖❆❘❈❍❂❛r♠ ❣♦ ❜✉✐❧❞ ❤❡❧❧♦✇♦r❧❞✳❣♦

  12. Motiviation: Windows-Installer für Maxima leistungsfähiges Open Source CAS programmiert (überwiegend) in Lisp Entwickler arbeiten oft nicht unter Windows Windows-Installer kommen nur sporadisch Erstellung sehr aufwendig

  13. Installationsanweisungen für Windows-Installer External Requirements (passt grad noch auf die Folie) 1 MSYS+MinGW, including mktemp 2 msysDTK 3 GCL 4 Tcl/Tk (8.5 or later recommended) 5 Starkit, TclKit and img.kit 6 Vtk 7 InnoSetup 8 gnuplot 9 wxMaxima 10 Microsoft HTML Help Workshop 11 Perl 5.8 (ActivePerl) 12 Python

  14. s❡t✉♣✳❡①❡ ❛♣t✲❣❡t ✉♣❞❛t❡ ❀ ❛♣t✲❣❡t ✲❱ ✉♣❣r❛❞❡ Installationsanweisungen für Windows-Installer Die Installation der Pakete unter Windows... ❛♣t✲❣❡t ✐♥st❛❧❧ ▼❙❨❙ ▼✐♥●❲ ♠s②s❉❚❑ ●❈▲ t❝❧ t❦ ✳✳✳

  15. Abhängigkeiten Maxima Installationspaket Maxima wxMaxima Lisp TK Gnuplot (VTK) wxWidgets (jsMath T EX-Fonts) CLISP SBCL TCL

  16. Anforderungen für einen automatisierten Maxima-Installerbau Skriptbar ((hoffentlich) keine manuellen Tätigkeiten) ⇒ bevorzugt unter Linux/Unix Erweiterbar Automatische Downloads Einfache Updates Resultat: All-in-one Installer Möglichkeiten Shellskript Perl / Python / Ruby / ... -skript Makefiles (vgl. ❤tt♣✿✴✴♠①❡✳❝❝ ) Higher Level Buildsystem: scons, CMake

  17. Vereinfachungen Build-System (z.B. Linux) � = Zielsystem (z.B. Windows) Quellen: Downloads, Versionsverwaltungssysteme (SVN, GIT, CVS, ...) Fertig compilierte Archive Gnu Autoconf ( ✳✴❝♦♥❢✐❣✉r❡ ❀ ♠❛❦❡ ❀ ♠❛❦❡ ✐♥st❛❧❧ ), ... Patches CMake als Buildsystem Spezialfälle

  18. CMake - ❡①t❡r♥❛❧♣r♦❥❡❝t❴❛❞❞ Einbinden von externen Programmen: fertige Archive Beispiel: gnuplot: fertiges ZIP-File ★ ●♥✉♣❧♦t ✭❛❧r❡❛❞② ❛ ❜✐♥❛r② ♣❛❝❦❛❣❡ ❥✉st ❡①tr❛❝t ✐t✳✳✳✮ ❡①t❡r♥❛❧♣r♦❥❡❝t❴❛❞❞✭❣♥✉♣❧♦t ❯❘▲ ✧✩④●◆❯P▲❖❚❴❯❘▲⑥✧ ❉❖❲◆▲❖❆❉❴❉■❘ ✩④❈▼❆❑❊❴❙❖❯❘❈❊❴❉■❘⑥✴❞♦✇♥❧♦❛❞s ❯❘▲❴▼❉✺ ✩④●◆❯P▲❖❚❴▼❉✺⑥ ❈❖◆❋■●❯❘❊❴❈❖▼▼❆◆❉ ✧✧ ❇❯■▲❉❴❈❖▼▼❆◆❉ ✧✧ ■◆❙❚❆▲▲❴❈❖▼▼❆◆❉ ✧✧ ✮ ✐♥st❛❧❧✭❉■❘❊❈❚❖❘❨ ✩④❈▼❆❑❊❴❇■◆❆❘❨❴❉■❘⑥✴❣♥✉♣❧♦t✲♣r❡❢✐①✴sr❝✴❣♥✉♣❧♦t✴ ❉❊❙❚■◆❆❚■❖◆ ❣♥✉♣❧♦t✮

  19. CMake - ❡①t❡r♥❛❧♣r♦❥❡❝t❴❛❞❞ Einbinden von externen Programmen: ✳✴❝♦♥❢✐❣✉r❡ ❀ ♠❛❦❡ ❀ ♠❛❦❡ ✐♥st❛❧❧ Beispiel: Compilieren von TCL ❡①t❡r♥❛❧♣r♦❥❡❝t❴❛❞❞✭t❝❧ ❯❘▲ ✧✩④❚❈▲❴❯❘▲⑥✧ ❉❖❲◆▲❖❆❉❴❉■❘ ✩④❈▼❆❑❊❴❙❖❯❘❈❊❴❉■❘⑥✴❞♦✇♥❧♦❛❞s ❯❘▲❴▼❉✺ ✩④❚❈▲❴▼❉✺⑥ ❈❖◆❋■●❯❘❊❴❈❖▼▼❆◆❉ ✩④❈▼❆❑❊❴❇■◆❆❘❨❴❉■❘⑥✴t❝❧✲♣r❡❢✐①✴sr❝✴t❝❧✴✇✐♥✴❝♦♥❢✐❣✉r❡ ✲✲❤♦st❂✩④❍❖❙❚⑥ ✲✲♣r❡❢✐①❂❈✿✴♠❛①✐♠❛✲✩④▼❆❳■▼❆❱❊❘❙■❖◆⑥ ❇❯■▲❉❴❈❖▼▼❆◆❉ ✩✭▼❆❑❊✮ ■◆❙❚❆▲▲❴❈❖▼▼❆◆❉ ✩✭▼❆❑❊✮ ✐♥st❛❧❧ ✮ ✐♥st❛❧❧✭❉■❘❊❈❚❖❘❨ ✩④❈▼❆❑❊❴❇■◆❆❘❨❴❉■❘⑥✴t❝❧✲♣r❡❢✐①✴sr❝✴t❝❧✲❜✉✐❧❞✴❈✿✴♠❛①✐♠❛✲✩④▼❆❳■▼❆❱❊❘❙■❖◆⑥✴ ❉❊❙❚■◆❆❚■❖◆ ✳✮

  20. CMake - ❡①t❡r♥❛❧♣r♦❥❡❝t❴❛❞❞ Spezialfälle: ❈r♦ss❝♦♠♣✐❧✐❡r❡♥ ✈♦♥ ▲✐s♣ ✕ ▼❛①✐♠❛ Verwendung von Wine ✩ ❝❛t ✇✐♥❡✲❝❧✐s♣✳s❤✳t♠♣❧ ★✦✴❜✐♥✴s❤ ✇✐♥❡ ❅❈▲■❙P❘❖❖❚❅✴❝❧✐s♣✳❡①❡ ✧✩❅✧ s❡t✭❈▲■❙P❘❖❖❚ ✧✩④❈▼❆❑❊❴❇■◆❆❘❨❴❉■❘⑥✴❝❧✐s♣✲♣r❡❢✐①✴sr❝✴❝❧✐s♣✧✮ ❝♦♥❢✐❣✉r❡❴❢✐❧❡✭✧✩④❈▼❆❑❊❴❙❖❯❘❈❊❴❉■❘⑥✴✇✐♥❡✲❝❧✐s♣✳s❤✳t♠♣❧✧ ✧✩④❈▼❆❑❊❴❇■◆❆❘❨❴❉■❘⑥✴✇✐♥❡✲❝❧✐s♣✳s❤✧✮ ❝♦♥❢✐❣✉r❡❴❢✐❧❡✭✧✩④❈▼❆❑❊❴❙❖❯❘❈❊❴❉■❘⑥✴✇✐♥❡✲❧✐s♣✳s❤✳t♠♣❧✧ ✧✩④❈▼❆❑❊❴❇■◆❆❘❨❴❉■❘⑥✴✇✐♥❡✲❧✐s♣✳s❤✧✮

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend