uncomplicate / neanderthal

Fast Clojure Matrix Library
http://neanderthal.uncomplicate.org
Eclipse Public License 1.0
1.06k stars 56 forks source link

Solver with sv or sv! having issues #111

Closed goroda closed 3 years ago

goroda commented 3 years ago

I am having issue working with the solver capabilities. The BLAS functions are working (matrix-vector and matrix-matrix multiplication), but the LAPACK functions (such as sv) seem to be having issues.

For instance, when I run the following example from one of the blog posts

(let [a (dge 3 3 [1 0 1 1 -1 1 3 1 4])
      b (dge 3 4 [11 -2 9 3 -2 1 4 5 -6 -1 0 1])]
  (sv a b))

I obtain the following error

1. Unhandled java.lang.IllegalAccessError class uncomplicate.commons.core$eval8675$fn__8676 (in unnamed module @0x3ef3387f) cannot access class jdk.internal.ref.Cleaner (in module java.base) because module java.base does not export jdk.internal.ref to unnamed module @0x3ef3387f

My namespace import was

(ns stuff.core
  (:require [uncomplicate.fluokitten.core :refer [fmap! fold] :as flu]
            [uncomplicate.neanderthal
             [native :refer [dge dv]]
             ;; [real :refer :all]
             [core :refer [mm mv]]
             [linalg :refer [sv sv! lse]]]))

I am running

  :dependencies [[org.clojure/clojure "1.10.1"]
                 [uncomplicate/fluokitten "0.9.1"]
                 [uncomplicate/neanderthal "0.39.0"]
                 ]
;; Nvidia doesn't ship CUDA for macOS; you have to add this to your project  
  :exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
               [org.jcuda/jcublas-natives :classifier "apple-x86_64"]]
  ;; If on Java 9+, you have to uncomment the following JVM option.
  :jvm-opts ^:replace [#_"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"]
  :repl-options {:init-ns gordo-prob.core})

Thanks in advance!

blueberry commented 3 years ago

You are running on Java 9 or higher, so you have to read this comment and apply it accordingly. ;; If on Java 9+, you have to uncomment the following JVM option. :jvm-opts ^:replace [#_"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"]

goroda commented 3 years ago

thank you, thank worked