This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-07
Channels
- # bangalore-clj (1)
- # beginners (255)
- # boot (29)
- # cider (16)
- # cljs-dev (13)
- # cljsrn (6)
- # clojure (200)
- # clojure-berlin (1)
- # clojure-dev (13)
- # clojure-dusseldorf (6)
- # clojure-greece (1)
- # clojure-india (1)
- # clojure-italy (1)
- # clojure-russia (33)
- # clojure-spec (28)
- # clojure-uk (27)
- # clojurescript (47)
- # cursive (32)
- # data-science (3)
- # datascript (1)
- # datomic (40)
- # emacs (39)
- # events (4)
- # fulcro (55)
- # graphql (16)
- # immutant (2)
- # luminus (2)
- # lumo (5)
- # off-topic (142)
- # onyx (50)
- # portkey (1)
- # re-frame (45)
- # reagent (80)
- # remote-jobs (2)
- # ring-swagger (3)
- # rum (9)
- # schema (3)
- # shadow-cljs (184)
- # spacemacs (3)
- # test-check (4)
- # unrepl (2)
- # yada (5)
So I built tensorflow JNI and now have a directory with the tensorflow JAR file and dylib files. I can't for the life of me figure out how to add this directory as part of the classpath with boot. I can't build a POM (long story, but pretty much impossible). Anyone know how to add a one-off jar to the -cp with boot?
java -cp libtensorflow.jar:clojure-1.8.0.jar clojure.main
works, but have no idea how to translate that into a boot configkanwei boot.pod/add-classpath should do it (https://github.com/boot-clj/boot/blob/master/doc/boot.pod.md#add-classpath), you can do that in your build.boot
note that if you're producing a jar or something from your build, the jar won't be in there unless you mvn install
it and then make it a proper dependency
(set-env! :resource-paths #{"/Users/kanwei/Src/tensorflow-java/libtensorflow.jar"})
(add-classpath "/Users/kanwei/src/tensorflow-java/libtensorflow.jar")
java.net.MalformedURLException: no protocol: /Users/kanwei/src/tensorflow-java/libtensorflow.jar
clojure.lang.ExceptionInfo: no protocol: /Users/kanwei/src/tensorflow-java/libtensorflow.jar
line: 6
changing it to file:///Users gives
java.lang.IllegalAccessError: Context classloader is not a DynamicClassLoader
clojure.lang.ExceptionInfo: Context classloader is not a DynamicClassLoader
line: 5
kanwei no need for the set-env! piece, just: (require '[boot.pod :as pod]) (pod/add-classpath "/Users/kanwei/Src/tensorflow-java/libtensorflow.jar")
one is in clojure.core, one is in boot.pod
the boot one isn't deprecated and does boot stuff
@alandipert another issue: I need to add
(System/setProperty "java.library.path" "/Users/kanwei/src/tensorflow-java")
as a parameter for the dylibs to load, but it doesn't work in the boot version, whereas the -Djava.library.path
method works on the CLIHi, is there a way to spawn a repl in cider for a single file boot script to execute it without a context of a project?
Can't find the info in the wiki
Ah, ok, I can just do boot repl
and jack-in
kanwei you can set BOOT_JVM_OPTIONS, eg BOOT_JVM_OPTIONS="-Djava.library.path=/Users/kanwei/src/tensorflow-java boot ...
setting it from clj is trickier, and i'm not sure works in java 9. but might still: https://github.com/boot-clj/boot/issues/185
@alandipert moving the dylib files into the root of the project folder is working
yup, it's gross
Anyone here using tools.deps
yet? Anyone looking at Boot tasks to work with that library to support external deps.edn
files?
(I'm asking to see whether there's someone to work with on this or whether I'm going to be a trail blazer 🙂 )
Hi all - I'm trying to deploy my boot project to run headless but would like to retain the opportunity to connect via remote repl to adjust config while it's running. I tried playing with the repl
task :server true
option - but it doesn't seem to be properly fitting the bill. Any guidance out there on this type of deployment? Thanks!
mattyulrich how do you deploy, as standalone uberjar? as .war?
... or is boot the entrypoint?