Error when compiling and running with javasci in Scilab 6 in Ubuntu 16.04
Reported by Chenfeng Zhu
BUG DESCRIPTION:
----------------
When I tried to compile and run javasci in Scilab 6 (https://help.scilab.org/docs/5.5.2/en_US/compile_and_run_javasci_v2.html), I was unable to run a simple application in the example. I am sorry that I have to use the document about 5.5.x instead of 6 because there are no documents for scilab 6.
I got this error: "Scilab should have 'libscijvm-disable' defined but gets 'libscijvm' instead."
ERROR LOG:
----------
Scilab startup function detected that the function proposed to the engine is the wrong one. Usually, it comes from a linker problem in your distribution/OS.
Here, Scilab should have 'libscijvm-disable' defined but gets 'libscijvm' instead.
If you do not know what it means, please report a bug on http://bugzilla.scilab.org/. If you do, you probably know that you should change the link order in SCI/modules/Makefile.am
For the record, the error happens in InitScilab.cpp:1042 : calling 'Scilab(true)' in Test.java causes getScilabMode() to return SCILAB_API and 'Scilab(false)' returns SCILAB_NWNI (=> regression from Scilab 5?).
Try to remove the one of the conditions "if (getScilabMode() != SCILAB_NWNI && getScilabMode() != SCILAB_API)", it would lead to a crash.
HOW TO REPRODUCE THE BUG:
-------------------------
in Scilab 6 of master branch, in Scilab 6.0.0-beta-1 or in eclipse with Scilab 6 of master branch:
export SCI=/usr/develop/scilab/share/scilab
export LD_LIBRARY_PATH=/usr/develop/scilab/lib/scilab:/usr/develop/scilab/lib/thirdparty
javac -cp $CLASSPATH:$SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar Test.java
java -cp $CLASSPATH:$SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar Test
class Test {
public static void main(String[] args) {
System.out.println("Start");
try {
Scilab sci = new Scilab(); // Scilab(true); doesn't work either.
sci.open();
} catch (org.scilab.modules.javasci.JavasciException e) {
System.err.println("Could not find variable type: " + e.getLocalizedMessage());
}
}
}
OTHER INFORMATION:
------------------
Ubuntu 16.04 LTS
Scilab 6 in master branch / Scilab 6.0.0-beta-1
JDK1.8
Eclipse Mars