You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visual Studio is unable to compile <cblas.h> included with OpenBLAS, due to its
use of the _Complex type which assumes C99 support. Here is a patch which switches
to a binary-compatible structure in cases where the complex number type is not available: https://gist.github.com/2470335.
With this change in place, this test program can now be built with Visual Studio 2010:
I have tested this change on Linux and Windows (MinGW) and have not observed any adverse effects.
Best,
--Zaheer
Additional notes:
<f77blas.h> has the same issue, but already contains a workaround, so I didn't make any changes.
The approach I have used is similar to that used in LAPACKE (see <lapacke_config.h>).
There are several utility routines (make_complex, *_real, *_imag) included, which
are not strictly necessary, but permit writing code which works with either complex type.
It should be noted that OPENBLAS_COMPLEX_STRUCT is not a drop-in replacement
for OPENBLAS_COMPLEX_C99. For instance, this snippet works with C99's _Complex,
but fails to compile with the struct form:
For this reason, it may be preferrable to entirely drop the C99 _Complex type and
always use the struct form, leaving conversion to client code. This is the approach
taken by Intel's MKL, which is described in more detail here.
The text was updated successfully, but these errors were encountered:
Hello Xianyi,
Visual Studio is unable to compile <cblas.h> included with OpenBLAS, due to its
use of the _Complex type which assumes C99 support. Here is a patch which switches
to a binary-compatible structure in cases where the complex number type is not available: https://gist.github.com/2470335.
With this change in place, this test program can now be built with Visual Studio 2010:
I have tested this change on Linux and Windows (MinGW) and have not observed any adverse effects.
Best,
--Zaheer
Additional notes:
<f77blas.h> has the same issue, but already contains a workaround, so I didn't make any changes.
The approach I have used is similar to that used in LAPACKE (see <lapacke_config.h>).
There are several utility routines (make_complex, *_real, *_imag) included, which
are not strictly necessary, but permit writing code which works with either complex type.
It should be noted that OPENBLAS_COMPLEX_STRUCT is not a drop-in replacement
for OPENBLAS_COMPLEX_C99. For instance, this snippet works with C99's _Complex,
but fails to compile with the struct form:
For this reason, it may be preferrable to entirely drop the C99 _Complex type and
always use the struct form, leaving conversion to client code. This is the approach
taken by Intel's MKL, which is described in more detail here.
The text was updated successfully, but these errors were encountered: