Create an arch linux environment (latest java environment (openjdk), install Ruby as well) (https://qiita.com/elect/items/328c28c310b385de7d23)
Next, download the jblas jar file. (From Getting Started-> Download the jar from the downloads page)
Try java -server -jar jblas-1.4.2.jar normally.
An error like this is returned
java -jar jblas-1.2.4.jar
-- org.jblas INFO jblas version is 1.2.4
Simple benchmark for jblas
Running sanity benchmarks.
checking vector addition... ok
-- org.jblas CONFIG BLAS native library not found in path. Copying native library from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG ArchFlavor native library not found in path. Copying native library libjblas_arch_flavor from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG Loading libjblas_arch_flavor.so from /lib/static/Linux/amd64/, copying to libjblas_arch_flavor.so.
-- org.jblas ERROR Couldn't load copied link file: java.lang.UnsatisfiedLinkError: /tmp/jblas5239787082843388211/libjblas_arch_flavor.so: libgfortran.so.3: cannot open shared object file: No such file or directory.
On Linux 64bit, you need additional support libraries.
You need to install libgfortran3.
For example for debian or Ubuntu, type "sudo apt-get install libgfortran3"
For more information, see
https://github.com/mikiobraun/jblas/wiki/Missing-Libraries
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.jblas.NativeBlas.dgemm(CCIIID[DII[DIID[DII)V
at org.jblas.NativeBlas.dgemm(Native Method)
at org.jblas.SimpleBlas.gemm(SimpleBlas.java:247)
at org.jblas.DoubleMatrix.mmuli(DoubleMatrix.java:1781)
at org.jblas.DoubleMatrix.mmul(DoubleMatrix.java:3138)
at org.jblas.util.SanityChecks.checkMatrixMultiplication(SanityChecks.java:91)
at org.jblas.util.SanityChecks.main(SanityChecks.java:182)
at org.jblas.benchmark.Main.main(Main.java:114)
-- org.jblas INFO Deleting /tmp/jblas5239787082843388211/libjblas_arch_flavor.so
-- org.jblas INFO Deleting /tmp/jblas5239787082843388211
In short, it means that libgfortran.so.3 cannot be found.
Install gcc-6. (yaourt -S gcc6) You will need the libgfortran.so.3 included in this
Link with sudo ln -s /usr/lib/gcc/x86_64-pc-linux-gnu/6.XX/libgfortran.so.3 /usr/lib/
(6.XX is the version name) / Paste it under usr / lib
(write it with an absolute path)
Try java -server -jar jblas-1.2.4.jar
again and it works fine
java -server -jar jblas-1.2.4.jar
-- org.jblas INFO jblas version is 1.2.4
Simple benchmark for jblas
Running sanity benchmarks.
checking vector addition... ok
-- org.jblas CONFIG BLAS native library not found in path. Copying native library from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG ArchFlavor native library not found in path. Copying native library libjblas_arch_flavor from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG Loading libjblas_arch_flavor.so from /lib/static/Linux/amd64/, copying to libjblas_arch_flavor.so.
-- org.jblas CONFIG Loading libjblas.so from /lib/static/Linux/amd64/sse3/, copying to libjblas.so.
checking matrix multiplication... ok
checking existence of dsyev...... ok
[-0.210656, -0.640445, -0.451188; -0.509085, -0.116445, 0.796815; -0.807515, 0.407556, -0.398408; 0.210656, 0.640445, -0.052780]
[17.233688; 1.414214; 0.000000]
[-0.470605, 0.782218, 0.408248; -0.571449, 0.082339, -0.816497; -0.672293, -0.617540, 0.408248]
[17.233688; 1.414214; 0.000000]
checking existence of dgesvd...... ok
Checking complex return values... (z = -21.0 + 88.0i)
Check whether we're catching XERBLA errors. If you see something like "** On entry to DGEMM parameter number 4 had an illegal value", it didn't work!
checking XERBLA... ok
Sanity checks passed.
Each benchmark will take about 5 seconds...
Running benchmark "native matrix multiplication, single precision".
n = 10 : 1.281 GFLOPS (3203374 iterations in 5.0 seconds)
n = 100 : 11.192 GFLOPS (27980 iterations in 5.0 seconds)
n = 1000 : 18.981 GFLOPS (48 iterations in 5.1 seconds)
-- org.jblas INFO Deleting /tmp/jblas6793705967272229922/libjblas.so
-- org.jblas INFO Deleting /tmp/jblas6793705967272229922/libjblas_arch_flavor.so
-- org.jblas INFO Deleting /tmp/jblas6793705967272229922
Now you can use jblas.
-clatrix Library -incanter Library etc. Matrix operations will be faster, and statistical processing, machine learning, etc. will be possible at higher speeds! Although neandertharl can calculate faster, it is a great advantage to be able to use Incanter, which has functions similar to R. I will.
I want to start machine learning, but I don't want to start from a place I don't understand! This is a book for people who say. You can learn a wide range from deriving the average to classification and regression. Also, the source code can be found at here, so if you want to see what you can do for the time being, you may want to touch it here.
Recommended Posts