Skip to content

cblas_dgemm returns incorrect results when the static feature of openblas-src is enabled on macOS #64

Closed
@maoe

Description

@maoe

https://github.com/maoe/ndarray-dot-repro is a reproducer. It was minimized from code which used argmin + ndarrayl feature.

This reproducer uses the patched version of openblas-src from #65 so that static build works both on Linux and macOS Big Sur.

The expected output of the main is [1.0, 1.0, 1.0, 1.0] but it returns the zero matrix on macOS when the static feature of openblas-src is enabled.

% cargo run
   Compiling ndarray-dot-repro v0.1.0 (/Users/maoe/src/github.com/maoe/ndarray-dot-repro)
    Finished dev [unoptimized + debuginfo] target(s) in 0.49s
     Running `target/debug/ndarray-dot-repro`
[
    1.0,
    1.0,
    1.0,
    1.0,
]
% cargo run --features openblas-src/static
   Compiling ndarray-dot-repro v0.1.0 (/Users/maoe/src/github.com/maoe/ndarray-dot-repro)
    Finished dev [unoptimized + debuginfo] target(s) in 0.52s
     Running `target/debug/ndarray-dot-repro`
[
    0.0,
    0.0,
    0.0,
    0.0,
]

FWIW, I haven't been able to reproduce the issue in C on macOS:

% git clone https://github.com/xianyi/OpenBLAS.git
% cd OpenBLAS
% git checkout v0.3.14 # This is the commit #65 uses
% make
% wget -q https://gist.githubusercontent.com/maoe/953c4e863703be915928b0f8997fcc46/raw/e827d61ae2944a72a37d0784c0aab0026e1b6cdb/repro.c # See https://gist.github.com/maoe/953c4e863703be915928b0f8997fcc46
% cc -o repro repro.c libopenblas.a
% ./repro
1.000000
1.000000
1.000000
1.000000

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