API Mode

classic Classic list List threaded Threaded
13 messages Options
Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

API Mode

Hello and sorry for the broadcast!

 

I am a new user and here is exactly what I want to do:

 

  1. I want to submit a job to the Scilab compute engine programmatically (preferably using Java or C#).

 

My questions regarding this are:

 

  1. I just need to install Scilab in the API mode, am I correct? If yes, how do I install this software in the API mode.
  2. Are there any sample available that show how one of the Scilab examples can be used for this submission?

 

Any help/pointers are much appreciated!

 

Thanks,

 

Setu

sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

Re: API Mode

Le mardi 16 juin 2009 à 02:20 -0700, Setumadhav Kulkarni a écrit :
> Hello and sorry for the broadcast!
No problem, it is the goal of this mailing list.

>      1. I just need to install Scilab in the API mode, am I correct?
>         If yes, how do I install this software in the API mode.
If you are under Windows, on the installer, disable most of the items.
Under Linux, you have to build it yourself (it is not hard) and disable
the features you don't need with --without-xxxxx
./configure --help|grep without
will give you some answer.

>      1. Are there any sample available that show how one of the Scilab
>         examples can be used for this submission?
This can be useful:
http://www.scilab.org/product/man/compile_and_run_javasci.html

If you want to call Scilab from C/C++, have a look to the call_scilab
documentation in a nightly build version of Scilab (the documentation
has been written recently on it).

Sylvestre



Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

RE: API Mode

Thanks Sylvestre!

 

The way I was approaching it is as follows:

 

1.    I just imported all the Java files (in Eclipse) from the examples in: \scilab-5.1.1\modules\javasci\examples\others\

2.    I added the javasci.jar to the build path of the project.

3.    I am thinking of compiling and running the Example1.java and hoping that it will make a call to the Scilab engine. I understand that there will be some JNI calls underneath this, to make calls to the native library that has the engine code.

 

Please correct my assumptions. Right now I have reached till step 2. I am hunting for the dll that has the entry point to the engine native code.

 

Regards,

 

Setu

 

-----Original Message-----
From: Sylvestre Ledru [mailto:[hidden email]]
Sent: Tuesday, June 16, 2009 3:33 PM
To: [hidden email]
Subject: Re: [scilab-Users] API Mode

 

Le mardi 16 juin 2009 à 02:20 -0700, Setumadhav Kulkarni a écrit :

> Hello and sorry for the broadcast!

No problem, it is the goal of this mailing list.

 

>      1. I just need to install Scilab in the API mode, am I correct?

>         If yes, how do I install this software in the API mode.

If you are under Windows, on the installer, disable most of the items.

Under Linux, you have to build it yourself (it is not hard) and disable

the features you don't need with --without-xxxxx

./configure --help|grep without

will give you some answer.

 

>      1. Are there any sample available that show how one of the Scilab

>         examples can be used for this submission?

This can be useful:

http://www.scilab.org/product/man/compile_and_run_javasci.html

 

If you want to call Scilab from C/C++, have a look to the call_scilab

documentation in a nightly build version of Scilab (the documentation

has been written recently on it).

 

Sylvestre

 

 

sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

RE: API Mode

Le mardi 16 juin 2009 à 03:08 -0700, Setumadhav Kulkarni a écrit :

> Thanks Sylvestre!
>
>  
>
> The way I was approaching it is as follows:
>
>  
>
> 1.    I just imported all the Java files (in Eclipse) from the
> examples in: \scilab-5.1.1\modules\javasci\examples\others\
>
> 2.    I added the javasci.jar to the build path of the project.

2.1 Set the SCI variable to the Scilab path (data)
2.2 Set the LD_LIBRARY_PATH or PATH to the directory containing Scilab
native libraries (ie, .so, .jnilib or .dll).
2.3 Set the LD_LIBRARY_PATH or PATH to the directory containing Java
native libraries (usually, libjava, libjvm and libhpi)

Check the help of "Compile and run with javasci" of a Scilab nightly
build for the actual path under Windows.

> 3.    I am thinking of compiling and running the Example1.java and
> hoping that it will make a call to the Scilab engine. I understand
> that there will be some JNI calls underneath this, to make calls to
> the native library that has the engine code.

S



Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

RE: API Mode

In reply to this post by sylvestre
Thanks Sylvestre!

I got it working, and I had to set PATH, SCI, SCILAB variables in my env.

:-)

