Skip to content

BLD:1.8.0: SciPy is not LTO ready #16098

@kloczek

Description

@kloczek

Describe your issue.

Looks like scipy last release is not LTO ready and compiler shows a lot LTO related warnings.

Reproducing Code Example

Regular build with passing in env variables -flto=auto -flto-partition=none in $CFLAGS and $CXXFLAGS, and -flto=auto -flto-partition=none -fuse-linker-plugin in $LDFLAGS.

Error message

First just summary stats

[tkloczko@devel-g2v tmp]$ cat python-scipy-build-log.txt | grep -- \\[-W | sed 's/.*\[//; s/\]//' | sort | uniq -c | sort -nr
    300 -Wunused-variable
    190 -Wlto-type-mismatch
    124 -Wconversion
     87 -Wunused-dummy-argument
     85 -Wunused-function
     84 -Wcpp
     60 -Wunused-but-set-variable
     59 -Wtabs
     48 -Wmaybe-uninitialized
     34 -Wparentheses
     32 -Wunused-label
     12 -Wswitch
      9 -Wmisleading-indentation
      9 -Wdiscarded-qualifiers
      7 -Wunused-local-typedefs
      7 -Wincompatible-pointer-types
      6 -Wterminate
      2 -Wintrinsic-shadow
      1 -Walloc-size-larger-than=

-Wlto-type-mismatch are caused by mismatched declarations in header files and place where routine is defined. Someone need to make decision which one version of those declarations needs to be used in both places.
Using LTO as well exposed -Wmaybe-uninitialized warnings.

SciPy/NumPy/Python version information

scipy 1.8.0, python 3.8.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    Build issuesIssues with building from source, including different choices of architecture, compilers and OSdefectA clear bug or issue that prevents SciPy from being installed or used as expected

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions