2020-07-08 14:58:10 +00:00
|
|
|
PYODIDE_ROOT=$(abspath ../..)
|
|
|
|
include ../../Makefile.envs
|
2018-10-31 13:47:52 +00:00
|
|
|
|
|
|
|
CLAPACK_VERSION=3.2.1
|
|
|
|
|
|
|
|
ROOT=$(abspath .)
|
|
|
|
|
|
|
|
SRC=$(ROOT)/CLAPACK-WA
|
|
|
|
|
|
|
|
|
2021-01-03 14:14:56 +00:00
|
|
|
all: $(SRC)/lapack_WA.a
|
2018-10-31 13:47:52 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf CLAPACK-WA
|
|
|
|
|
2021-01-03 14:14:56 +00:00
|
|
|
$(SRC)/lapack_WA.a: $(SRC)/Makefile
|
2018-10-31 13:47:52 +00:00
|
|
|
# We build BLAS/LAPACK only for target.
|
|
|
|
# On host we include -LCLAPACK-WA path which has no effect on host.
|
|
|
|
# On target it gets rewritten by pywasmcross to the full patch of
|
2021-01-03 14:14:56 +00:00
|
|
|
# blas_WA.a, lapack_WA.a which are linked statically in scipy
|
2018-10-31 13:47:52 +00:00
|
|
|
# in each module that needs them.
|
2020-12-20 10:30:12 +00:00
|
|
|
emmake make -C CLAPACK-WA/ -j $${PYODIDE_JOBS:-3} blaslib lapacklib
|
2018-10-31 13:47:52 +00:00
|
|
|
|
2020-12-20 10:30:12 +00:00
|
|
|
clapack.tgz:
|
2018-10-31 13:47:52 +00:00
|
|
|
wget -q -O clapack.tgz http://www.netlib.org/clapack/clapack.tgz
|
2018-10-31 17:08:57 +00:00
|
|
|
md5sum --quiet --check checksums || (rm -f clapack.tgz; false)
|
2020-12-20 10:30:12 +00:00
|
|
|
|
|
|
|
$(SRC)/Makefile: clapack.tgz
|
2018-10-31 13:47:52 +00:00
|
|
|
tar xzf clapack.tgz
|
|
|
|
rm -rf $(SRC)
|
|
|
|
mv CLAPACK-$(CLAPACK_VERSION) $(SRC)
|
2020-12-20 10:30:12 +00:00
|
|
|
|
|
|
|
# The archive's contents have default permission 0750. If we use docker
|
|
|
|
# to build, then we will not own the contents in the host, which means
|
|
|
|
# we cannot navigate into the folder. Setting it to 0750 makes it
|
|
|
|
# easier to debug.
|
|
|
|
chmod -R o+rx $(SRC)
|
|
|
|
|
|
|
|
cd $(SRC); cat ../patches/*.patch | patch -p1
|
2020-12-14 17:04:02 +00:00
|
|
|
cp make.inc $(SRC)
|
2020-12-20 10:30:12 +00:00
|
|
|
|
|
|
|
# In CLAPACK's Makefiles, some commands are mistakenly (?) hardcoded
|
|
|
|
# instead of using the right variables
|
|
|
|
sed -i 's/^ -ranlib /^ $(RANLIB)/' **/Makefile
|
|
|
|
sed -i 's/^ ar /^ $(ARCH)/' **/Makefile
|
|
|
|
sed -i 's/^ ld /^ $(LD)/' **/Makefile
|