-----Original Message-----
From: Sylvestre Ledru [mailto:[hidden email]]
Sent: Tuesday, June 16, 2009 3:33 PM
To: [hidden email]
Subject: Re: [scilab-Users] API Mode

Le mardi 16 juin 2009 à 02:20 -0700, Setumadhav Kulkarni a écrit :
> Hello and sorry for the broadcast!
No problem, it is the goal of this mailing list.

>      1. I just need to install Scilab in the API mode, am I correct?
>         If yes, how do I install this software in the API mode.
If you are under Windows, on the installer, disable most of the items.
Under Linux, you have to build it yourself (it is not hard) and disable
the features you don't need with --without-xxxxx
./configure --help|grep without
will give you some answer.

>      1. Are there any sample available that show how one of the Scilab
>         examples can be used for this submission?
This can be useful:
http://www.scilab.org/product/man/compile_and_run_javasci.html

If you want to call Scilab from C/C++, have a look to the call_scilab
documentation in a nightly build version of Scilab (the documentation
has been written recently on it).

Sylvestre



Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

API Mode Java version?

In reply to this post by sylvestre
Is it necessary to have Java 6 for API Mode to work?

I am bound by a limitation to use Java 5. My use case is to invoke the
sci engine from within Java code.

Thanks much!

Setu

sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

Re: API Mode Java version?

Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> Is it necessary to have Java 6 for API Mode to work?
No, Java 5 is OK too.

Sylvestre



Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

RE: API Mode Java version?

I always get:

java.lang.UnsupportedClassVersionError: Bad version number in .class file

when I try to run the sample.

Earlier, to get it working, I upgraded to Java 6, but I am bound to use Java 5.

Thanks,

Setu

-----Original Message-----
From: Sylvestre Ledru [mailto:[hidden email]]
Sent: Tuesday, June 16, 2009 10:57 PM
To: [hidden email]
Subject: Re: [scilab-Users] API Mode Java version?

Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> Is it necessary to have Java 6 for API Mode to work?
No, Java 5 is OK too.

Sylvestre



sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

RE: API Mode Java version?

Le mardi 16 juin 2009 à 10:31 -0700, Setumadhav Kulkarni a écrit :
> I always get:
>
> java.lang.UnsupportedClassVersionError: Bad version number in .class file
>
> when I try to run the sample.
>From the binary ?
If yes, Windows, Linux or Mac OS x ?

> Earlier, to get it working, I upgraded to Java 6, but I am bound to use Java 5.
Please submit a bug report. That means that we forgot an option
somewhere to make sure that the class file number version is compatible
with Java 5.

Sylvestre

> Thanks,
>
> Setu
>
> -----Original Message-----
> From: Sylvestre Ledru [mailto:[hidden email]]
> Sent: Tuesday, June 16, 2009 10:57 PM
> To: [hidden email]
> Subject: Re: [scilab-Users] API Mode Java version?
>
> Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> > Is it necessary to have Java 6 for API Mode to work?
> No, Java 5 is OK too.
>
> Sylvestre
>
>


Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

Re: API Mode Java version?

In reply to this post by Setumadhav Kulkarni
Re: [scilab-Users] API Mode Java version?

Yes,

I downloaded the binary and installed it for windows, Sylvestre.

Would you have a java 5 compatible version of javasci.jar that I could use?

----- Original Message -----
From: Sylvestre Ledru <[hidden email]>
To: [hidden email] <[hidden email]>
Sent: Tue Jun 16 10:39:11 2009
Subject: RE: [scilab-Users] API Mode Java version?

Le mardi 16 juin 2009 à 10:31 -0700, Setumadhav Kulkarni a écrit :
> I always get:
>
> java.lang.UnsupportedClassVersionError: Bad version number in .class file
>
> when I try to run the sample.
>From the binary ?
If yes, Windows, Linux or Mac OS x ?

