Skip to content

Commit c8c6b29

Browse files
cosminbascatimfel
authored andcommitted
GR-43627: numpy 1.23.5 - add support for llvm flang (via setuptools)
1 parent ea6e241 commit c8c6b29

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GraalPythonModuleBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ static Tool forBinary(String name, Object... targets) {
532532
Tool.forVariable("LD", tsLiteral("ld.lld"), tsLiteral("ld"), tsLiteral("lld")),
533533
Tool.forVariable("CC", tsLiteral("clang"), tsLiteral("cc")),
534534
Tool.forVariable("CXX", tsLiteral("clang++"), tsLiteral("c++")),
535+
Tool.forVariable("FC", tsLiteral("graalvm-flang"), tsLiteral("flang-new"), tsLiteral("flang")),
535536
Tool.forBinary("llvm-as", tsLiteral("as")),
536537
Tool.forBinary("clang-cl", tsLiteral("cl")),
537538
Tool.forBinary("clang-cpp", tsLiteral("cpp")),

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,9 @@ def make_site_cfg(root):
406406
append_env_var(numpy_build_env, 'CFLAGS', '-Wno-error=implicit-function-declaration')
407407
info(f"have lapack or blas ... CLFAGS={numpy_build_env['CFLAGS']}")
408408

409-
install_from_pypi("numpy==1.23.5", build_cmd=["build_ext", "--disable-optimization"], env=numpy_build_env,
409+
numpy_build_env["FC"] = "flang-new"
410+
install_from_pypi("numpy==1.23.5", build_cmd=["build_ext", "--disable-optimization",
411+
"config", "--fcompiler=flang-new"], env=numpy_build_env,
410412
pre_install_hook=make_site_cfg, **kwargs)
411413

412414
# print numpy configuration
@@ -476,7 +478,7 @@ def scipy(**kwargs):
476478
xit("SciPy can only be installed within a venv.")
477479
from distutils.sysconfig import get_config_var
478480
scipy_build_env["LDFLAGS"] = get_config_var("LDFLAGS")
479-
scipy_build_env["SCIPY_USE_PYTHRAN"] = "0"
481+
scipy_build_env["FC"] = "flang-new"
480482

481483
if have_lapack() or have_openblas():
482484
append_env_var(scipy_build_env, 'CFLAGS', '-Wno-error=implicit-function-declaration')
@@ -487,7 +489,8 @@ def scipy(**kwargs):
487489
pybind11(**kwargs)
488490
pythran(**kwargs)
489491

490-
install_from_pypi("scipy==1.8.1", env=scipy_build_env, **kwargs)
492+
install_from_pypi("scipy==1.8.1", build_cmd=["config", "--fcompiler=flang-new"],
493+
env=scipy_build_env, **kwargs)
491494

492495
@pip_package()
493496
def scikit_learn(**kwargs):

0 commit comments

Comments
 (0)