Skip to content

Commit

Permalink
Add binary wheels for Python 3.10 (#186)
Browse files Browse the repository at this point in the history
And bump Boost version to fix removal of deprecated function:
boostorg/python#344
  • Loading branch information
juliancarrivick committed Oct 31, 2022
1 parent c3172d7 commit 9901a11
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manylinux2010/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
HERE=`dirname "$0"`
cd $HERE/..

for i in 36 37 38 39; do
for i in 36 37 38 39 310; do
docker build -f manylinux2010/wheel${i}.docker . -t pybdsf${i}
docker run -v `pwd`/manylinux2010:/manylinux2010 pybdsf${i} sh -c "cp /output/*.whl /manylinux2010/."
done
Expand Down
43 changes: 43 additions & 0 deletions manylinux2010/wheel310.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM quay.io/pypa/manylinux2010_x86_64


# install rpms
RUN yum install -y gcc-gfortran

# download other source code
WORKDIR /tmp
RUN curl https://ufpr.dl.sourceforge.net/project/boost/boost/1.76.0/boost_1_76_0.tar.bz2 --output /tmp/boost.tar.bz2

RUN mkdir /build
WORKDIR /build

# how many threads to use for compiling
ENV THREADS 4

ENV PYMAJOR 3
ENV PYMINOR 10
ENV TARGET cp${PYMAJOR}${PYMINOR}-cp${PYMAJOR}${PYMINOR}

# install python dependencies, make boost install also boost_numpy
RUN /opt/python/${TARGET}/bin/pip install oldest-supported-numpy

# setup boost
WORKDIR /build
RUN tar jxf /tmp/boost.tar.bz2
WORKDIR /build/boost_1_76_0
RUN ./bootstrap.sh --prefix=/opt/boost \
--with-libraries=python \
--with-python=/opt/python/${TARGET}/bin/python \
--with-python-version=${PYMAJOR}.${PYMINOR} \
--with-python-root=/opt/python/${TARGET}
RUN ./b2 -j${THREADS} \
cxxflags="-fPIC -I/opt/python/${TARGET}/include/python${PYMAJOR}.${PYMINOR}${PYUNICODE}/" \
link=static,shared install

ADD . /PyBDSF
WORKDIR /PyBDSF
ENV CFLAGS "-I/opt/boost/include -L/opt/boost/lib"
ENV LD_LIBRARY_PATH "/opt/boost/lib:/usr/local/lib"
RUN /opt/python/${TARGET}/bin/python ./setup.py build_ext -j${THREADS}
RUN /opt/python/${TARGET}/bin/python ./setup.py bdist_wheel -d .
RUN auditwheel repair --plat manylinux2010_x86_64 -w /output *.whl

0 comments on commit 9901a11

Please sign in to comment.