-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #399 from pep-dortmund/2024_Makeslides
2024 makeslides
- Loading branch information
Showing
11 changed files
with
326 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
\headlineframe{Is the cake a lie?} | ||
|
||
\begin{frame}[fragile]{Vergleich: Kuchen backen} | ||
\begin{center} | ||
\begin{minted}{make} | ||
Kuchen: Teig Backofen | ||
Ofen auf 140°C vorheizen | ||
Teig in Backform geben und in den Ofen schieben | ||
Kuchen nach 40 min herausnehmen | ||
|
||
Teig: Eier Mehl Zucker Milch Rumrosinen | Schüssel | ||
Eier schlagen | ||
Mehl, Zucker und Milch hinzugeben | ||
Rumrosinen unterrühren | ||
|
||
Rumrosinen: Rum Rosinen | ||
Rosinen in Rum einlegen | ||
Vier Wochen stehen lassen | ||
|
||
Schüssel: | ||
Rührschüssel auf den Tisch stellen, wenn nicht vorhanden | ||
|
||
clean: | ||
Kuchen essen | ||
Küche sauber machen und aufräumen | ||
\end{minted} | ||
\end{center} | ||
\end{frame} | ||
|
||
\begin{frame}[fragile]{Expert} | ||
Können mehrere unabhängige Auswertungen parallel ausgeführt werden? \\ | ||
→ Ja: \;\texttt{make -j4}\; (nutzt 4 Prozesse (\texttt{j}: jobs) gleichzeitig, Anzahl beliebig) | ||
|
||
Problem: Manchmal führt \texttt{make} Skripte gleichzeitig zweimal aus (hier \texttt{plot.py}) | ||
\begin{center} | ||
\begin{minted}{make} | ||
all: report.txt | ||
|
||
report.txt: plot1.pdf plot2.pdf | ||
touch report.txt | ||
|
||
plot1.pdf plot2.pdf: plot.py data.txt | ||
python plot.py # plot.py produziert sowohl plot1.pdf als auch plot2.pdf | ||
\end{minted} | ||
\end{center} | ||
|
||
Lösung: manuell synchronisieren | ||
\begin{center} | ||
$\vdots$ \\ | ||
\begin{minted}{make} | ||
plot1.pdf: plot.py data.txt | ||
python plot.py | ||
|
||
plot2.pdf: plot1.pdf | ||
\end{minted} | ||
\end{center} | ||
|
||
Wenn man \texttt{plot2.pdf} aber nicht \texttt{plot1.pdf} löscht, kann \texttt{make} nicht mehr \texttt{plot2.pdf} erstellen. | ||
\end{frame} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
\headlineframe{Projekte \enquote{sauber} halten} | ||
|
||
\begin{frame}[fragile]{\texttt{make clean}} | ||
(Nützliche) Konvention: \texttt{make clean} löscht alle vom \texttt{Makefile} erstellten Dateien/Ordner. | ||
|
||
\begin{center} | ||
\begin{minted}{make} | ||
clean: | ||
rm plot.pdf report.pdf | ||
\end{minted} | ||
\end{center} | ||
|
||
Das Projekt sollte dann so aussehen, wie vor dem ersten Ausführen von \texttt{make}. | ||
\end{frame} | ||
|
||
\begin{frame}[fragile]{\texttt{build}-Ordner} | ||
\texttt{build}-Ordner: Projekt sauber halten | ||
|
||
\begin{center} | ||
\begin{minted}{make} | ||
all: build/report.pdf | ||
|
||
build/plot.pdf: plot.py data.txt | build | ||
python plot.py # savefig('build/plot.pdf') | ||
|
||
build/report.pdf: report.tex build/plot.pdf | build | ||
lualatex --output-directory=build report.tex | ||
|
||
build: | ||
mkdir -p build | ||
|
||
clean: | ||
rm -rf build | ||
|
||
.PHONY: all clean | ||
\end{minted} | ||
\end{center} | ||
|
||
\begin{itemize} | ||
\item \texttt{| build} ist ein order-only Prerequisite: Alter wird ignoriert | ||
\item Targets, die bei \texttt{.PHONY} genannt werden, erzeugen keine Dateien (guter Stil). | ||
Bsp: \textbf{\texttt{clean}} löscht Dateien, wird versehentlich eine Datei clean erstellt, | ||
soll trotzdem \textbf{\texttt{clean}} ausgeführt werden. | ||
Nennung hier hebt die Verwirrung von \texttt{make} auf, beugt vor. | ||
\end{itemize} | ||
\end{frame} | ||
|
||
|
||
\begin{frame}[fragile]{\texttt{build}-Ordner} | ||
\LuaTeX\ und \texttt{biber} bieten Optionen an, um einen \texttt{build}-Ordner zu benutzen. | ||
\begin{block}{Aufrufe} | ||
\begin{minted}{text} | ||
lualatex --output-directory=build file.tex | ||
biber build/file.bcf | ||
\end{minted} | ||
\end{block} | ||
|
||
Um Dateien aus dem \texttt{build}-Ordner zu finden (Plots, Tabellen): | ||
\begin{block}{Aufrufe} | ||
\begin{minted}{text} | ||
TEXINPUTS=build: lualatex --output-directory=build file.tex | ||
biber build/file.bcf | ||
\end{minted} | ||
\end{block} | ||
\vspace*{-0.5em} | ||
\begin{itemize} | ||
\item \texttt{TEXINPUTS}, \texttt{BIBINPUTS}: Suchpfade für \TeX- und \texttt{.bib}-Dateien | ||
\item Elemente getrennt mit \texttt{:}, der erste Treffer wird genommen (wie \texttt{PATH}) | ||
\item Hilfreich um z.\,B.\ den Header nur einmal für alle Protokolle abzuspeichern. (Siehe latex-template) | ||
\item \texttt{TEXINPUTS} auch für \mintinline{latex}+\includegraphics+ | ||
\item \texttt{:} am Ende der Liste: Standardsuchpfade anhängen (wichtig!) | ||
\item \texttt{.} (der aktuelle Ordner) ist am Anfang der Standardliste, braucht man also nicht selbst angeben | ||
\item Endet ein Element mit \texttt{//}, werden auch alle Unterordner durchsucht | ||
\end{itemize} | ||
\end{frame} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
\begin{frame}{Funktionsweise} | ||
\begin{center} | ||
\begin{tikzpicture} | ||
\graph [ | ||
grow down, | ||
branch right sep, | ||
nodes={ | ||
node font=\ttfamily, | ||
}, | ||
] { | ||
"all" [x=3.5] -> "report.pdf" [x=3] -> { | ||
"report.tex", | ||
"plot.pdf" -> { | ||
"plot.py", "data.txt" | ||
}, | ||
"plot2.pdf" -> { | ||
"plot2.py", "data.txt", "data2.txt" | ||
}, | ||
}, | ||
}; | ||
\end{tikzpicture} | ||
\end{center} | ||
|
||
\begin{itemize} | ||
\item Abhängigkeiten bilden einen DAG (directed acyclic graph/gerichteter azyklischer Graph) | ||
\item Dateien werden neu erstellt, falls sie nicht existieren oder älter als ihre Prerequisites sind | ||
\item Prerequisites werden zuerst erstellt | ||
\item top-down Vorgehen | ||
\end{itemize} | ||
\end{frame} | ||
|
||
\begin{frame}[fragile]{Argumente für \texttt{make}} | ||
\begin{tblr}{ | ||
colspec = {l X[l]}, | ||
column{1} = {font=\ttfamily}, | ||
} | ||
make \textit{target} & statt des ersten in der \texttt{Makefile} genannten Targets (meist \texttt{all}) nur \texttt{target} erstellen \\ | ||
make -n & dry run: Befehle anzeigen aber nicht ausführen \\ | ||
make -B & Force: ausführen aller Schritte, ignorieren des Alters aller Dateien \\ | ||
make -p & Datenbank aller Abhängigkeiten ausgeben | ||
\end{tblr} | ||
\begin{itemize} | ||
\item Nützlich, wenn man einen Plot bearbeitet: \texttt{make plot.pdf} | ||
\end{itemize} | ||
\end{frame} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.