Page 1 of 1

failed to build netlib-java due to a difference in cblas.h

PostPosted: Fri Aug 26, 2016 4:43 am
by winice

I am trying to build netlib-java with cblas/lapacke. I downloaded the lapack-3.6.0 which also contains the cblas. It complains some definition about the enum types.

com_github_fommil_netlib_NativeSystemBLAS.c: In function ‘Java_com_github_fommil_netlib_NativeSystemBLAS_dgbmv’:
com_github_fommil_netlib_NativeSystemBLAS.c:204:1: error: invalid use of undefined type ‘enum CBLAS_TRANSPOSE’
cblas_dgbmv(CblasColMajor, getCblasTrans(jni_trans), m, n, kl, ku, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

Then I downloaded the cblas.h from It works fine.

The difference is in lapack-3.6.0/CBLAS/include/cblas.h, it adds typedef before enum. For example:
typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
But in the blas/cblas.h, it only defines enum CBLAS_ORDER but not typedef.
enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};