diff --git a/doc/source/whatsnew/v1.3.0.rst b/doc/source/whatsnew/v1.3.0.rst index 74710ca48308c..441116376d52b 100644 --- a/doc/source/whatsnew/v1.3.0.rst +++ b/doc/source/whatsnew/v1.3.0.rst @@ -913,6 +913,7 @@ Other - Bug in :func:`pandas.testing.assert_series_equal`, :func:`pandas.testing.assert_frame_equal`, :func:`pandas.testing.assert_index_equal` and :func:`pandas.testing.assert_extension_array_equal` incorrectly raising when an attribute has an unrecognized NA type (:issue:`39461`) - Bug in :meth:`DataFrame.equals`, :meth:`Series.equals`, :meth:`Index.equals` with object-dtype containing ``np.datetime64("NaT")`` or ``np.timedelta64("NaT")`` (:issue:`39650`) - Bug in :func:`pandas.util.show_versions` where console JSON output was not proper JSON (:issue:`39701`) +- Let Pandas compile on z/OS when using `xlc `_ (:issue:`35826`) - Bug in :meth:`DataFrame.convert_dtypes` incorrectly raised ValueError when called on an empty DataFrame (:issue:`40393`) - Bug in :meth:`DataFrame.clip` not interpreting missing values as no threshold (:issue:`40420`) diff --git a/pandas/_libs/src/headers/cmath b/pandas/_libs/src/headers/cmath index 632e1fc2390d0..9e7540cfefc13 100644 --- a/pandas/_libs/src/headers/cmath +++ b/pandas/_libs/src/headers/cmath @@ -25,6 +25,18 @@ namespace std { __inline int isnan(double x) { return _isnan(x); } __inline int notnan(double x) { return x == x; } } +#elif defined(__MVS__) +#include + +#define _signbit signbit +#undef signbit +#undef isnan + +namespace std { + __inline int notnan(double x) { return x == x; } + __inline int signbit(double num) { return _signbit(num); } + __inline int isnan(double x) { return isnan(x); } +} #else #include diff --git a/setup.py b/setup.py index b410c5c154648..17ee110bc4136 100755 --- a/setup.py +++ b/setup.py @@ -569,6 +569,17 @@ def srcpath(name=None, suffix=".pyx", subdir="src"): include = data.get("include", []) include.append(numpy.get_include()) + undef_macros = [] + + if ( + sys.platform == "zos" + and data.get("language") == "c++" + and os.path.basename(os.environ.get("CXX", "/bin/xlc++")) in ("xlc", "xlc++") + ): + data.get("macros", macros).append(("__s390__", "1")) + extra_compile_args.append("-qlanglvl=extended0x:nolibext") + undef_macros.append("_POSIX_THREADS") + obj = Extension( f"pandas.{name}", sources=sources, @@ -578,6 +589,7 @@ def srcpath(name=None, suffix=".pyx", subdir="src"): define_macros=data.get("macros", macros), extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, + undef_macros=undef_macros, ) extensions.append(obj)