Skip to content

Commit

Permalink
Fix setup.py to respect numpy's parsing of libraries in site.cfg
Browse files Browse the repository at this point in the history
numpy parses libraries in site.cfg by splitting on comma. We want to
maintain compatibility with that, but we've already established
os.pathname by accident. To minimize breakages, we support both.
  • Loading branch information
de11n authored and Elliot Cameron committed Jul 28, 2023
1 parent 4b2d89c commit c2dd659
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ def parse_site_cfg():
site['mkl']['include_dirs'].split(os.pathsep))
lib_dirs.extend(
site['mkl']['library_dirs'].split(os.pathsep))
# numpy's site.cfg splits libraries by comma, but numexpr historically split by os.pathsep.
# For compatibility, we split by both.
libs.extend(
site['mkl']['libraries'].split(os.pathsep))
site['mkl']['libraries'].replace(os.pathsep, ',').split(','))
def_macros.append(('USE_VML', None))
print(f'FOUND MKL IMPORT')

Expand Down

0 comments on commit c2dd659

Please sign in to comment.