Commit 66fe5feb authored by Roman Yurchak's avatar Roman Yurchak

Better refactoring

parent fcaad86b
...@@ -19,6 +19,7 @@ jobs: ...@@ -19,6 +19,7 @@ jobs:
- run: - run:
name: dependencies name: dependencies
command: | command: |
# TODO: update pyodide-env image with the below
sudo apt-get update sudo apt-get update
sudo apt-get install gfortran f2c sudo apt-get install gfortran f2c
......
...@@ -215,10 +215,6 @@ $(CLAPACK): $(CPYTHONLIB) ...@@ -215,10 +215,6 @@ $(CLAPACK): $(CPYTHONLIB)
make -C CLAPACK make -C CLAPACK
$(CLAPACK): $(CPYTHONLIB)
make -C CLAPACK
build/packages.json: $(CPYTHONLIB) $(CLAPACK) build/packages.json: $(CPYTHONLIB) $(CLAPACK)
make -C packages make -C packages
......
...@@ -5,7 +5,7 @@ all: deps ...@@ -5,7 +5,7 @@ all: deps
../bin/pyodide buildall . ../build \ ../bin/pyodide buildall . ../build \
--ldflags="$(SIDE_LDFLAGS)" --host=$(HOSTPYTHONROOT) --target=$(TARGETPYTHONROOT) --ldflags="$(SIDE_LDFLAGS)" --host=$(HOSTPYTHONROOT) --target=$(TARGETPYTHONROOT)
deps: deps:
# Temporary workaround to install build dependencies # Install build dependencies
$(HOSTPYTHON) -m pip install Cython Tempita $(HOSTPYTHON) -m pip install Cython Tempita
clean: clean:
......
...@@ -22,7 +22,6 @@ source: ...@@ -22,7 +22,6 @@ source:
- patches/skip-fortran-fails-to-link.patch - patches/skip-fortran-fails-to-link.patch
- patches/dummy_threading.patch - patches/dummy_threading.patch
- patches/skip_ellip_harm_2_pyx_ctypes.patch - patches/skip_ellip_harm_2_pyx_ctypes.patch
- patches/skip_optimize_cobyla_import.patch
- patches/fix_mmap.patch - patches/fix_mmap.patch
build: build:
......
commit d755dab2147732e9213af29f55ab38c38b7ba8d2 commit 7a5b003922134abd01ae33b0a3e84d006673e9c6
Author: Roman Yurchak <rth.yurchak@pm.me> Author: Roman Yurchak <rth.yurchak@pm.me>
Date: Mon Oct 8 12:13:55 2018 +0200 Date: Mon Oct 8 12:13:55 2018 +0200
Force malloc Workaround for malloc issues
This aims to avoid the "invalid call target: $_malloc" issues This aims to avoid the "invalid call target: $_malloc" issues
...@@ -42,6 +42,20 @@ index 17ba78371..5deca7498 100644 ...@@ -42,6 +42,20 @@ index 17ba78371..5deca7498 100644
from .nonlin import * from .nonlin import *
from .slsqp import fmin_slsqp from .slsqp import fmin_slsqp
from .nnls import nnls from .nnls import nnls
diff --git a/scipy/optimize/_minimize.py b/scipy/optimize/_minimize.py
index 259546035..8b0b6960b 100644
--- a/scipy/optimize/_minimize.py
+++ b/scipy/optimize/_minimize.py
@@ -29,7 +29,8 @@ from ._trustregion_ncg import _minimize_trust_ncg
# constrained minimization
from .lbfgsb import _minimize_lbfgsb
from .tnc import _minimize_tnc
-from .cobyla import _minimize_cobyla
+#from .cobyla import _minimize_cobyla
+_minimize_cobyla = None
from .slsqp import _minimize_slsqp
diff --git a/scipy/optimize/setup.py b/scipy/optimize/setup.py diff --git a/scipy/optimize/setup.py b/scipy/optimize/setup.py
index 7d2b987cb..1861e7563 100755 index 7d2b987cb..1861e7563 100755
--- a/scipy/optimize/setup.py --- a/scipy/optimize/setup.py
......
commit ca74a1078c3955b06d1ab236bdd13256cb7c2551
Author: Roman Yurchak <rth.yurchak@pm.me>
Date: Thu Oct 25 12:43:50 2018 +0200
Skip scipy.optimize._cobyla import
diff --git a/scipy/optimize/_minimize.py b/scipy/optimize/_minimize.py
index 259546035..8b0b6960b 100644
--- a/scipy/optimize/_minimize.py
+++ b/scipy/optimize/_minimize.py
@@ -29,7 +29,8 @@ from ._trustregion_ncg import _minimize_trust_ncg
# constrained minimization
from .lbfgsb import _minimize_lbfgsb
from .tnc import _minimize_tnc
-from .cobyla import _minimize_cobyla
+#from .cobyla import _minimize_cobyla
+_minimize_cobyla = None
from .slsqp import _minimize_slsqp
...@@ -238,7 +238,6 @@ def handle_command(line, args, dryrun=False): ...@@ -238,7 +238,6 @@ def handle_command(line, args, dryrun=False):
lapack_dir = None lapack_dir = None
# rebuild = False
# Go through and adjust arguments # Go through and adjust arguments
for arg in line[1:]: for arg in line[1:]:
if arg.startswith('-I'): if arg.startswith('-I'):
...@@ -263,19 +262,11 @@ def handle_command(line, args, dryrun=False): ...@@ -263,19 +262,11 @@ def handle_command(line, args, dryrun=False):
# Fix for scipy to link to the correct BLAS/LAPACK files # Fix for scipy to link to the correct BLAS/LAPACK files
if arg.startswith('-L') and 'CLAPACK-WA' in arg: if arg.startswith('-L') and 'CLAPACK-WA' in arg:
# rebuild = True
out_idx = line.index('-o') out_idx = line.index('-o')
out_idx += 1 out_idx += 1
module_name = line[out_idx] module_name = line[out_idx]
module_name = Path(module_name).name.split('.')[0] module_name = Path(module_name).name.split('.')[0]
if module_name not in ['_fblas', '_flapack', '_flinalg',
'_calc_lwork', 'cython_blas',
'cython_lapack', '_iterative',
'_arpack']:
raise ValueError(f"Unsupported module requiring BLAS/LAPACK "
f"{module_name} in {' '.join(line)}")
lapack_dir = arg.replace('-L', '') lapack_dir = arg.replace('-L', '')
# For convinience we determine needed scipy link libraries # For convinience we determine needed scipy link libraries
# here, instead of in patch files # here, instead of in patch files
...@@ -288,9 +279,10 @@ def handle_command(line, args, dryrun=False): ...@@ -288,9 +279,10 @@ def handle_command(line, args, dryrun=False):
arg = os.path.join(lapack_dir, f"{lib_name}") arg = os.path.join(lapack_dir, f"{lib_name}")
new_args.append(arg) new_args.append(arg)
new_args.extend(['-s', 'INLINING_LIMIT=5', '--llvm-lto', '1']) new_args.extend(['-s', 'INLINING_LIMIT=5'])
continue continue
# Use -Os for files that are statically linked to CLAPACK
if (arg.startswith('-O') and 'CLAPACK' in ' '.join(line) if (arg.startswith('-O') and 'CLAPACK' in ' '.join(line)
and '-L' in ' '.join(line)): and '-L' in ' '.join(line)):
new_args.append('-Os') new_args.append('-Os')
...@@ -300,7 +292,7 @@ def handle_command(line, args, dryrun=False): ...@@ -300,7 +292,7 @@ def handle_command(line, args, dryrun=False):
# This can only be used for incremental rebuilds -- it generates # This can only be used for incremental rebuilds -- it generates
# an error during clean build of numpy # an error during clean build of numpy
# if os.path.isfile(output) and not rebuild: # if os.path.isfile(output):
# print('SKIPPING: ' + ' '.join(new_args)) # print('SKIPPING: ' + ' '.join(new_args))
# return # return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment