question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failure with lots of cblas API errors

See original GitHub issue

Description

I am trying to build scikit-learn from the pkgsrc packaging scripts on CentOS 7.6/x86_64. We keep a minimal installation from CentOS and then put our own build of gcc+binutils on top to then get software via pkgsrc. I am working on improving BLAS support and carry some local patches for that. The libcblas is the generic netlib code that then links to OpenBLAS. I built a number of packages just fine, including R and octave, and of course numpy and scipy both with Python 3.6. So I hope you believe me that my toolchain is not just broken;-)

Now, scikit-learn version 0.20.2 fails to build with lots of cblas API errors. Am I the only one getting this? Is this the result of some generator script failing?

Steps/Code to Reproduce

Well, try building math/py-scikit-learn from pkgsrc 2019Q1. I am not asking the pkgsrc folks since the error so much looks like basic API breakage. But since not everyone has this issue, it may be specific to some configuration here. For example, is it special that I actually use a cblas library?

This is the failing build line:

In file included from /scratch/sw/work/gcc-8.3.0_openmpi-3.1.3/pkgsrc/2019Q1/pkgsrc-2019Q1/math/py-scikit-learn/work/.buildlink/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
                 from /scratch/sw/work/gcc-8.3.0_openmpi-3.1.3/pkgsrc/2019Q1/pkgsrc-2019Q1/math/py-scikit-learn/work/.buildlink/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /scratch/sw/work/gcc-8.3.0_openmpi-3.1.3/pkgsrc/2019Q1/pkgsrc-2019Q1/math/py-scikit-learn/work/.buildlink/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from sklearn/linear_model/cd_fast.c:650:
/scratch/sw/work/gcc-8.3.0_openmpi-3.1.3/pkgsrc/2019Q1/pkgsrc-2019Q1/math/py-scikit-learn/work/.buildlink/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^~~~~~~
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_8enet_coordinate_descent':
sklearn/linear_model/cd_fast.c:4903:47: warning: 'enum CBLAS_TRANSPOSE' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
                                               ^~~~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:4903:29: warning: 'enum CBLAS_ORDER' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
                             ^~~~~~~~~~~
sklearn/linear_model/cd_fast.c:5013:16: warning: assignment to 'void (*)(enum CBLAS_ORDER,  enum CBLAS_TRANSPOSE,  int,  int,  float,  float *, int,  float *, int,  float,  float *, int)' from incompatible pointer type 'void (*)(const CBLAS_LAYOUT,  const CBLAS_TRANSPOSE,  const int,  const int,  const float,  const float *, const int,  const float *, const int,  const float,  float *, const int)' {aka 'void (*)(const enum <anonymous>,  const enum <anonymous>,  const int,  const int,  const float,  const float *, const int,  const float *, const int,  const float,  float *, const int)'} [-Wincompatible-pointer-types]
   __pyx_v_gemv = cblas_sgemv;
                ^
sklearn/linear_model/cd_fast.c:5022:15: warning: assignment to 'float (*)(int,  float *, int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_sdot;
               ^
sklearn/linear_model/cd_fast.c:5031:16: warning: assignment to 'void (*)(int,  float,  float *, int,  float *, int)' from incompatible pointer type 'void (*)(const int,  const float,  const float *, const int,  float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_axpy = cblas_saxpy;
                ^
sklearn/linear_model/cd_fast.c:5040:16: warning: assignment to 'float (*)(int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_sasum;
                ^
sklearn/linear_model/cd_fast.c:5049:16: warning: assignment to 'void (*)(int,  float *, int,  float *, int)' from incompatible pointer type 'void (*)(const int,  const float *, const int,  float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_copy = cblas_scopy;
                ^
