Skip to content

Use scipy_openblas with Fortran 77 code in a Python wheel #254

@roryyorke

Description

@roryyorke

tl;dr: to use scipy_openblas32 with Fortran 77 code, do I need my own preprocessor mapping from "normal" to scipy_openblas symbols, e.g. -DDGETRF=SCIPY_DGETRF ?

I'm a maintainer of Slycot, which is a thin Python library around the Fortran 77 library SLICOT. One of our long-standing issues is to provide binary wheels on PyPI for Linux, Windows, and macos.

I've made a model of the problem at https://github.com/roryyorke/f77ex , which is a Python project with Fortran 77 code calling DGETRF. It's scikit-core-build-based, and successfully makes a manylinux binary wheel with bundled OpenBLAS.

To get this to work I needed to add compile-time flags -cpp -DDGETRF=SCIPY_DGETRF.

My questions:

  1. Am I doing this the hard way? Can I copy a solution from some other project? I have looked at Scipy's build code, but found it hard to follow.
  2. If a "normal"->"scipy_openblas" mapping is needed would this preprocessor option be best, or should I rather rename symbols in the object files using objcopy? Or is there something else?

Any other advice, especially around getting this to work on Windows, would be gratefully received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions