|
From: Luigi B. <lui...@gm...> - 2024-10-15 14:41:31
|
Hi Dirk—yes, I did a few changes. There finally seems to be some consensus
on the tools for building Python wheels, so I'm using those now.
First, you'll need some tooling; in the CI build I'm doing `pip install
setuptools build tox` but I guess you'll install the corresponding apt
packages instead. If you're not running the tests, you don't need tox, I
guess.
Second, forget setup.py wrap, the SWIG command is now
$(SWIG) -python -c++ -outdir src/QuantLib -o
src/QuantLib/quantlib_wrap.cpp ../SWIG/quantlib.i
You can do it just once for all Pythons.
Third, instead of setup.py build, the build command is now
CXXFLAGS="$(compilerflags)" CC="$(cxxcompiler)" CXX="$(cxxcompiler)"
$(PYTHON) -m build --wheel
which builds a Python wheel. It uses Python's stable API, so the same
wheel should work for all Python versions >= 3.8.
I don't know if there's a fourth step—do you need to install the wheel in
order to package it for apt? If so, use "$(PYTHON) -m pip install".
Hope it helps—let me know if you hit some other roadblock.
Luigi
On Tue, Oct 15, 2024 at 3:27 PM Dirk Eddelbuettel <ed...@de...> wrote:
>
> I am having an issue with QL-SWIG under 1.36. I updated QL to 1.36
> yesterday
> for Debian (and my Ubuntu PPA for 24.04; having done so a week earlier for
> the RC as well). But now QL-SWIG croaks:
>
> fatal error: src/QuantLib/quantlib_wrap.cpp: No such file or directory
>
> I presume I need to change something (again). Currently we use a two-step
> of
> 'setup.py wrap' (no longer recognised -- I likely need to replace it ?) and
> 'setup.py build', where the latter now fails presumably because the former
> is
> not working:
>
> build-stamp:
> dh_testdir
> @echo "*** Running on arch $(arch) and cpu $(cpu)"
>
> ./autogen.sh
>
> # need to build the Makefile for R (and Ruby ?)
> ./configure --prefix=/usr \
> --build $(arch)
>
> # $(MAKE)
> (cd Python && for python in $(PYTHONS); do \
> CC="$(cxxcompiler)" \
> CXX="$(cxxcompiler)" \
> CFLAGS="$(compilerflags)" \
> CXXFLAGS="$(compilerflags)" \
> $$python setup.py wrap; \
> CC="$(cxxcompiler)" \
> CXX="$(cxxcompiler)" \
> CFLAGS="$(compilerflags)" \
> CXXFLAGS="$(compilerflags)" \
> $$python setup.py build; \
> done )
>
> Thanks in advance for any help!
>
> Cheers, Dirk
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | ed...@de...
>
|