sklearn/linear_model/cd_fast.c:5396:22: error: type of formal parameter 1 is incomplete
         __pyx_v_gemv(CblasColMajor, CblasNoTrans, __pyx_v_n_samples, __pyx_v_n_features, -1.0, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_X.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_X.strides[1]) )))), __pyx_v_n_samples, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_w.data) + __pyx_t_15)) )))), 1, 1.0, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_R.data) + __pyx_t_16)) )))), 1);
                      ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:5396:37: error: type of formal parameter 2 is incomplete
         __pyx_v_gemv(CblasColMajor, CblasNoTrans, __pyx_v_n_samples, __pyx_v_n_features, -1.0, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_X.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_X.strides[1]) )))), __pyx_v_n_samples, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_w.data) + __pyx_t_15)) )))), 1, 1.0, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_R.data) + __pyx_t_16)) )))), 1);
                                     ^~~~~~~~~~~~
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_10enet_coordinate_descent':
sklearn/linear_model/cd_fast.c:6293:47: warning: 'enum CBLAS_TRANSPOSE' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
                                               ^~~~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:6293:29: warning: 'enum CBLAS_ORDER' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
                             ^~~~~~~~~~~
sklearn/linear_model/cd_fast.c:6403:16: warning: assignment to 'void (*)(enum CBLAS_ORDER,  enum CBLAS_TRANSPOSE,  int,  int,  double,  double *, int,  double *, int,  double,  double *, int)' from incompatible pointer type 'void (*)(CBLAS_LAYOUT,  CBLAS_TRANSPOSE,  const int,  const int,  const double,  const double *, const int,  const double *, const int,  const double,  double *, const int)' {aka 'void (*)(enum <anonymous>,  enum <anonymous>,  const int,  const int,  const double,  const double *, const int,  const double *, const int,  const double,  double *, const int)'} [-Wincompatible-pointer-types]
   __pyx_v_gemv = cblas_dgemv;
                ^
sklearn/linear_model/cd_fast.c:6412:15: warning: assignment to 'double (*)(int,  double *, int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_ddot;
               ^
sklearn/linear_model/cd_fast.c:6421:16: warning: assignment to 'void (*)(int,  double,  double *, int,  double *, int)' from incompatible pointer type 'void (*)(const int,  const double,  const double *, const int,  double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_axpy = cblas_daxpy;
                ^
sklearn/linear_model/cd_fast.c:6430:16: warning: assignment to 'double (*)(int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_dasum;
                ^
sklearn/linear_model/cd_fast.c:6439:16: warning: assignment to 'void (*)(int,  double *, int,  double *, int)' from incompatible pointer type 'void (*)(const int,  const double *, const int,  double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_copy = cblas_dcopy;
                ^
sklearn/linear_model/cd_fast.c:6786:22: error: type of formal parameter 1 is incomplete
         __pyx_v_gemv(CblasColMajor, CblasNoTrans, __pyx_v_n_samples, __pyx_v_n_features, -1.0, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_X.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_X.strides[1]) )))), __pyx_v_n_samples, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_w.data) + __pyx_t_15)) )))), 1, 1.0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R.data) + __pyx_t_16)) )))), 1);
                      ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:6786:37: error: type of formal parameter 2 is incomplete
         __pyx_v_gemv(CblasColMajor, CblasNoTrans, __pyx_v_n_samples, __pyx_v_n_features, -1.0, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_X.data) + __pyx_t_13)) ) + __pyx_t_14 * __pyx_v_X.strides[1]) )))), __pyx_v_n_samples, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_w.data) + __pyx_t_15)) )))), 1, 1.0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R.data) + __pyx_t_16)) )))), 1);
                                     ^~~~~~~~~~~~
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_14sparse_enet_coordinate_descent':
sklearn/linear_model/cd_fast.c:8499:15: warning: assignment to 'float (*)(int,  float *, int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_sdot;
               ^
sklearn/linear_model/cd_fast.c:8508:16: warning: assignment to 'float (*)(int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_sasum;
                ^
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_16sparse_enet_coordinate_descent':
sklearn/linear_model/cd_fast.c:10480:15: warning: assignment to 'double (*)(int,  double *, int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_ddot;
               ^
sklearn/linear_model/cd_fast.c:10489:16: warning: assignment to 'double (*)(int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_dasum;
                ^
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_20enet_coordinate_descent_gram':
sklearn/linear_model/cd_fast.c:12863:15: warning: assignment to 'float (*)(int,  float *, int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_sdot;
               ^
