This patch makes everything in numpy, scipy and CLAPACK that began life as a fortran subroutine return int, whereas before they were a smattering of void plus lots of int, with a bunch of conflicts where the same function was defined as int in some and void in others. This matters because on upstream emscripten, these packages will not build due to linker conflicts, as the wasm linker can't link a function returning int to a function returning void.
Annoyingly, this has to be int return not void, because whereas a normal fortran subroutine doesn't return anything, there's an obscure feature of fortran 77 called alternative returns which allows subroutines to say they want to return by jumping to some other place in the code. f2c handles this with integer return values.
The library that is supplied by USE_PNG is png, but matplotlib seeks
png16. With the fastcomp backend, we end up ignoring it anyway, but with
the upstream backend this will be the correct course of action
* Adding nlopt package (WIP)
* cxxflags added, nlopt builds
* Add docs and test for cxxflags feature
* Applied black formatter
* Remove nlopt new pkg from this branch
* Removed empty cxxflags option from SciPy meta.yaml
This is needed for the upstream backend, and I believe is a noop under
the fastcomp backend
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
This addresses part of #713, by listing and building C libraries as
dependencies. This means we automatically build CLAPACK when needed, and
`lxml`'s C dependencies are not built if lxml is not. In particular,
building "core" should now be faster.
The building itself is still performed by Makefile.
The biggest change is that most of `0001-hacks-for-WebAssembly-build.patch` is eliminated, and the remaining is split up into individual single-purpose patches with corresponding documentation.
Most of `0001-hacks-for-WebAssembly-build.patch` is in fact unnecessary. We can continue to produce `.a` files instead of `.bc` files, and all we have to do to make it build is to set `$(ARCH) = emar` and `$(RANLIB) = emranlib`. In fact, we don't have to set them to anything, since the point of emmake is to set these for us (except emmake uses `$(AR)` so we set `$(ARCH) = $(AR)`).
There are places where `ar` and `cc` etc. are used directly instead of the variables; we use `sed` to fix this in the parent `Makefile` instead of patching.
In addition, there are also the following changes:
- Change the build system to build CLAPACK-WA/INSTALL as well. We should always have built it, but we managed to get away with not doing so due to a bug in emscripten that is fixed in 1.38.43. See https://github.com/iodide-project/pyodide/pull/843#issuecomment-744428471
- Generate `F2CLIB/libf2c/arith.h` properly instead of setting it to an empty file.
- Remove a seemingly unnecessary patch (945f06c46e)
It was changed from 4 to 8 in emscripten 1.38.31. Before the patch,
compiling numpy gives some warnings about redefining SIZEOF_OFF_T, but
as far as I can tell, it did not cause any real issues.