Skip to content

Commit

Permalink
add workflow for building conda package on Intel Mac
Browse files Browse the repository at this point in the history
remove build test on push; remove 3.8 Python support in conda due to numpy upgrade; add MKL linking option for Intel Mac;
  • Loading branch information
yumengch committed Feb 6, 2024
1 parent bb05fd8 commit d7394c9
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/condaBuildMac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: condaBuild
on: [workflow_dispatch]
jobs:
check_mac_installation:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
ref: intelMacConda

- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
auto-update-conda: true

- name: install pyPDAF
shell: bash -el {0}
run: |
conda install python anaconda-client conda-build conda-verify
anaconda login --username yumengch --password ${{ secrets.ANACONDA }}
conda config --set anaconda_upload yes
conda-build -c conda-forge -c intel conda.recipe/
2 changes: 1 addition & 1 deletion .github/workflows/test_build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_build
on: [push, workflow_dispatch]
on: [workflow_dispatch]
jobs:
check_mac_installation:
runs-on: macos-latest
Expand Down
4 changes: 2 additions & 2 deletions conda.recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
python:
- 3.8
- 3.8 # [not osx]
- 3.9
- 3.10
- 3.11

c_compiler:
- vs2022 # [win]
- vs2022 # [win]

mpi:
- mpich # [not win]
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,17 @@
if os.name == 'nt':
library_dirs+=[MKLROOT,]
libraries += ['mkl_core', 'mkl_sequential', 'mkl_intel_lp64']
else:
elif sys.platform == "linux" or sys.platform == "linux2":
extra_objects+=['-Wl,--start-group',
f'{MKLROOT}/libmkl_intel_lp64.a',
f'{MKLROOT}/libmkl_sequential.a',
f'{MKLROOT}/libmkl_core.a',
'-Wl,--end-group']
else:
extra_objects+=[
f'{MKLROOT}/libmkl_intel_lp64.a',
f'{MKLROOT}/libmkl_sequential.a',
f'{MKLROOT}/libmkl_core.a']
else:
# setup library to MPI-fortran
LAPACK_PATH=dist.get_option_dict('pyPDAF')['LAPACK_PATH'][1]
Expand Down
38 changes: 38 additions & 0 deletions setup_condaIntelMac.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[options]
include_package_data = True
install_requires =
Cython
mpi4py
numpy

[PDAF]
# PDAF source file directory
directory= PDAF_V2.1
# fortran compiler
FC = mpif90
# fortran linker
LD = mpif90
AR = ar
RANLIB = ranlib
CPP = cpp
OPT = -O3 -fdefault-real-8 -fPIC -mmacosx-version-min=10.6
OPT_LNK =
INC = -IPDAF_V2.1/include
LINK_LIBS =
CPP_DEFS = -DUSE_PDAF

[pyPDAF]
pwd = /Users/runner/work/pyPDAF/pyPDAF/
CC = mpicc
condaBuild = True
# if MKL is used, give the path to the static MKL library
use_MKL=True
MKLROOT=
# if dynamic/shared liblapack and libblas library is used,
# give the library path and flags
LAPACK_PATH=
LAPACK_Flag=lapack,blas
# GIVE MPI information
MPI_INC_PATH=
MPI_MOD_PATH=
MPI_LIB_PATH=

0 comments on commit d7394c9

Please sign in to comment.