scalanlp / breeze

Breeze is a numerical processing library for Scala.
www.scalanlp.org
Apache License 2.0
3.44k stars 691 forks source link

Matrix-vector multiplication prints java version in stdout #849

Closed AlexGrunt closed 1 year ago

AlexGrunt commented 1 year ago

The following Code on Scala outputs return java 11 instance.

I'm using openjdk-11 and sbt 1.8.0.

# Main.scala
import breeze.linalg.{DenseMatrix, DenseVector}

object Main  extends App {
    val X = DenseMatrix((1.0, 0.0), (1.0, 1.0), (1.0, 2.0), (1.0, 3.0))
    val Y = DenseVector(0.0, 1.0)

    X * Y
}
# build.sbt
ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "2.13.10"

libraryDependencies  ++= Seq(
  "org.scalanlp" %% "breeze" % "2.1.0"
)

What is the reason for this output and how can I avoid this in my projects with Breeze?

Moreover this problem reproduces with other versions of jdk, this code always prints java version from which it was built.

AlexGrunt commented 1 year ago

Recieved answer on SO today https://stackoverflow.com/questions/74539618/matrix-vector-multiplication-prints-java-version-in-stdout

dlwh commented 1 year ago

sorry i wasn't able to get to this, but I'm glad you got it figured out!.

@luhenry looks like there are some stray printlns in your netlib...

luhenry commented 1 year ago

Indeed there is at https://github.com/luhenry/netlib/blob/b8384e002febbc96bfaef967e345ed6018014dc4/blas/src/main/java/dev/ludovic/netlib/blas/InstanceBuilder.java#L69. Let me fix it and put out a release.

luhenry commented 1 year ago

https://github.com/luhenry/netlib/releases/tag/v3.0.3 should be available in your friendly Maven Central repositories in the coming hour.

AlexGrunt commented 1 year ago

@luhenry thank you!