Skip to content

Commit 9bf436f

Browse files
committed
move github action to macosx
1 parent 462035d commit 9bf436f

16 files changed

+93
-283
lines changed

.github/workflows/book.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,24 @@ on:
77

88
jobs:
99
deploy-book:
10-
runs-on: ubuntu-latest
10+
runs-on: macos-latest
1111
steps:
12-
- name: Install apt dependencies
13-
run: |
14-
sudo apt-get install -yq libfftw3-dev
12+
- name: Install brew dependencies
13+
run: brew install fftw openblas
1514

1615
- uses: actions/checkout@v2
1716

18-
- name: Install dependencies
19-
shell: bash -l {0}
20-
run: |
21-
conda env create -f environment.yml -n runenv
17+
- name: Install python dependencies
18+
run: pip3 install -r requirements.txt
2219

2320
- name: Install Julia packages
2421
run: julia -e '
2522
using Pkg; Pkg.add(["REPL", "PyCall"]);
26-
ENV["PYTHON"]="/usr/share/miniconda3/envs/runenv/bin/python";
23+
ENV["PYTHON"]="/usr/local/bin/python3";
2724
Pkg.build("PyCall")'
2825

29-
- name: Install jupyterbook and build the book
30-
shell: bash -l {0}
31-
run: |
32-
conda run -n runenv python -m ipykernel install --user --name python3
33-
conda run -n runenv jupyter-book build notebooks
26+
- name: Build the book
27+
run: jupyter-book build notebooks
3428

3529
- name: GitHub Pages action
3630
uses: peaceiris/[email protected]

.pythranrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[compiler]
2+
include_dirs=/usr/local/opt/openblas/include
3+
library_dirs=/usr/local/opt/openblas/lib
4+
blas=openblas
5+
CXX=g++-9
6+
CC=gcc-9

01.f2py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def fonction(i) : # python function
389389

390390
%env OMP_NUM_THREADS=4
391391
if sys.platform == "darwin":
392-
os.environ["CC"] = "gcc-10"
392+
os.environ["CC"] = "gcc-9"
393393
os.environ["FC"] = "gfortran"
394394

395395
# + {"slideshow": {"slide_type": "fragment"}}

03.julia-set.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import os, sys, gc
2929

3030
if sys.platform == 'darwin':
31-
os.environ['CC'] = 'gcc-10'
32-
os.environ['CXX'] = 'g++-10'
31+
os.environ['CC'] = 'gcc-9'
32+
os.environ['CXX'] = 'g++-9'
3333
# -
3434

3535
import warnings
@@ -166,8 +166,8 @@ def plot_julia_set(julia):
166166
# include_dirs=/usr/local/opt/openblas/include
167167
# library_dirs=/usr/local/opt/openblas/lib
168168
# blas=openblas
169-
# CXX=g++-10
170-
# CC=gcc-10
169+
# CXX=g++-9
170+
# CC=gcc-9
171171
# ```
172172

173173
%load_ext pythran.magic
@@ -477,6 +477,7 @@ def juliaset_numba(x, y, c, lim, maxit):
477477

478478
_ = %timeit -oq -n 1 f(x, y, c, lim, maxit)
479479
results['etime'] += [_.best]
480+
gc.collect()
480481

481482
results = pd.DataFrame(results, index=list(map(lambda f:f.__name__[9:],functions)))
482483
results["speed_up"] = [results.etime["numpy"]/t for t in results.etime]

04.vlasov-poisson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import sys
4545

4646
if sys.platform == "darwin":
47-
%env CC='gcc-10'
47+
%env CC='gcc-9'
4848
# -
4949

5050
# ## Bspline

05.co-rotating-vortex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import sys
3030

3131
if sys.platform == "darwin":
32-
%env CC=gcc-10
32+
%env CC=gcc-9
3333
# -
3434

3535
# %load_ext fortranmagic

06.gray-scott-model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import sys
2323
if sys.platform == "darwin":
24-
%env CC=gcc-10
24+
%env CC=gcc-9
2525

2626
import numpy as np
2727

08.swig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def syracuse(n):
237237
import sys, os
238238

239239
if sys.platform == "darwin":
240-
os.environ["CC"] = "gcc-10"
240+
os.environ["CC"] = "gcc-9"
241241

242242
!{sys.executable} setup.py build_ext --inplace --quiet
243243

environment.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,7 @@ name: python-fortran
22
channels:
33
- conda-forge
44
dependencies:
5-
- cython
6-
- fortran-magic
7-
- imageio
8-
- ipykernel
9-
- ipywidgets
10-
- jupyter
11-
- jupytext
12-
- matplotlib
13-
- numba
14-
- numpy
15-
- pandas
16-
- pillow
17-
- scipy
18-
- seaborn
19-
- setuptools
20-
- tqdm
5+
- python=3.8
216
- pip
227
- pip:
23-
- julia
24-
- jupyter-book
25-
- pythran
8+
- -r requirements.txt

notebooks/01.f2py.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@
871871
"\n",
872872
"%env OMP_NUM_THREADS=4\n",
873873
"if sys.platform == \"darwin\":\n",
874-
" os.environ[\"CC\"] = \"gcc-10\"\n",
874+
" os.environ[\"CC\"] = \"gcc-9\"\n",
875875
" os.environ[\"FC\"] = \"gfortran\""
876876
]
877877
},

0 commit comments

Comments
 (0)