1

I am trying to run a program which is executed by running the following batch file:

@echo off

rem Add extra JVM options here

set OPTS=-Xms64m -Xmx256m

rem Build command line arguments

set CMD_LINE_ARGS=%1

if ""%1""=="""" goto doneStart

shift

:setupArgs

if ""%1""=="""" goto doneStart

set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1

shift

goto setupArgs

:doneStart

rem Launch the DCS

java %OPTS% -Djava.ext.dirs=lib -Ddcs.war=war/carrot2-dcs.war org.carrot2.dcs.DcsApp

%CMD_LINE_ARGS%

This batch file sets up the program at http://localhost:8080 (I believe it's a servlet). The program is a cluster engine similar to the one here: http://search.carrot2.org/stable/search. Everything seems to work, but I get the following command prompt output from executing the batch file.

[INFO] Starting DCS...

[INFO] Native LAPACK not available: no nni_lapack in java.library.path

[INFO] Native BLAS not available: no nni_blas in java.library.path

[INFO] DCS started on port: 8080

I managed to find the LAPACK and BLAS libraries online, but how do I add them to java.library.path (and how do I find what java.library.path points to)?

If anyone who'd like to help me needs some additional information or clarification, please let me know. I'm pretty new to java web development.

alex28
  • 552
  • 2
  • 10
  • 19

2 Answers2

2

java.library.path is used by Java to find native libraries (dlls on Windows). You need to download LAPACK and BLAS libraries somewhere (e.g. in C:\path\lapack\lib and C:\path\blas\lib). You then need to set java.library.path appropriately when you call your program. For example:

java %OPTS% -Djava.library.path=C:\path\lapack\lib;C:\path\blas\lib -Djava.ext.dirs=lib -Ddcs.war=war/carrot2-dcs.war org.carrot2.dcs.DcsApp
dogbane
  • 266,786
  • 75
  • 396
  • 414
  • Thanks for the reply. I was able to find the libraries, and they're given as java source files in an NNI package (lapack one - http://grepcode.com/file/repo1.maven.org$maven2@com.carrotsearch$nni@1.0.0@nni$LAPACK.java). Would simply pointing the path to ./nni/nni_lapack.java be acceptable? And is java.library.path basically the PATH environment variable? – alex28 Jun 23 '11 at 16:38
  • You need the dlls. A quick google found them here: http://admin.hypersource.org/downloads/amer/stable/workbench/org.carrot2.util.matrix.win32.x86/os/win32/x86/. – dogbane Jun 23 '11 at 16:42
  • Wow. I've been looking for dlls everywhere but was only able to find ones for C implementations and thought the java files were the way since that's all I could locate. I feel kinda stupid now. Thanks a ton for your help. – alex28 Jun 23 '11 at 16:54
0

You can try:

SET PATH=<path>/lapack.dll;<path>/blas.dll
Andrei Sfat
  • 8,440
  • 5
  • 49
  • 69
Hans
  • 9
  • 1
  • The `PATH` should contain the *directory* that executables or libraries are in, not the libraries themselves. – Jesper Jun 24 '11 at 09:15