sklearn/linear_model/cd_fast.c:12872:16: warning: assignment to 'void (*)(int,  float,  float *, int,  float *, int)' from incompatible pointer type 'void (*)(const int,  const float,  const float *, const int,  float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_axpy = cblas_saxpy;
                ^
sklearn/linear_model/cd_fast.c:12881:16: warning: assignment to 'float (*)(int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_sasum;
                ^
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_22enet_coordinate_descent_gram':
sklearn/linear_model/cd_fast.c:14377:15: warning: assignment to 'double (*)(int,  double *, int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_ddot;
               ^
sklearn/linear_model/cd_fast.c:14386:16: warning: assignment to 'void (*)(int,  double,  double *, int,  double *, int)' from incompatible pointer type 'void (*)(const int,  const double,  const double *, const int,  double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_axpy = cblas_daxpy;
                ^
sklearn/linear_model/cd_fast.c:14395:16: warning: assignment to 'double (*)(int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_dasum;
                ^
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_26enet_coordinate_descent_multi_task':
sklearn/linear_model/cd_fast.c:16260:28: warning: 'enum CBLAS_ORDER' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_ger)(enum CBLAS_ORDER, int, int, float, float *, int, float *, int, float *, int);
                            ^~~~~~~~~~~
sklearn/linear_model/cd_fast.c:16261:47: warning: 'enum CBLAS_TRANSPOSE' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
                                               ^~~~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:16261:29: warning: 'enum CBLAS_ORDER' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
                             ^~~~~~~~~~~
sklearn/linear_model/cd_fast.c:16402:15: warning: assignment to 'float (*)(int,  float *, int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_sdot;
               ^
sklearn/linear_model/cd_fast.c:16411:16: warning: assignment to 'float (*)(int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_nrm2 = cblas_snrm2;
                ^
sklearn/linear_model/cd_fast.c:16420:16: warning: assignment to 'float (*)(int,  float *, int)' from incompatible pointer type 'float (*)(const int,  const float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_sasum;
                ^
sklearn/linear_model/cd_fast.c:16429:16: warning: assignment to 'void (*)(int,  float *, int,  float *, int)' from incompatible pointer type 'void (*)(const int,  const float *, const int,  float *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_copy = cblas_scopy;
                ^
sklearn/linear_model/cd_fast.c:16447:15: warning: assignment to 'void (*)(enum CBLAS_ORDER,  int,  int,  float,  float *, int,  float *, int,  float *, int)' from incompatible pointer type 'void (*)(CBLAS_LAYOUT,  const int,  const int,  const float,  const float *, const int,  const float *, const int,  float *, const int)' {aka 'void (*)(enum <anonymous>,  const int,  const int,  const float,  const float *, const int,  const float *, const int,  float *, const int)'} [-Wincompatible-pointer-types]
   __pyx_v_ger = cblas_sger;
               ^
sklearn/linear_model/cd_fast.c:16456:16: warning: assignment to 'void (*)(enum CBLAS_ORDER,  enum CBLAS_TRANSPOSE,  int,  int,  float,  float *, int,  float *, int,  float,  float *, int)' from incompatible pointer type 'void (*)(const CBLAS_LAYOUT,  const CBLAS_TRANSPOSE,  const int,  const int,  const float,  const float *, const int,  const float *, const int,  const float,  float *, const int)' {aka 'void (*)(const enum <anonymous>,  const enum <anonymous>,  const int,  const int,  const float,  const float *, const int,  const float *, const int,  const float,  float *, const int)'} [-Wincompatible-pointer-types]
   __pyx_v_gemv = cblas_sgemv;
                ^
sklearn/linear_model/cd_fast.c:17116:27: error: type of formal parameter 1 is incomplete
               __pyx_v_ger(CblasRowMajor, __pyx_v_n_samples, __pyx_v_n_tasks, 1.0, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, __pyx_v_wii_ptr, 1, (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_34 * __pyx_v_R.strides[0]) )) + __pyx_t_35)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:17153:26: error: type of formal parameter 1 is incomplete
             __pyx_v_gemv(CblasRowMajor, CblasTrans, __pyx_v_n_samples, __pyx_v_n_tasks, 1.0, (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_36 * __pyx_v_R.strides[0]) )) + __pyx_t_37)) )))), __pyx_v_n_tasks, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, 0.0, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_tmp.data) + __pyx_t_38)) )))), 1);
                          ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:17153:41: error: type of formal parameter 2 is incomplete
             __pyx_v_gemv(CblasRowMajor, CblasTrans, __pyx_v_n_samples, __pyx_v_n_tasks, 1.0, (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_36 * __pyx_v_R.strides[0]) )) + __pyx_t_37)) )))), __pyx_v_n_tasks, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, 0.0, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_tmp.data) + __pyx_t_38)) )))), 1);
                                         ^~~~~~~~~~
