Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 630294 - sci-libs/scikits_learn-0.19.0 fails to build: sklearn/linear_model/cd_fast.c:18729:27: error: type of formal parameter 1 is incomplete
Summary: sci-libs/scikits_learn-0.19.0 fails to build: sklearn/linear_model/cd_fast.c:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-08 01:36 UTC by fkhp
Modified: 2020-01-03 14:33 UTC (History)
15 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge.info (emerge.info,7.30 KB, text/plain)
2017-09-08 01:41 UTC, fkhp
Details
emerge.pqv (emerge.pqv,152 bytes, text/plain)
2017-09-08 01:42 UTC, fkhp
Details
build.log (build.log,156.10 KB, text/x-log)
2017-09-08 01:42 UTC, fkhp
Details
environment (environment,154.83 KB, text/plain)
2017-09-08 01:43 UTC, fkhp
Details
emerge --info (info,7.26 KB, text/plain)
2018-01-13 04:05 UTC, fkhp
Details
emerge -pqv (pqv,149 bytes, text/plain)
2018-01-13 04:06 UTC, fkhp
Details
build.log (build.log,156.09 KB, text/x-log)
2018-01-13 04:07 UTC, fkhp
Details
environment (environment,151.03 KB, text/plain)
2018-01-13 04:08 UTC, fkhp
Details
build.log (build.log,162.49 KB, text/x-log)
2018-09-25 07:08 UTC, Maxim Koltsov (RETIRED)
Details
scikits_learn-0.19.0-r1:20190804-110908.log (scikits_learn-0.19.0-r1:20190804-110908.log,171.35 KB, text/plain)
2019-08-04 11:13 UTC, Bernd
Details
build log (scikits_learn-0.19.0-r1:20190804-214804.log,163.53 KB, text/plain)
2019-08-05 07:28 UTC, Erik Quaeghebeur
Details
Fix sklearn/linear_model/cd_fast.c build error (scikits_learn-0.20.3-fix-cdfast.patch,3.32 KB, patch)
2019-08-08 22:36 UTC, Alex
Details | Diff
scikits_learn patch for 0.19 (scikits_learn_fix_cblas.patch,1.67 KB, patch)
2019-11-15 18:57 UTC, jorgicio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fkhp 2017-09-08 01:36:09 UTC
sklearn/linear_model/cd_fast.c:18729: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_31 * __pyx_v_R.strides[0]) )) + __pyx_t_32)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18766: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_33 * __pyx_v_R.strides[0]) )) + __pyx_t_34)) )))), __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_35)) )))), 1);
                          ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18766: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_33 * __pyx_v_R.strides[0]) )) + __pyx_t_34)) )))), __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_35)) )))), 1);
                                         ^~~~~~~~~~
sklearn/linear_model/cd_fast.c:18833: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_39 * __pyx_v_R.strides[0]) )) + __pyx_t_40)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
error: Command "x86_64-pc-linux-gnu-gcc -mtune=core2 -march=core2 -O2 -msse4.1 -pipe -ffat-lto-objects -fPIC -fstack-protector-strong -fPIC -DNO_ATLAS_INFO=1 -DHAVE_CBLAS -I../src/cblas -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/refcblas -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c sklearn/linear_model/cd_fast.c -o /var/tmp/portage/sci-libs/scikits_learn-0.19.0/work/scikit-learn-0.19.0-python2_7/temp.linux-x86_64-2.7/sklearn/linear_model/cd_fast.o -MMD -MF /var/tmp/portage/sci-libs/scikits_learn-0.19.0/work/scikit-learn-0.19.0-python2_7/temp.linux-x86_64-2.7/sklearn/linear_model/cd_fast.o.d" failed with exit status 1
 * ERROR: sci-libs/scikits_learn-0.19.0::gentoo failed (compile phase):


Reproducible: Always

Steps to Reproduce:
1.emerge -va scikits_learn
2.
3.
Actual Results:  
failed

Expected Results:  
installed
Comment 1 fkhp 2017-09-08 01:41:16 UTC
Created attachment 493182 [details]
emerge.info

emerge --info '=sci-libs/scikits_learn-0.19.0::gentoo'> emerge.info
Comment 2 fkhp 2017-09-08 01:42:20 UTC
Created attachment 493184 [details]
emerge.pqv

