Skip to content

Commit 57426e1

Browse files
committed
BLD: Close pandas-dev#10510, add CFLAGS -fgnu89-inline on FreeBSD 10+
1 parent 0c8a8e1 commit 57426e1

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

doc/source/whatsnew/v0.17.1.txt

+4
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ Bug Fixes
115115
- Fixed a bug that prevented the construction of an empty series of dtype
116116
``datetime64[ns, tz]`` (:issue:`11245`).
117117
- Bug in ``DataFrame.to_dict()`` produces a ``np.datetime64`` object instead of ``Timestamp`` when only datetime is present in data (:issue:`11327`)
118+
119+
120+
121+
- Bug in the link-time error caused by C ``inline`` functions on FreeBSD 10+ (with ``clang``) (:issue:`10510`)

setup.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import shutil
1212
import warnings
1313
import re
14+
import platform
1415
from distutils.version import LooseVersion
1516

1617
# versioning
@@ -289,7 +290,10 @@ def run(self):
289290

290291

291292
class CheckingBuildExt(build_ext):
292-
"""Subclass build_ext to get clearer report if Cython is necessary."""
293+
"""
294+
Subclass build_ext to get clearer report if Cython is necessary.
295+
Also, add some platform based compiler flags.
296+
"""
293297

294298
def check_cython_extensions(self, extensions):
295299
for ext in extensions:
@@ -302,8 +306,27 @@ def check_cython_extensions(self, extensions):
302306

303307
def build_extensions(self):
304308
self.check_cython_extensions(self.extensions)
309+
self.add_gnu_inline_flag(self.extensions)
305310
build_ext.build_extensions(self)
306311

312+
def add_gnu_inline_flag(self, extensions):
313+
'''
314+
Add CFLAGS `-fgnu89-inline` for clang on FreeBSD 10+
315+
'''
316+
if not platform.system() == 'FreeBSD':
317+
return
318+
319+
try:
320+
bsd_release = float(platform.release().split('-')[0])
321+
except ValueError: # unknow freebsd version
322+
return
323+
324+
if bsd_release < 10: # 9 or earlier still using gcc42
325+
return
326+
327+
for ext in extensions:
328+
ext.extra_compile_args += ['-fgnu89-inline']
329+
307330

308331
class CythonCommand(build_ext):
309332
"""Custom distutils command subclassed from Cython.Distutils.build_ext

0 commit comments

Comments
 (0)