2020-12-23 13:24:32 +00:00
|
|
|
package:
|
|
|
|
name: CLAPACK
|
2021-01-03 21:09:40 +00:00
|
|
|
version: 3.2.1
|
|
|
|
|
|
|
|
source:
|
2021-01-10 04:47:58 +00:00
|
|
|
sha256: 6dc4c382164beec8aaed8fd2acc36ad24232c406eda6db462bd4c41d5e455fac
|
2021-01-03 21:09:40 +00:00
|
|
|
url: http://www.netlib.org/clapack/clapack.tgz
|
|
|
|
extract_dir: CLAPACK-3.2.1
|
|
|
|
patches:
|
|
|
|
- patches/0001-add-missing-import.patch
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
- patches/0002-fix-arith.h.patch
|
2021-01-03 21:09:40 +00:00
|
|
|
- patches/0003-lapack-install-make.patch
|
|
|
|
- patches/0004-fix-f2clibs-build.patch
|
|
|
|
- patches/0005-remove-redundant-symbols.patch
|
2021-01-09 09:44:41 +00:00
|
|
|
- patches/0006-correct-return-types.patch
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
- patches/0007-Fix-xerbla-and-ilaenv.patch
|
2021-01-03 21:09:40 +00:00
|
|
|
extras:
|
|
|
|
- [make.inc, make.inc]
|
2020-12-23 13:24:32 +00:00
|
|
|
|
|
|
|
build:
|
2021-02-26 16:01:10 +00:00
|
|
|
sharedlibrary: true
|
2021-01-03 21:09:40 +00:00
|
|
|
script: |
|
|
|
|
# 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 .
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
emmake make -j ${PYODIDE_JOBS:-3} blaslib lapacklib
|
2022-06-16 23:31:16 +00:00
|
|
|
mkdir -p dist
|
|
|
|
emcc blas_WA.a lapack_WA.a F2CLIBS/libf2c.a ${SIDE_MODULE_LDFLAGS} -o dist/clapack_all.so
|
2022-05-18 04:14:16 +00:00
|
|
|
mkdir -p ${WASM_LIBRARY_DIR}/CLAPACK
|
|
|
|
cp -r INCLUDE ${WASM_LIBRARY_DIR}/CLAPACK/
|