emerge -pqv '=sci-libs/scikits_learn-0.19.0::gentoo'>emerge.pqv
Comment 3 fkhp 2017-09-08 01:42:53 UTC
Created attachment 493186 [details]
build.log
Comment 4 fkhp 2017-09-08 01:43:46 UTC
Created attachment 493188 [details]
environment
Comment 5 tastu teche 2017-09-12 20:06:49 UTC
(1)this bug is related to:
Bug 543560 - =sci-libs/scikits_learn-0.15.2 needs cblas beeing set (cblas alternatives are not set after emerge)

(2)a workaround:
<1>emerge sci-libs/gsl
<2>make sure gsl is selected in 'eselect cblas'
----------------
eselect cblas list
Installed CBLAS for library directory lib64
  [1]   gsl *
  [2]   reference
----------------
eselect cblas set 1
----------------
<3>emerge sci-libs/scikits


(3)sci-libs/gsl/gsl-2.4.ebuild does not set gsl in "eselect cblas" caused this bug,  IIUC
Comment 6 fkhp 2018-01-13 04:05:04 UTC
Created attachment 514562 [details]
emerge --info
Comment 7 fkhp 2018-01-13 04:06:00 UTC
Created attachment 514564 [details]
emerge -pqv
Comment 8 fkhp 2018-01-13 04:07:14 UTC
Created attachment 514566 [details]
build.log
Comment 9 fkhp 2018-01-13 04:08:28 UTC
Created attachment 514568 [details]
environment
Comment 10 fkhp 2018-01-13 04:11:17 UTC
sklearn/linear_model/cd_fast.c:18729: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_31 * __pyx_v_R.strides[0]) )) + __pyx_t_32)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18766: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_33 * __pyx_v_R.strides[0]) )) + __pyx_t_34)) )))), __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_35)) )))), 1);
                          ^~~~~~~~~~~~~
sklearn/linear_model/cd_fast.c:18766: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_33 * __pyx_v_R.strides[0]) )) + __pyx_t_34)) )))), __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_35)) )))), 1);
                                         ^~~~~~~~~~
sklearn/linear_model/cd_fast.c:18833: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_39 * __pyx_v_R.strides[0]) )) + __pyx_t_40)) )))), __pyx_v_n_tasks);
                           ^~~~~~~~~~~~~
error: Command "x86_64-pc-linux-gnu-gcc -mtune=core2 -march=core2 -O2 -msse4.1 -pipe -ffat-lto-objects -fPIC -fstack-protector-strong -fPIC -DNO_ATLAS_INFO=1 -DHAVE_CBLAS -I../src/cblas -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/refcblas -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c sklearn/linear_model/cd_fast.c -o /var/tmp/portage/sci-libs/scikits_learn-0.19.0/work/scikit-learn-0.19.0-python2_7/temp.linux-x86_64-2.7/sklearn/linear_model/cd_fast.o -MMD -MF /var/tmp/portage/sci-libs/scikits_learn-0.19.0/work/scikit-learn-0.19.0-python2_7/temp.linux-x86_64-2.7/sklearn/linear_model/cd_fast.o.d" failed with exit status 1
 * ERROR: sci-libs/scikits_learn-0.19.0::gentoo failed (compile phase):
Comment 11 fkhp 2018-01-13 04:13:41 UTC
same error while gsl is selected

# eselect cblas list
Available providers for cblas:
  [1]   gsl *
  [2]   reference
