Skip to content

Commit

Permalink
conda package for Mac done
Browse files Browse the repository at this point in the history
  • Loading branch information
yumengch committed Jan 25, 2024
1 parent c887982 commit f1bfe71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ requirements:
- numpy
- mpi4py
- {{ mpi }}
- mkl-static
- mkl-static # [x86]
- blas-devel # [not x86]
- liblapack # [not x86]
build:
- make # [not win]
- {{ compiler('c') }}
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
else:
print ('....using GNU compiler....')

condaBuild = dist.get_option_dict('pyPDAF')['condaBuild'][1]

extra_compile_args=[]
extra_link_args = []
extra_objects = []
Expand Down Expand Up @@ -110,7 +112,6 @@
# linking BLAS/LAPACK
use_MKL=dist.get_option_dict('pyPDAF')['use_MKL'][1]
if use_MKL == 'True':
condaBuild = dist.get_option_dict('pyPDAF')['condaBuild'][1]
if condaBuild == 'True':
MKLROOT = os.environ['LIBRARY_LIB'] if os.name == 'nt' else \
os.path.join(os.environ['PREFIX'], 'lib')
Expand All @@ -137,7 +138,8 @@
# add fortran library to the linking
if os.name != 'nt':
suffix = 'dylib' if sys.platform == 'darwin' else 'so'
result = subprocess.run(['gfortran', '--print-file',
FC = os.environ['FC'] if condaBuild == 'True' else 'gfortran'
result = subprocess.run([FC, '--print-file',
'libgfortran.'+suffix], stdout=subprocess.PIPE)
result = result.stdout.decode()
result = result[:-18] if sys.platform == 'darwin' else result[:-15]
Expand Down
4 changes: 2 additions & 2 deletions setup_mac.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ LD = mpif90
AR = ar
RANLIB = ranlib
CPP = /usr/bin/cpp
OPT = -O3 -fdefault-real-8 -fPIC
OPT = -O3 -fdefault-real-8 -fPIC -mmacosx-version-min=10.6
OPT_LNK =
INC = -IPDAF_V2.1/include
LINK_LIBS = -llapack -lblas
LINK_LIBS = -llapack -lblas
CPP_DEFS = -DUSE_PDAF

[pyPDAF]
Expand Down

0 comments on commit f1bfe71

Please sign in to comment.