Donbeo
Donbeo

Reputation: 17617

sbt import local library

I am having troubles importing a local library with sbt.

This is the library that I am trying to import https://github.com/deeplearning4j/nd4s.

I have followed the instructions on github and I did sbt +publish-local.

If I understood correctly the library should now be in my local repository and I can see it as :

lucas-MacBook-Pro:~ donbeo$ cd .ivy2/local/org.nd4j/nd4s_2.1
nd4s_2.10/      nd4s_2.11/      nd4s_2.12.0-M1/ 

Now how do I import it in my project?

This is my current `build.sbt` but it is not working. 


name := "deeplearning4j-examples-scala"

version := "1.0"

scalaVersion := "2.10.4"

lazy val root = project.in(file("."))

libraryDependencies ++= Seq(
  "commons-io" % "commons-io" % "2.4",
  "com.google.guava" % "guava" % "18.0",
  "org.deeplearning4j" % "deeplearning4j-core" % "0.4-rc3.4",
  "org.deeplearning4j" % "deeplearning4j-nlp" % "0.4-rc3.4",
  "org.deeplearning4j" % "deeplearning4j-ui" % "0.4-rc3.4",
  "org.jblas" % "jblas" % "1.2.4",
  "org.nd4j" % "canova-nd4j-image" % "0.0.0.11",
  "org.nd4j" % "nd4j-jblas" % "0.4-rc3.5",
  "org.nd4j" % "nd4j-x86" % "0.4-rc3.5",
  "org.jfree" % "jfreechart" % "1.0.14",
  "com.github.wookietreiber" %% "scala-chart" % "latest.integration"
)

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

resolvers += "Sonatype release Repository" at "http://oss.sonatype.org/service/local/staging/deploy/maven2/"

resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository/"


libraryDependencies  ++= Seq(
  // other dependencies here
  "org.scalanlp" %% "breeze" % "0.11.2",
  // native libraries are not included by default. add this if you want them (as of 0.7)
  // native libraries greatly improve performance, but increase jar sizes.
  // It also packages various blas implementations, which have licenses that may or may not
  // be compatible with the Apache License. No GPL code, as best I know.
  "org.scalanlp" %% "breeze-natives" % "0.11.2",
  // the visualization library is distributed separately as well.
  // It depends on LGPL code.
  "org.scalanlp" %% "breeze-viz" % "0.11.2"
)

libraryDependencies += "com.nd4j" %% "nd4s" % "2.11" // NOT WORKING

resolvers ++= Seq(
  // other resolvers here
  // if you want to use snapshot builds (currently 0.12-SNAPSHOT), use this.
  "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
  "Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/"
)

5 lines before the end there is my attempt to import the library.

Upvotes: 2

Views: 2387

Answers (1)

kawty
kawty

Reputation: 1656

From the build.sbt, libraryDependencies should be

libraryDependencies += "org.nd4j" %% "nd4s" % "0.4-rc3"

Upvotes: 3

Related Questions