sklearn/linear_model/cd_fast.c:17220:27: error: type of formal parameter 1 is incomplete
               __pyx_v_ger(CblasRowMajor, __pyx_v_n_samples, __pyx_v_n_tasks, -1.0, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, (__pyx_v_W_ptr + (__pyx_v_ii * __pyx_v_n_tasks)), 1, (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_42 * __pyx_v_R.strides[0]) )) + __pyx_t_43)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c: In function '__pyx_pf_7sklearn_12linear_model_7cd_fast_28enet_coordinate_descent_multi_task':
sklearn/linear_model/cd_fast.c:17979:28: warning: 'enum CBLAS_ORDER' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_ger)(enum CBLAS_ORDER, int, int, double, double *, int, double *, int, double *, int);
                            ^~~~~~~~~~~
sklearn/linear_model/cd_fast.c:17980:47: warning: 'enum CBLAS_TRANSPOSE' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
                                               ^~~~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:17980:29: warning: 'enum CBLAS_ORDER' declared inside parameter list will not be visible outside of this definition or declaration
   void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
                             ^~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18121:15: warning: assignment to 'double (*)(int,  double *, int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_dot = cblas_ddot;
               ^
sklearn/linear_model/cd_fast.c:18130:16: warning: assignment to 'double (*)(int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_nrm2 = cblas_dnrm2;
                ^
sklearn/linear_model/cd_fast.c:18139:16: warning: assignment to 'double (*)(int,  double *, int)' from incompatible pointer type 'double (*)(const int,  const double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_asum = cblas_dasum;
                ^
sklearn/linear_model/cd_fast.c:18148:16: warning: assignment to 'void (*)(int,  double *, int,  double *, int)' from incompatible pointer type 'void (*)(const int,  const double *, const int,  double *, const int)' [-Wincompatible-pointer-types]
   __pyx_v_copy = cblas_dcopy;
                ^
sklearn/linear_model/cd_fast.c:18166:15: warning: assignment to 'void (*)(enum CBLAS_ORDER,  int,  int,  double,  double *, int,  double *, int,  double *, int)' from incompatible pointer type 'void (*)(CBLAS_LAYOUT,  const int,  const int,  const double,  const double *, const int,  const double *, const int,  double *, const int)' {aka 'void (*)(enum <anonymous>,  const int,  const int,  const double,  const double *, const int,  const double *, const int,  double *, const int)'} [-Wincompatible-pointer-types]
   __pyx_v_ger = cblas_dger;
               ^
sklearn/linear_model/cd_fast.c:18175:16: warning: assignment to 'void (*)(enum CBLAS_ORDER,  enum CBLAS_TRANSPOSE,  int,  int,  double,  double *, int,  double *, int,  double,  double *, int)' from incompatible pointer type 'void (*)(CBLAS_LAYOUT,  CBLAS_TRANSPOSE,  const int,  const int,  const double,  const double *, const int,  const double *, const int,  const double,  double *, const int)' {aka 'void (*)(enum <anonymous>,  enum <anonymous>,  const int,  const int,  const double,  const double *, const int,  const double *, const int,  const double,  double *, const int)'} [-Wincompatible-pointer-types]
   __pyx_v_gemv = cblas_dgemv;
                ^
