Skip to content

CMake build fails on Windows when prefix flag is used #5524

@Harishmcw

Description

@Harishmcw

When building OpenBLAS with CMake and using a custom prefix (e.g., scipy_), the build fails with undefined symbol errors:

lld-link: error: <root>: undefined symbol: shgemm_
lld-link: error: <root>: undefined symbol: shgemv_
lld-link: error: <root>: undefined symbol: cblas_shgemm

Observed behavior:

These symbols (shgemm_, shgemv_, cblas_shgemm) are conditionally compiled only when BUILD_HFLOAT16=ON. However, even when this flag is OFF, the generated renamesys.def file still contains entries like:

scipy_shgemm=shgemm_ @XX
scipy_shgemv=shgemv_ @YY
scipy_cblas_shgemm=cblas_shgemm @ZZ

Because the corresponding object files (shgemm.obj, etc.) are not built, the linker fails to find these symbols, resulting in the errors above.
When BUILD_HFLOAT16=ON, the objects are built and the build completes successfully.

Expected behavior:

When BUILD_HFLOAT16=OFF, the .def file should not include the shgemm, shgemv, or cblas_shgemm symbols.

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