Comment 12 fkhp 2018-01-13 04:17:42 UTC
(In reply to tastu teche from comment #5)
> (1)this bug is related to:
> Bug 543560 - =sci-libs/scikits_learn-0.15.2 needs cblas beeing set (cblas
> alternatives are not set after emerge)
> 
> (2)a workaround:
> <1>emerge sci-libs/gsl
> <2>make sure gsl is selected in 'eselect cblas'
> ----------------
> eselect cblas list
> Installed CBLAS for library directory lib64
>   [1]   gsl *
>   [2]   reference
> ----------------
> eselect cblas set 1
> ----------------
> <3>emerge sci-libs/scikits
> 
> 
> (3)sci-libs/gsl/gsl-2.4.ebuild does not set gsl in "eselect cblas" caused
> this bug,  IIUC

emerge and select gsl is of no use.
Comment 13 François Bissey 2018-01-13 04:31:37 UTC
At least in the original log cblas reference is selected. It is also possible that you get the version of cblas numpy was compiled with. numpy keeps a record of the cblas/lapack it was installed with. It appears scikits uses numpy for a lot of things and your cblas could very well be inherited even when selecting gsl. I put that in the column "to check". You should be able to figure out from lines at the beginning of the build log
  FOUND:
    libraries = ['refblas', 'refcblas']
    library_dirs = ['/usr/lib64']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
    include_dirs = ['/usr/include/refcblas']

  FOUND:
    libraries = ['refblas', 'refcblas']
    library_dirs = ['/usr/lib64']
    define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
    language = c
    include_dirs = ['/usr/include/refcblas']

Otherwise I am not convinced yet the cblas selected is the source of the problem.
Comment 14 fkhp 2018-01-14 15:31:31 UTC
(In reply to François Bissey from comment #13)

the previous numpy and scipy packages were not compiled with gsl selected.

the problem is resolved by emerge  numpy and scipy again after select gsl, and then emerge scikits_learn.
Comment 15 fkhp 2018-01-14 15:32:39 UTC
(In reply to François Bissey from comment #13)

thank you very much!
Comment 16 Horea Christian 2018-04-12 17:48:50 UTC
I am getting the same issue (on multiple systems). Does this mean that ?=scikits_learn-0.19.0 is broken unless you have cblas gls selected?
Comment 17 Roman Yurchak 2018-09-08 08:17:58 UTC
> I am getting the same issue (on multiple systems). Does this mean that ?=scikits_learn-0.19.0 is broken unless you have cblas gls selected?


scikit-learn vendors CBLAS and in Gentoo it is removed in favour of the system one (https://github.com/gentoo/gentoo/blob/dbd129895852cbeabe59b156a29f1f1d6d0eea2c/sci-libs/scikits_learn/scikits_learn-0.19.0.ebuild#L58), this may be causing these issues.
Comment 18 Maxim Koltsov (RETIRED) gentoo-dev 2018-09-25 07:08:07 UTC
I can confirm this on new install with only cblas-reference (eselected), numpy 1.14.5, scipy 1.1.0, scikits 0.19.0.
Comment 19 Maxim Koltsov (RETIRED) gentoo-dev 2018-09-25 07:08:52 UTC
Created attachment 547856 [details]
build.log
Comment 20 Bernd 2019-08-04 11:11:57 UTC
I have the same issue with updated scikits_learn-0.19.0-r1 ebuild using the new blas/lapack settings.
Because gsl isn't eselect-ldso aware, there's no way of selecting it as a blas/cblas provider. I'm currently having openblas set for both blas/cblas and lapack providers.

artus /etc # eselect blas list
Available BLAS/CBLAS (lib) candidates:
  (none found)
Available BLAS/CBLAS (lib64) candidates:
  [1]   openblas *
  [2]   reference
artus /etc # eselect lapack list
Available LAPACK (lib) candidates:
  (none found)
Available LAPACK (lib64) candidates:
  [1]   openblas *
  [2]   reference


I had gsl installed without cblas-external USE flag set first and had the same issue. After this, I tried re-emering gsl with USE=cblas-external, rebuilt numpy and scipy but still the same.

The libraries it finds are as follows:
  FOUND:
    libraries = ['blas', 'cblas']
    library_dirs = ['/usr/lib64']
    include_dirs = ['', '/usr/include']
    language = c
    define_macros = [('HAVE_CBLAS', None)]

  FOUND:
    define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
    libraries = ['blas', 'cblas']
    library_dirs = ['/usr/lib64']
    include_dirs = ['', '/usr/include']
    language = c

What I find suspect, is that it doesn't seem to find my installed atlas-3.10.2 package, if I interpret the output correctly.
Comment 21 Bernd 2019-08-04 11:13:02 UTC
Created attachment 585656 [details]
scikits_learn-0.19.0-r1:20190804-110908.log

build log
Comment 22 Erik Quaeghebeur 2019-08-05 07:28:10 UTC
Created attachment 585748 [details]
build log

I'm seeing the same problem as Bernd.

# eselect blas list
Available BLAS/CBLAS (lib) candidates:
  (none found)
Available BLAS/CBLAS (lib64) candidates:
  [1]   blis
  [2]   openblas *
  [3]   reference
# eselect lapack list
Available LAPACK (lib) candidates:
  (none found)
Available LAPACK (lib64) candidates:
  [1]   openblas *
  [2]   reference
Comment 23 Alex 2019-08-08 22:34:51 UTC
OK, it seems I've figured it out. Here is description of what happens (duplicated from scikit-learn bugzilla):

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: https://github.com/xianyi/OpenBLAS/blob/develop/cblas.h#L49,  reference LAPACK: https://github.com/xianyi/OpenBLAS/blob/develop/lapack-netlib/CBLAS/include/cblas.h#L19). 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-learn`s' CBLAS implementation with `typedef`s and regenerating C sources for *.pyx.

But for now I propose simple patch that will fix incorrectly generated C source code. Written & tried it on 0.20.3, but should work on 0.19 also. Beware that I've also migrated to the new blas/lapack settings, so your experience may vary.
Comment 24 Alex 2019-08-08 22:36:20 UTC
Created attachment 586280 [details, diff]
Fix sklearn/linear_model/cd_fast.c build error
Comment 25 Max Kresch 2019-08-08 23:41:52 UTC
(In reply to Alex from comment #24)
> Created attachment 586280 [details, diff] [details, diff]
> Fix sklearn/linear_model/cd_fast.c build error

Thanks Alex...

I wasn't able to use the patch directly w/ 0.19-r1; however, I took the concept of removing "enum" from in front of CBLAS_ORDER and CBLAS_TRANSPOSE, and generated my own patch which allowed me to build 0.19-r1.   (Note: I have not done any sort of  runtime testing.)

If somebody wants my version of the patch I'm happy to share; however, I'm rather skeptical that it will `just work' for anyone else -- probably best to just create your own.

-Max.
Comment 26 jorgicio 2019-11-15 18:57:29 UTC
Created attachment 596282 [details, diff]
scikits_learn patch for 0.19

The comment from Alex #24 gave me the idea of creating this patch. He did it for the 0.20 version, which is not available here yet, so I adapted it to the 0.19.x. Tried here and working.
Comment 27 Thomas Haschka 2019-11-19 15:40:18 UTC
jorgicio's patch https://bugs.gentoo.org/attachment.cgi?id=596282 worked for me.
Comment 28 Andrew 2019-12-08 16:41:34 UTC
I'm affected by this with 0.19.0-r1 , and the patch does fix the problem. Mind adding it to portage tree?
Comment 29 Alex 2019-12-09 09:25:15 UTC
(In reply to Andrew from comment #28)
> I'm affected by this with 0.19.0-r1 , and the patch does fix the problem.
> Mind adding it to portage tree?

It seems that Gentoo dev team is so underhanded that they couldn't even review PR's from contributors, much less do something on their own. I advise you to create your own local repo to put custom ebuilds there. I already have about ~140 of must-have-but-cant-make-their-way-to-main-repo packages in my own...
Comment 30 Erik Quaeghebeur 2019-12-09 09:59:25 UTC
(In reply to Alex from comment #29)
>
> It seems that Gentoo dev team is so underhanded […].

I think you mean understaffed: https://www.merriam-webster.com/dictionary/underhanded

> I advise you to create your own local repo to put custom ebuilds there.

It is always useful to have a local repo. But for this package, I would advise to just put the patch in

/etc/portage/patches/sci-libs/scikits_learn-0.19.0-r1

and re-emerge.
Comment 31 Alex 2019-12-09 10:49:53 UTC
(In reply to Erik Quaeghebeur from comment #30)
> I think you mean understaffed:
> https://www.merriam-webster.com/dictionary/underhanded

Wow, thank you very much! I honestly tough that "to be underhanded" meant "to not have enough hands". My English is still not best.

> It is always useful to have a local repo. But for this package, I would
> advise to just put the patch in
> 
> /etc/portage/patches/sci-libs/scikits_learn-0.19.0-r1
> 
> and re-emerge.

Probably it's wise to also bump package version to latest 0.20, as it builds and works fine (at least for me for couple of months), and 0.20 won't make it's way into the main tree until the heat death of the Universe...
Comment 32 Alex 2019-12-09 10:52:01 UTC
(In reply to Alex from comment #31)
> Wow, thank you very much! I honestly tough that "to be underhanded" meant
> "to not have enough hands". My English is still not best.

* thought

(That's just mistype, not my English =) )
Comment 33 Patrick Lauer gentoo-dev 2019-12-29 18:25:03 UTC
Fixed in a1444fbbd220ed8e8357631a0d9d333551fea43b
(bumped to 0.20, couldn't figure out how to fix 0.19)
Comment 34 Bernd 2020-01-03 14:33:09 UTC
Thanks Patrick, the 0.20 works.