> Earlier, to get it working, I upgraded to Java 6, but I am bound to use Java 5.
Please submit a bug report. That means that we forgot an option
somewhere to make sure that the class file number version is compatible
with Java 5.

Sylvestre

> Thanks,
>
> Setu
>
> -----Original Message-----
> From: Sylvestre Ledru [[hidden email]]
> Sent: Tuesday, June 16, 2009 10:57 PM
> To: [hidden email]
> Subject: Re: [scilab-Users] API Mode Java version?
>
> Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> > Is it necessary to have Java 6 for API Mode to work?
> No, Java 5 is OK too.
>
> Sylvestre
>
>

sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

Re: API Mode Java version?

Le mardi 16 juin 2009 à 10:42 -0700, Setumadhav Kulkarni a écrit :
> Yes,
>
> I downloaded the binary and installed it for windows, Sylvestre.
>
> Would you have a java 5 compatible version of javasci.jar that I could
> use?
I just rebuilt with java 5 and uploaded it here:
http://www.scilab.org/team/sylvestre.ledru/misc/javasci.jar

However, I advice you to wait for your bug to be fixed to use this one
in production...

Sylvestre


> ----- Original Message -----
> From: Sylvestre Ledru <[hidden email]>
> To: [hidden email] <[hidden email]>
> Sent: Tue Jun 16 10:39:11 2009
> Subject: RE: [scilab-Users] API Mode Java version?
>
> Le mardi 16 juin 2009 à 10:31 -0700, Setumadhav Kulkarni a écrit :
> > I always get:
> >
> > java.lang.UnsupportedClassVersionError: Bad version number in .class
> file
> >
> > when I try to run the sample.
> >From the binary ?
> If yes, Windows, Linux or Mac OS x ?
>
> > Earlier, to get it working, I upgraded to Java 6, but I am bound to
> use Java 5.
> Please submit a bug report. That means that we forgot an option
> somewhere to make sure that the class file number version is
> compatible
> with Java 5.
>
> Sylvestre
>
> > Thanks,
> >
> > Setu
> >
> > -----Original Message-----
> > From: Sylvestre Ledru [mailto:[hidden email]]
> > Sent: Tuesday, June 16, 2009 10:57 PM
> > To: [hidden email]
> > Subject: Re: [scilab-Users] API Mode Java version?
> >
> > Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> > > Is it necessary to have Java 6 for API Mode to work?
> > No, Java 5 is OK too.
> >
> > Sylvestre
> >
> >
>
>
>


Setumadhav Kulkarni Setumadhav Kulkarni
Reply | Threaded
Open this post in threaded view
|

RE: API Mode Java version?

Thanks Sylvestre,

But I tried this jar out and I get the following error now:

"Scilab cannot create Scilab Java Main-Class (we have not been able to find the main Scilab class. Check if the Scilab and thirdparty packages are available"

"Some problems during the loading of the Java libraries occured.
This could lead to inconsistent behaviours.
Please check SCI/etc/classpath.xml."

I guess there is still some issue with the JAR file?

Regards,

Setu

-----Original Message-----
From: Sylvestre Ledru [mailto:[hidden email]]
Sent: Wednesday, June 17, 2009 1:09 AM
To: [hidden email]
Subject: Re: [scilab-Users] API Mode Java version?

Le mardi 16 juin 2009 à 10:42 -0700, Setumadhav Kulkarni a écrit :
> Yes,
>
> I downloaded the binary and installed it for windows, Sylvestre.
>
> Would you have a java 5 compatible version of javasci.jar that I could
> use?
I just rebuilt with java 5 and uploaded it here:
http://www.scilab.org/team/sylvestre.ledru/misc/javasci.jar

However, I advice you to wait for your bug to be fixed to use this one
in production...

Sylvestre


