uncomplicate/neanderthal

running lein repl from command prompt works, but not inside IntelliJ Idea using Cursive

erkkikeranen opened this issue · 2 comments

Hi!

I didn't find any guidance while I tried to look, but if someone could help me out with my small problem.

I am using OS X, JDK 11, Intellij Idea and Cursive. My project.clj follows the principles of Hello World example (MKL in dependencies).

If I run lein repl from command prompt (and run it in a terminal window for example), everything is fine, but If I use a Clojure REPL as Run configuration in Idea, I get this error on startup:

#error {
 :cause /private/var/folders/77/xphzkbks23q0npyyrw8j739r0000gn/T/libneanderthal-mkl-0.33.016357903437272459458.jnilib: dlopen(/private/var/folders/77/xphzkbks23q0npyyrw8j739r0000gn/T/libneanderthal-mkl-0.33.016357903437272459458.jnilib, 1): Library not loaded: @rpath/libmkl_intel_lp64.dylib
  Referenced from: /private/var/folders/77/xphzkbks23q0npyyrw8j739r0000gn/T/libneanderthal-mkl-0.33.016357903437272459458.jnilib
  Reason: image not found
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message Syntax error macroexpanding at (mkl.clj:90:35).
   :data #:clojure.error{:phase :execution, :line 90, :column 35, :source mkl.clj}
   :at [clojure.lang.Compiler$InvokeExpr eval Compiler.java 3707]}
  {:type java.lang.UnsatisfiedLinkError
   :message /private/var/folders/77/xphzkbks23q0npyyrw8j739r0000gn/T/libneanderthal-mkl-0.33.016357903437272459458.jnilib: dlopen(/private/var/folders/77/xphzkbks23q0npyyrw8j739r0000gn/T/libneanderthal-mkl-0.33.016357903437272459458.jnilib, 1): Library not loaded: @rpath/libmkl_intel_lp64.dylib
  Referenced from: /private/var/folders/77/xphzkbks23q0npyyrw8j739r0000gn/T/libneanderthal-mkl-0.33.016357903437272459458.jnilib
  Reason: image not found
   :at [java.lang.ClassLoader$NativeLibrary load0 ClassLoader.java -2]}]
 :trace
 [[java.lang.ClassLoader$NativeLibrary load0 ClassLoader.java -2]
  [java.lang.ClassLoader$NativeLibrary load ClassLoader.java 2442]
  [java.lang.ClassLoader$NativeLibrary loadLibrary ClassLoader.java 2498]
  [java.lang.ClassLoader loadLibrary0 ClassLoader.java 2694]
  [java.lang.ClassLoader loadLibrary ClassLoader.java 2627]
  [java.lang.Runtime load0 Runtime.java 768]
  [java.lang.System load System.java 1837]
  [uncomplicate.neanderthal.internal.host.NarSystem loadLibrary NarSystem.java 48]
  [uncomplicate.neanderthal.internal.host.MKL <clinit> MKL.java 16]
  [uncomplicate.neanderthal.internal.host.mkl$create_stream_ars5 invokeStatic mkl.clj 87]
  [uncomplicate.neanderthal.internal.host.mkl$create_stream_ars5 invoke mkl.clj 85]
  [clojure.lang.AFn applyToHelper AFn.java 154]
  [clojure.lang.AFn applyTo AFn.java 144]
  [clojure.lang.Compiler$InvokeExpr eval Compiler.java 3702]
  [clojure.lang.Compiler$DefExpr eval Compiler.java 457]
  [clojure.lang.Compiler eval Compiler.java 7182]
  [clojure.lang.Compiler load Compiler.java 7636]
  [clojure.lang.RT loadResourceScript RT.java 381]
  [clojure.lang.RT loadResourceScript RT.java 372]
  [clojure.lang.RT load RT.java 459]
  [clojure.lang.RT load RT.java 424]
  [clojure.core$load$fn__6839 invoke core.clj 6126]
  [clojure.core$load invokeStatic core.clj 6125]
  [clojure.core$load doInvoke core.clj 6109]
  [clojure.lang.RestFn invoke RestFn.java 408]
  [clojure.core$load_one invokeStatic core.clj 5908]
  [clojure.core$load_one invoke core.clj 5903]
  [clojure.core$load_lib$fn__6780 invoke core.clj 5948]
  [clojure.core$load_lib invokeStatic core.clj 5947]
  [clojure.core$load_lib doInvoke core.clj 5928]
  [clojure.lang.RestFn applyTo RestFn.java 142]
  [clojure.core$apply invokeStatic core.clj 667]
  [clojure.core$load_libs invokeStatic core.clj 5989]
  [clojure.core$load_libs doInvoke core.clj 5969]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.core$apply invokeStatic core.clj 667]
  [clojure.core$require invokeStatic core.clj 6007]
  [clojure.core$require doInvoke core.clj 6007]
  [clojure.lang.RestFn invoke RestFn.java 436]
  [uncomplicate.neanderthal.native$eval25924$loading__6721__auto____25925 invoke native.clj 9]
  [uncomplicate.neanderthal.native$eval25924 invokeStatic native.clj 9]
  [uncomplicate.neanderthal.native$eval25924 invoke native.clj 9]
  [clojure.lang.Compiler eval Compiler.java 7177]
  [clojure.lang.Compiler eval Compiler.java 7166]
  [clojure.lang.Compiler load Compiler.java 7636]
  [clojure.lang.RT loadResourceScript RT.java 381]
  [clojure.lang.RT loadResourceScript RT.java 372]
  [clojure.lang.RT load RT.java 459]
  [clojure.lang.RT load RT.java 424]
  [clojure.core$load$fn__6839 invoke core.clj 6126]
  [clojure.core$load invokeStatic core.clj 6125]
  [clojure.core$load doInvoke core.clj 6109]
  [clojure.lang.RestFn invoke RestFn.java 408]
  [clojure.core$load_one invokeStatic core.clj 5908]
  [clojure.core$load_one invoke core.clj 5903]
  [clojure.core$load_lib$fn__6780 invoke core.clj 5948]
  [clojure.core$load_lib invokeStatic core.clj 5947]
  [clojure.core$load_lib doInvoke core.clj 5928]
  [clojure.lang.RestFn applyTo RestFn.java 142]
  [clojure.core$apply invokeStatic core.clj 667]
  [clojure.core$load_libs invokeStatic core.clj 5985]
  [clojure.core$load_libs doInvoke core.clj 5969]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.core$apply invokeStatic core.clj 667]
  [clojure.core$require invokeStatic core.clj 6007]
  [clojure.core$require doInvoke core.clj 6007]
  [clojure.lang.RestFn invoke RestFn.java 703]
  [cljml.user$eval149$loading__6721__auto____150 invoke user.clj 1]
  [cljml.user$eval149 invokeStatic user.clj 1]
  [cljml.user$eval149 invoke user.clj 1]
  [clojure.lang.Compiler eval Compiler.java 7177]
  [clojure.lang.Compiler eval Compiler.java 7166]
  [clojure.lang.Compiler load Compiler.java 7636]
  [clojure.lang.RT loadResourceScript RT.java 381]
  [clojure.lang.RT loadResourceScript RT.java 372]
  [clojure.lang.RT load RT.java 459]
  [clojure.lang.RT load RT.java 424]
  [clojure.core$load$fn__6839 invoke core.clj 6126]
  [clojure.core$load invokeStatic core.clj 6125]
  [clojure.core$load doInvoke core.clj 6109]
  [clojure.lang.RestFn invoke RestFn.java 408]
  [clojure.core$load_one invokeStatic core.clj 5908]
  [clojure.core$load_one invoke core.clj 5903]
  [clojure.core$load_lib$fn__6780 invoke core.clj 5948]
  [clojure.core$load_lib invokeStatic core.clj 5947]
  [clojure.core$load_lib doInvoke core.clj 5928]
  [clojure.lang.RestFn applyTo RestFn.java 142]
  [clojure.core$apply invokeStatic core.clj 667]
  [clojure.core$load_libs invokeStatic core.clj 5985]
  [clojure.core$load_libs doInvoke core.clj 5969]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.core$apply invokeStatic core.clj 667]
  [clojure.core$require invokeStatic core.clj 6007]
  [clojure.core$require doInvoke core.clj 6007]
  [clojure.lang.RestFn invoke RestFn.java 408]
  [user$eval5 invokeStatic form-init7761340839661235193.clj 1]
  [user$eval5 invoke form-init7761340839661235193.clj 1]
  [clojure.lang.Compiler eval Compiler.java 7177]
  [clojure.lang.Compiler eval Compiler.java 7166]
  [clojure.lang.Compiler eval Compiler.java 7166]
  [clojure.lang.Compiler load Compiler.java 7636]
  [clojure.lang.Compiler loadFile Compiler.java 7574]
  [clojure.main$load_script invokeStatic main.clj 475]
  [clojure.main$init_opt invokeStatic main.clj 477]
  [clojure.main$init_opt invoke main.clj 477]
  [clojure.main$initialize invokeStatic main.clj 508]
  [clojure.main$null_opt invokeStatic main.clj 542]
  [clojure.main$null_opt invoke main.clj 539]
  [clojure.main$main invokeStatic main.clj 664]
  [clojure.main$main doInvoke main.clj 616]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.lang.Var applyTo Var.java 705]
  [clojure.main main main.java 40]]}
Error loading complete.core: Could not locate complete/core__init.class, complete/core.clj or complete/core.cljc on classpath.

I really don't know, as I don't use Idea. Obviously, some detail in its (default) configuration should pick up the OS environment, but it doesn't. I can confirm that for many users, it does work in Idea, so it's a matter of investigating your particular configuration.

A quick workaround is to start repl from terminal, and then connect Idea to it.

thanks. It works by connecting over network. if someone knows gotchas for running local repl in IDE, would be glad to know.