haifengl / smile

Statistical Machine Intelligence & Learning Engine
https://haifengl.github.io
Other
5.99k stars 1.12k forks source link

RidgeRegression.fit() results in error with org.bytedeco.openblas.global.openblas.LAPACKE_dpotrf #714

Closed hewitta closed 2 years ago

hewitta commented 2 years ago

When calling RidgeRegression.fit() on some test data I receive an error: java.lang.UnsatisfiedLinkError: No implementation found for int org.bytedeco.openblas.global.openblas.LAPACKE_dpotrf(int, byte, int, java.nio.DoubleBuffer, int) (tried Java_org_bytedeco_openblas_global_openblas_LAPACKE_1dpotrf and Java_org_bytedeco_openblas_global_openblas_LAPACKE_1dpotrf__IBILjava_nio_DoubleBuffer_2I) at org.bytedeco.openblas.global.openblas.LAPACKE_dpotrf(Native Method) at smile.math.blas.openblas.OpenBLAS.potrf(OpenBLAS.java:849) at smile.math.matrix.Matrix.cholesky(Matrix.java:1496) at smile.regression.RidgeRegression.fit(RidgeRegression.java:204) at smile.regression.RidgeRegression.fit(RidgeRegression.java:113)

I believe that I have all of the required dependencies added to my build.gradle file: implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.4' implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.10-1.5.4' implementation group: 'org.bytedeco', name: 'openblas-platform', version: '0.3.10-1.5.4' implementation group: 'org.bytedeco', name: 'arpack-ng', version: '3.7.0-1.5.4' implementation group: 'org.bytedeco', name: 'arpack-ng-platform', version: '3.7.0-1.5.4'

Any recommendations on how I might resolve this error?

haifengl commented 2 years ago

You should use api group, not implementation group.

hewitta commented 2 years ago

I switched them to api, resulted in same error.

haifengl commented 2 years ago

You may check kotlin/build.gradle.kts as a reference. We don't have an issue with gradle.

hewitta commented 2 years ago

I was pointed to these resources which I believe could help