> ----- Original Message -----
> From: Sylvestre Ledru <[hidden email]>
> To: [hidden email] <[hidden email]>
> Sent: Tue Jun 16 10:39:11 2009
> Subject: RE: [scilab-Users] API Mode Java version?
>
> Le mardi 16 juin 2009 à 10:31 -0700, Setumadhav Kulkarni a écrit :
> > I always get:
> >
> > java.lang.UnsupportedClassVersionError: Bad version number in .class
> file
> >
> > when I try to run the sample.
> >From the binary ?
> If yes, Windows, Linux or Mac OS x ?
>
> > Earlier, to get it working, I upgraded to Java 6, but I am bound to
> use Java 5.
> Please submit a bug report. That means that we forgot an option
> somewhere to make sure that the class file number version is
> compatible
> with Java 5.
>
> Sylvestre
>
> > Thanks,
> >
> > Setu
> >
> > -----Original Message-----
> > From: Sylvestre Ledru [mailto:[hidden email]]
> > Sent: Tuesday, June 16, 2009 10:57 PM
> > To: [hidden email]
> > Subject: Re: [scilab-Users] API Mode Java version?
> >
> > Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> > > Is it necessary to have Java 6 for API Mode to work?
> > No, Java 5 is OK too.
> >
> > Sylvestre
> >
> >
>
>
>


sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

RE: API Mode Java version?

Le mercredi 17 juin 2009 à 03:59 -0700, Setumadhav Kulkarni a écrit :
> Thanks Sylvestre,
>
> But I tried this jar out and I get the following error now:
>
> "Scilab cannot create Scilab Java Main-Class (we have not been able to find the main Scilab class. Check if the Scilab and thirdparty packages are available"
>
> "Some problems during the loading of the Java libraries occured.
> This could lead to inconsistent behaviours.
> Please check SCI/etc/classpath.xml."
Could you provide the full java backtrace if available ?

> I guess there is still some issue with the JAR file?
Maybe...
You can try to rebuild Scilab yourself, switch to java 1.6 or wait for
your bug to be fixed.

Sylvestre

> Regards,
>
> Setu
>
> -----Original Message-----
> From: Sylvestre Ledru [mailto:[hidden email]]
> Sent: Wednesday, June 17, 2009 1:09 AM
> To: [hidden email]
> Subject: Re: [scilab-Users] API Mode Java version?
>
> Le mardi 16 juin 2009 à 10:42 -0700, Setumadhav Kulkarni a écrit :
> > Yes,
> >
> > I downloaded the binary and installed it for windows, Sylvestre.
> >
> > Would you have a java 5 compatible version of javasci.jar that I could
> > use?
> I just rebuilt with java 5 and uploaded it here:
> http://www.scilab.org/team/sylvestre.ledru/misc/javasci.jar
>
> However, I advice you to wait for your bug to be fixed to use this one
> in production...
>
> Sylvestre
>
>
> > ----- Original Message -----
> > From: Sylvestre Ledru <[hidden email]>
> > To: [hidden email] <[hidden email]>
> > Sent: Tue Jun 16 10:39:11 2009
> > Subject: RE: [scilab-Users] API Mode Java version?
> >
> > Le mardi 16 juin 2009 à 10:31 -0700, Setumadhav Kulkarni a écrit :
> > > I always get:
> > >
> > > java.lang.UnsupportedClassVersionError: Bad version number in .class
> > file
> > >
> > > when I try to run the sample.
> > >From the binary ?
> > If yes, Windows, Linux or Mac OS x ?
> >
> > > Earlier, to get it working, I upgraded to Java 6, but I am bound to
> > use Java 5.
> > Please submit a bug report. That means that we forgot an option
> > somewhere to make sure that the class file number version is
> > compatible
> > with Java 5.
> >
> > Sylvestre
> >
> > > Thanks,
> > >
> > > Setu
> > >
> > > -----Original Message-----
> > > From: Sylvestre Ledru [mailto:[hidden email]]
> > > Sent: Tuesday, June 16, 2009 10:57 PM
> > > To: [hidden email]
> > > Subject: Re: [scilab-Users] API Mode Java version?
> > >
> > > Le mardi 16 juin 2009 à 10:25 -0700, Setumadhav Kulkarni a écrit :
> > > > Is it necessary to have Java 6 for API Mode to work?
> > > No, Java 5 is OK too.
> > >
> > > Sylvestre
> > >
> > >
> >
> >
> >
>