Please support VectorLinux!

Author Topic: Trying to package scilab and octave  (Read 2457 times)

budulay

  • Packager
  • Vectorian
  • ****
  • Posts: 568
  • NewComer
Trying to package scilab and octave
« on: September 11, 2011, 05:05:07 pm »
Couldn't find an appropriate place to post this, so I guess I'll put it here.

I've been trying to package two Matlab alternatives for Linux, scilab and octave.
Scilab relies heavily on java, and after fighting it for a couple of days I thought it's about time to ask someone familiar with java for advice.
We have a jre package pre-installed on VL, and also a jdk(from what I understand, jdk includes jre) package in the repo. To build scilab I needed jdk, so I installed it. However, the JAVA_HOME variable still points to /usr/lib/java(that's where jre is installed), instead of /opt/java(where jdk is).
Wouldn't it make sense for jdk to overwrite the variable?

Another thing, scilab comes with an archive of prerequisites it needs at compile time(and I guess run time as well) - they include a bunch of .jar files and five .so files.
Where would it make sense to put them and how can I inform scilab where they are?

For .jar files I though I had to add the containing directory in CLASSPATH, but it's empty on VL and all my attempts to put something there didn't help(meaning .jar files still aren't detected).
Here's what I tried:
export CLASSPATH=$CLASSPATH:$CWD/$NAME-$VERSION/thirdparty

$CWD/$NAME-$VERSION/thirdparty being the directory with a bunch of .jar files.

Octave, on the other hand uses GTK, so I didn't have to deal with java, but in turn got stuck right in the hard-core stuff:
VL does not seem to include a BLAS (Basic Linear Algebra Subprograms) package, so I looked for a way to make one. The link above leads to the generic, non-optimized version of blas. However, it also points out that there are optimized versions out there:
ATLAS(Automatically Tuned Linear Algebra Soft), which gets optimized for the CPU it's compiled on. However, it doesn't seem like that great of an idea to upload a package to the repos that is only optimized for my specific CPU(especially if this package will be required to perform a lot of CPU intensive computations).
There's also ACML, which is an AMD-distributed version of BLAS(optimized for AMD CPUs). Intel also has a BLAS version called MKL, but they charge for it.

So I guess my question is, which one of these would it make more sense to build octave and scilab(I'm pretty sure scilab will need BLAS as well) against?
VL6.0-Light@MSI MS-1652(AMD TurionX2 ZM-84 2300 MHZ, 4 GB RAM, 250 GB HDD, Nvidia GForce 9600M GT, GIGABYTE AirCruiser N300)
Registered Linux user #473602
SlackBuild Repository for VL7.Not much but it's a start. Join in!

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Trying to package scilab and octave
« Reply #1 on: September 11, 2011, 06:26:58 pm »
this 2 maybe some help for u

http://vabs.archlinux-br.org/i686/community/S/scilab-5.3.1-4/
http://slackbuilds.org/repository/13.37/libraries/blas/

For the JAVA_HOME for JDK, usually i just put in the SlackBuild

Quote
export JAVA_HOME=/opt/jdk

budulay

  • Packager
  • Vectorian
  • ****
  • Posts: 568
  • NewComer
Re: Trying to package scilab and octave
« Reply #2 on: September 12, 2011, 07:07:01 pm »
Yeah, that's the way I dealt with JAVA_HOME.
Any ideas about CLASSPATH, though?

Thanks for the links, I'll check them out. I don't know much about arch build system, so I don't know if I'll be able to use the info there.
VL6.0-Light@MSI MS-1652(AMD TurionX2 ZM-84 2300 MHZ, 4 GB RAM, 250 GB HDD, Nvidia GForce 9600M GT, GIGABYTE AirCruiser N300)
Registered Linux user #473602
SlackBuild Repository for VL7.Not much but it's a start. Join in!

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Trying to package scilab and octave
« Reply #3 on: September 12, 2011, 08:19:06 pm »
You can check the arch's PKGBUILD...it have some hack on the classpath.xml...maybe that is the way arch deal with the third party .jar issue for scilab :)

budulay

  • Packager
  • Vectorian
  • ****
  • Posts: 568
  • NewComer
Re: Trying to package scilab and octave
« Reply #4 on: September 13, 2011, 07:56:36 am »
Oh well, more learning - here I go ;)
VL6.0-Light@MSI MS-1652(AMD TurionX2 ZM-84 2300 MHZ, 4 GB RAM, 250 GB HDD, Nvidia GForce 9600M GT, GIGABYTE AirCruiser N300)
Registered Linux user #473602
SlackBuild Repository for VL7.Not much but it's a start. Join in!

budulay

  • Packager
  • Vectorian
  • ****
  • Posts: 568
  • NewComer
Re: Trying to package scilab and octave
« Reply #5 on: September 16, 2011, 04:16:05 pm »
Checked out the arch's PKGBUILD. The classpath.xml mentioned there has something to do with loading different java libraries on run-time(at least I think that's what it does).
What I'm looking for is adding a directory to the classpath(I think that's what I need to do) so that java will look in there for the .jar libraries.
The way arch handles that, is they just package all the libraries and install them, which I don't want to do since scilab needs a specific version of certain packages, such as jgraphx-1_4_1_0, when the last one is 1_7_x_x. That's why I want to bundle these packages with scilab, so that updating them won't break it.
Also is there a way to do a similar thing with .so libraries?
VL6.0-Light@MSI MS-1652(AMD TurionX2 ZM-84 2300 MHZ, 4 GB RAM, 250 GB HDD, Nvidia GForce 9600M GT, GIGABYTE AirCruiser N300)
Registered Linux user #473602
SlackBuild Repository for VL7.Not much but it's a start. Join in!

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Trying to package scilab and octave
« Reply #6 on: September 16, 2011, 07:05:45 pm »
I think you need to check with scilab developer about that  ???