sklearn/linear_model/cd_fast.c:18835:27: error: type of formal parameter 1 is incomplete
               __pyx_v_ger(CblasRowMajor, __pyx_v_n_samples, __pyx_v_n_tasks, 1.0, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, __pyx_v_wii_ptr, 1, (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_34 * __pyx_v_R.strides[0]) )) + __pyx_t_35)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18872:26: error: type of formal parameter 1 is incomplete
             __pyx_v_gemv(CblasRowMajor, CblasTrans, __pyx_v_n_samples, __pyx_v_n_tasks, 1.0, (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_36 * __pyx_v_R.strides[0]) )) + __pyx_t_37)) )))), __pyx_v_n_tasks, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, 0.0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_tmp.data) + __pyx_t_38)) )))), 1);
                          ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18872:41: error: type of formal parameter 2 is incomplete
             __pyx_v_gemv(CblasRowMajor, CblasTrans, __pyx_v_n_samples, __pyx_v_n_tasks, 1.0, (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_36 * __pyx_v_R.strides[0]) )) + __pyx_t_37)) )))), __pyx_v_n_tasks, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, 0.0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_tmp.data) + __pyx_t_38)) )))), 1);
                                         ^~~~~~~~~~
sklearn/linear_model/cd_fast.c:18939:27: error: type of formal parameter 1 is incomplete
               __pyx_v_ger(CblasRowMajor, __pyx_v_n_samples, __pyx_v_n_tasks, -1.0, (__pyx_v_X_ptr + (__pyx_v_ii * __pyx_v_n_samples)), 1, (__pyx_v_W_ptr + (__pyx_v_ii * __pyx_v_n_tasks)), 1, (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_42 * __pyx_v_R.strides[0]) )) + __pyx_t_43)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~

Versions

This is Python 3.6.8, numpy 1.16.2, scikit-learn 0.20.2.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Barracuda72commented, Aug 8, 2019

It would be great if this problem was fixed. Python 2 with scikit-learn is still (still!) used by some folks here and there, not to mention massive amount of scripts written before that nobody sane enough would even consider migrating onto Python3 + scikit-learn 0.21+. As 0.20 is the last release supporting Python 2, it would be great to at least leave it in the working state for such reasons. I’m a Gentoo user and have exactly same problem; there is even bug in Gentoo bugzilla (https://bugs.gentoo.org/show_bug.cgi?id=630294) but that’s of course not Gentoo maintainers’ area of responsibility. UPD: The cause of this problem is incorrect CBLAS API of internal scikit-learn CBLAS library used in 0.20 (and probably since ever). The two enum’s, CBLAS_ORDER and CBLAS_TRANSPOSE (and all others also, but they don’t cause build errors) declared there without typedef keyword, which is required by CBLAS API (e.g. OpenBLAS, reference LAPACK). This leads to incorrect C source generation by Cython, and when this source is building against correct CBLAS implementation we’ve got that we’ve got. So, the real fix should be declaring all enums in scikit-learns’ CBLAS implementation with typedefs and regenerating C sources for *.pyx.

0reactions
rthcommented, Feb 5, 2020

Sorry, closing this as a “won’t fix” similarly to https://github.com/scikit-learn/scikit-learn/pull/14633 because we won’t make new releases for 0.20 at this point I think.

Thanks to all who contributed! Affected distribution would have to patch this on their side (which I assume was done already, if they managed to package scikit-learn).

Read more comments on GitHub >

github_iconTop Results From Across the Web

"fatal error: cblas.h: No such file or directory" when building ...
Hi, When trying to build Scipy following this tutorial, a fatal error occurs due to some problems with the cblas.h header.
Read more >
trouble running make on CBLAS - Stack Overflow
I'm trying to build a BLAS shared library for use with ghostjat/np cannot get make to ... EDIT 2: After attempting a lot...
Read more >
Why does the advanced C MEX-file example on ... - MathWorks
When I try to compile the example in the section on "Using LAPACK and BLAS Functions" in the "MATLAB External Interfaces/API" documentation, I...
Read more >
Troubleshooting — Aesara 0+untagged.50.g2434cb4.dirty ...
Why do I get a network error when I install Aesara; Why is my code so slow/uses so much memory; How to solve...
Read more >
WARNING (theano.tensor.blas): Using NumPy C-API based ...
Hello, I am trying to run a pymc3 script for parameter estimation. It is giving me these warnings: WARNING (theano.tensor.blas): Using NumPy C-API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found