Skip to content
Merged
Changes from 2 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
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ def run(self):
cmdclass = versioneer.get_cmdclass()
cmdclass['build_doc'] = build_doc

extra_link_args = []
install_name_tool_fixer = []
if sys.platform == 'darwin':
install_name_tool_fixer += ['-headerpad_max_install_names']
if platform.machine() == 'ppc64le':
extra_link_args += ['-pthread']

build_ext = cmdclass.get('build_ext', build_ext)

Expand Down Expand Up @@ -172,7 +175,8 @@ def get_ext_modules():
"numba/cext/dictobject.c",
"numba/cext/listobject.c",
],
extra_link_args=install_name_tool_fixer,
extra_link_args=install_name_tool_fixer +
extra_link_args,
Comment thread
esc marked this conversation as resolved.
Resolved
depends=["numba/_pymodule.h",
"numba/_helperlib.c",
"numba/_lapack.c",
Expand Down Expand Up @@ -278,6 +282,7 @@ def check_file_at_path(path2file):
depends=['numba/np/ufunc/workqueue.h'],
include_dirs=[os.path.join(tbb_root, 'include')],
extra_compile_args=cpp11flags,
extra_link_args=extra_link_args,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed for TBB pool but not OpenMP one? Am guessing the pthread_atfork call in TBB and no pthread.h API use in OpenMP (even though the header file is #included

#include <pthread.h>
probably from adding debug code during development, e.g. calls to pthread_self()).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the OpenMP extension does not appear to need the linker flags.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking. I suggest removing the unused header as well as the use of the link time flags.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the header in 5646137

libraries=['tbb'], # TODO: if --debug or -g, use 'tbb_debug'
library_dirs=[
# for Linux
Expand Down Expand Up @@ -319,7 +324,8 @@ def check_file_at_path(path2file):
name='numba.np.ufunc.workqueue',
sources=['numba/np/ufunc/workqueue.c',
'numba/np/ufunc/gufunc_scheduler.cpp'],
depends=['numba/np/ufunc/workqueue.h'])
depends=['numba/np/ufunc/workqueue.h'],
extra_link_args=extra_link_args)
ext_np_ufunc_backends.append(ext_np_ufunc_workqueue_backend)
Comment thread
esc marked this conversation as resolved.
Resolved

ext_mviewbuf = Extension(name='numba.mviewbuf',
Expand Down