2

I'm trying to make a Python package from a Rust Crate I'm making. The problem is that I need the RGSL crate which needs libgsl0-dev installed in the system.

I'm trying to publish using Maturin which uses Manylinux Docker image to build everything for Linux. The problem is that image doesn't have libgsl0-dev installed, so I made a custom image adding one line:

FROM konstin2/maturin

# To solve problems with CentOS 6 EOL 
RUN echo "https://vault.centos.org/6.10/os/x86_64/" > /var/cache/yum/x86_64/6/base/mirrorlist.txt
RUN echo "http://vault.centos.org/6.10/extras/x86_64/" > /var/cache/yum/x86_64/6/extras/mirrorlist.txt
RUN echo "http://vault.centos.org/6.10/updates/x86_64/" > /var/cache/yum/x86_64/6/updates/mirrorlist.txt
RUN echo "http://vault.centos.org/6.10/sclo/x86_64/rh" > /var/cache/yum/x86_64/6/centos-sclo-rh/mirrorlist.txt
RUN echo "http://vault.centos.org/6.10/sclo/x86_64/sclo" > /var/cache/yum/x86_64/6/centos-sclo-sclo/mirrorlist.txt

# Installs needed library
RUN yum install -y libgsl0-dev

ENTRYPOINT ["/usr/bin/maturin"]

But when I try to build with:

docker run --rm -v $(pwd):/io custom-image build --cargo-extra-args="--no-default-features"

⚠ Warning: You're building a library without activating pyo3's extension-module feature. See https://pyo3.rs/v0.12.4/building_and_distribution.html#linking Found pyo3 bindings Found CPython 3.6m at python3.6, CPython 3.7m at python3.7, CPython 3.8 at python3.8, CPython 3.9 at python3.9
Compiling pyo3 v0.12.4 error: could not find native static library python3.6m, perhaps an -L flag is missing

What I'm missing here? Any kind of help would be really appreciated

Genarito
  • 3,027
  • 5
  • 27
  • 53
  • Try adding `py03 = { version = "whatever your using", features = ["extension-module"]}` to your Cargo.toml. I cannot re-create this error right now, but this is what I think the error message is telling you to do. Also, try looking again at the py03 readme and see if you missed anything. – Isacc Barker Dec 08 '20 at 06:02
  • Thanks for you comment! Unfortunately It didn't solve the error. It seems to be a problem with manylinux compliant, a few libraries are available for all the distributions, GSL is not one of them. I've opened [an issue](https://github.com/pypa/manylinux/issues/864) asking for this – Genarito Dec 08 '20 at 14:54

1 Answers1

1

As an user pointed me out in this issue, there was a problem with the installed GSL version: I was using a function which was added in the last release of the library. Also I have to user the command wheel-repair to include some missing .so files. The entire process is in this issue

Genarito
  • 3,027
  • 5
  • 27
  • 53