Skip to content

Commit 912c207

Browse files
Add extra_link_args for pthreads
1 parent 82a4565 commit 912c207

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ def blosc_extension():
6060
info('setting up Blosc extension')
6161

6262
extra_compile_args = base_compile_args.copy()
63+
extra_link_args = []
6364
define_macros = []
6465

66+
# ensure pthread is properly linked on POSIX systems
67+
if os.name == 'posix':
68+
extra_compile_args.append('-pthread')
69+
extra_link_args.append('-pthread')
70+
6571
# setup blosc sources
6672
blosc_sources = [f for f in glob('c-blosc/blosc/*.c') if 'avx2' not in f and 'sse2' not in f]
6773
include_dirs = [os.path.join('c-blosc', 'blosc')]
@@ -125,6 +131,7 @@ def blosc_extension():
125131
include_dirs=include_dirs,
126132
define_macros=define_macros,
127133
extra_compile_args=extra_compile_args,
134+
extra_link_args=extra_link_args,
128135
extra_objects=extra_objects,
129136
),
130137
]

0 commit comments

Comments
 (0)