Skip to content

Commit 5767e2a

Browse files
committed
[GR-18654] Fix Pandas build for managed mode.
PullRequest: graalpython/678
2 parents 99b5d18 + 75ef574 commit 5767e2a

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,22 @@ def get_lapack_lite_sources(ext, build_dir):
11251125
'console_scripts': f2py_cmds
11261126
},
11271127
1128+
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
1129+
index 14451fa..85e64cc 100644
1130+
--- a/numpy/distutils/ccompiler.py
1131+
+++ b/numpy/distutils/ccompiler.py
1132+
@@ -682,7 +682,7 @@ def CCompiler_cxx_compiler(self):
1133+
return self
1134+
1135+
cxx = copy(self)
1136+
- cxx.compiler_so = [cxx.compiler_cxx[0]] + cxx.compiler_so[1:]
1137+
+ cxx.compiler_so = cxx.compiler_cxx + cxx.compiler_so[1:]
1138+
if sys.platform.startswith('aix') and 'ld_so_aix' in cxx.linker_so[0]:
1139+
# AIX needs the ld_so_aix script included with Python
1140+
cxx.linker_so = [cxx.linker_so[0], cxx.compiler_cxx[0]] \
1141+
11281142
'''
1129-
install_from_pypi("numpy==1.16.4", patch=patch, env={"NPY_NUM_BUILD_JOBS": "1"})
1143+
install_from_pypi("numpy==1.16.4", patch=patch, env={"NPY_NUM_BUILD_JOBS": "1"}, **kwargs)
11301144

11311145
@pip_package()
11321146
def dateutil(**kwargs):
@@ -1193,6 +1207,20 @@ def pandas(**kwargs):
11931207
#define __Pyx_sst_abs(value) abs(value)
11941208
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
11951209
#define __Pyx_sst_abs(value) labs(value)
1210+
@@ -881,13 +881,7 @@ static const char *__pyx_filename;
1211+
1212+
/* Header.proto */
1213+
#if !defined(CYTHON_CCOMPLEX)
1214+
- #if defined(__cplusplus)
1215+
- #define CYTHON_CCOMPLEX 1
1216+
- #elif defined(_Complex_I)
1217+
- #define CYTHON_CCOMPLEX 1
1218+
- #else
1219+
#define CYTHON_CCOMPLEX 0
1220+
- #endif
1221+
#endif
1222+
#if CYTHON_CCOMPLEX
1223+
#ifdef __cplusplus
11961224
diff --git a/pandas/core/window.py b/pandas/core/window.py
11971225
index 8657420..f7b3f08 100644
11981226
--- a/pandas/core/window.py
@@ -1208,7 +1236,7 @@ def pandas(**kwargs):
12081236
from pandas.util._decorators import Appender, Substitution, cache_readonly
12091237
'''
12101238
# workaround until Sulong toolchain fixes this
1211-
cflags = "-stdlib=libc++ -lc++ -lm -lc" if sys.implementation.name == "graalpython" else ""
1239+
cflags = "-stdlib=libc++ -lm -lc" if sys.implementation.name == "graalpython" else ""
12121240
install_from_pypi("pandas==0.25.0", patch=patch, add_cflags=cflags, **kwargs)
12131241

12141242
return locals()

graalpython/lib-python/3/distutils/sysconfig_graalpython.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ def _init_posix():
6969
so_ext = ".so" if not darwin_native else ".dylib"
7070
assert _imp.extension_suffixes()[0] == "." + so_abi + so_ext, "mismatch between extension suffix to _imp.extension_suffixes"
7171

72+
toolchain_cxx = sys.__graal_get_toolchain_path('CXX')
73+
have_cxx = toolchain_cxx is not None
7274

7375
g = {}
7476
g['CC'] = sys.__graal_get_toolchain_path('CC')
75-
g['CXX'] = sys.__graal_get_toolchain_path('CXX')
77+
g['CXX'] = toolchain_cxx if have_cxx else g['CC'] + ' --driver-mode=g++ -stdlib=libc++'
7678
g['OPT'] = "-DNDEBUG -O1"
7779
g['CONFINCLUDEPY'] = get_python_inc()
78-
g['CPPFLAGS'] = '-I. -I%s' % get_python_inc()
80+
g['CPPFLAGS'] = '-I. -I' + get_python_inc()
7981
g['CFLAGS'] = "-DNDEBUG -O1"
8082
g['CCSHARED'] = "-fPIC"
8183
g['LDSHARED_LINUX'] = "%s -shared -fPIC" % sys.__graal_get_toolchain_path('CC')

0 commit comments

Comments
 (0)