Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Makefiles #133

Merged
merged 5 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 8 additions & 35 deletions .github/workflows/Latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,17 @@ on:

jobs:
LatexDocs:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- if: matrix.os == 'ubuntu-latest'
name: install imagemagick and poppler-utils
- name: install imagemagick, poppler-utils and texlive
run: |
sudo apt-get install imagemagick
sudo apt-get install poppler-utils
- if: matrix.os == 'macos-latest'
run: |
pip3 install Pygments
- name: install texlive
run: |
wget --no-check-certificate https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
zcat < install-tl-unx.tar.gz | tar xf -
rm install-tl-unx.tar.gz
cd install-tl-*
sudo perl ./install-tl --no-interaction
cd ..
- name: add texlive to path
if: matrix.os == 'ubuntu-latest'
run: |
echo "/usr/local/texlive/2024/bin/x86_64-linux" >> $GITHUB_PATH
- name: add texlive to path
if: matrix.os == 'macos-latest'
run: |
echo "/usr/local/texlive/2024/bin/universal-darwin" >> $GITHUB_PATH
sudo apt-get install imagemagick
sudo apt-get install poppler-utils
sudo apt-get install texlive-xetex
sudo apt-get install texlive-science
- name: Make images
if: matrix.os == 'ubuntu-latest'
run: |
make linux -C docs/src/tikz
- name: Make images
if: matrix.os == 'macos-latest'
run: |
make mac -C docs/src/tikz
run: make latex -C docs/src/tikz
- uses: julia-actions/setup-julia@latest
with:
version: '1'
Expand All @@ -63,7 +36,7 @@ jobs:
- name: Upload PDF file
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
name: Docs in PDF version
path: docs/build/GeometricMachineLearning.jl.pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 9 additions & 12 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@

all: html

latex_mac: images_mac install_brenier_two_fluid test_docs latex_docs remove_brenier_two_fluid
latex: latex_no_pdf compile_tex

latex_linux: images_linux install_brenier_two_fluid test_docs latex_docs remove_brenier_two_fluid

latex_linux_no_pdf: images_linux install_brenier_two_fluid test_docs latex_docs_no_pdf remove_brenier_two_fluid

latex_mac_no_pdf: images_mac install_brenier_two_fluid test_docs latex_docs_no_pdf remove_brenier_two_fluid
latex_no_pdf: latex_images install_brenier_two_fluid test_docs latex_docs_no_pdf remove_brenier_two_fluid

html: html_images install_brenier_two_fluid test_docs documenter remove_brenier_two_fluid

Expand Down Expand Up @@ -40,11 +36,8 @@ documenter:
html_images:
$(MAKE) all -C src/tikz

images_mac:
$(MAKE) mac -C src/tikz

images_linux:
$(MAKE) linux -C src/tikz
latex_images:
$(MAKE) latex -C src/tikz

clean:
$(MAKE) empty -C src/tikz ;
Expand All @@ -54,4 +47,8 @@ latex_docs:
julia --color=yes --project=. --threads=8 make.jl latex_output

latex_docs_no_pdf:
julia --color=yes --project=. --threads=8 make.jl latex_output_no_pdf
julia --color=yes --project=. --threads=8 make.jl latex_output_no_pdf

compile_tex:
cd build; \
xelatex -shell-escape G*.tex
19 changes: 4 additions & 15 deletions docs/src/tikz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ all: pdf
$(MAKE) logo
$(MAKE) clean

linux: pdf
$(MAKE) convert_with_pdftocairo
$(MAKE) logo
$(MAKE) clean

mac: pdf
$(MAKE) convert_with_sips
latex: pdf
$(MAKE) convert_with_pdftocairo res=500
$(MAKE) logo
$(MAKE) clean

Expand All @@ -20,16 +15,10 @@ pdf: $(MYDIR)/*.tex
xelatex -shell-escape $${file} ; \
done

# this is converting pdfs to pngs using sips (mac version)
convert_with_sips: $(MYDIR)/*.pdf
for file in $^ ; do \
sips --setProperty format png --resampleHeightWidthMax 2000 $${file} --out $${file%.*}.png ; \
done

# this is converting pdfs to pngs using pdftocairo (linux version)
# this is converting pdfs to pngs using pdftocairo (with a fixed resolution for all images)
convert_with_pdftocairo: $(MYDIR)/*.pdf
for file in $^ ; do \
pdftocairo -png -r 500 -transp -singlefile $${file} $${file%.*} ; \
pdftocairo -png -r $(res) -transp -singlefile $${file} $${file%.*} ; \
done

png:
Expand Down
Loading