Scilab: mudanças entre as edições

De Pontão Nós Digitais
Ir para navegaçãoIr para pesquisar
Sem resumo de edição
 
(56 revisões intermediárias por 5 usuários não estão sendo mostradas)
Linha 1: Linha 1:
Scilab é uma linguagem de programação associada com uma rica coleção de algoritmos numéricos para cobrir muitos aspectos de problemas da computação científica.  
Scilab is an easy programming language associated with a rich collection of numeric
algorithms for covering most aspects of computational and scientific problems.  


== Clonando  ==


Clonando o repositório do Scilab. Ele é um projeto grande, logo será necessário baixar ~300MB só de código !
[[GSoC|[Scilab and SIP are part of Google Summer of Code 2012 - click here]]]
 
 
== Cloning ==
 
Cloning the Scilab repository. It is a large project - you will be downloading
over 300MB of code.


=== Git  ===
=== Git  ===
Linha 9: Linha 15:
  $ git clone git://git.scilab.org/scilab
  $ git clone git://git.scilab.org/scilab


<br>  
== Compiling ==
 
After cloning the git repository, a good approach for installing the required dependencies is:
 
$ sudo apt-get build-dep scilab
 
or
 
$ sudo aptitude build-dep scilab
 
After that,
 
$ ./configure
 
Probably there will be a couple of dependencies which are required to be more
recent than the installed one.  Look around the internet for them.
 
For the ''master'' branch, I had problems with libjgraphx (latest one was not available in Ubuntu 11.10).
* Download it from [http://www.jgraph.com/jgraphdownload.html official site].
* Extract and enter jgraphx/lib/
$ sudo cp jgraphx.jar /usr/share/java/jgraphx-1.9.2.5.jar
$ sudo ln -sf /usr/share/java/jgraphx-1.9.2.5.jar /usr/share/java/jgraphx.jar
 
The <tt>master</tt> branch also asked for updated flexdock >= 0.5.3,  jrosetta and
jlatexmath. The <tt>graphic</tt> branch asked for scirenderer:
* Download them from
** http://java.net/projects/flexdock/downloads
** http://dev.artenum.com/projects/JRosetta
** http://forge.scilab.org/index.php/p/jlatexmath
** http://forge.scilab.org/index.php/p/scirenderer
* The remaining steps are like those given above for jgraphx.
 
If configure complains of '''missing arpack''', download from the link shown by
<tt>configure</tt>, then compile and install it as usual. Type 'ldconfig' and
then get back to compiling Scilab. If there is still any problems related to arpack/arpack-ng,
try the dirty fixes in these bug reports:
* http://bugzilla.scilab.org/show_bug.cgi?id=10646
* http://forge.scilab.org/index.php/p/arpack-ng/issues/689/  (comment 1)
 
If the proposed solutions above do not work, you can disable the compilation of ARPACK. Instead of using ". / Configure", do this:
$ ./configure --without-arpack-ng
 
If configure complains of '''missing jogl2''', this is a recently introduced problem in Scilab master branch. See
* http://bugzilla.scilab.org/show_bug.cgi?id=11030
* You might have to compile jogl and gluegen from source by following this: http://jogamp.org/jogl/doc/HowToBuild.html
 
Finally,
$ make
$ sudo make install
 
Build the documentation
$ make doc
 
Warning: this takes a long time! go sip a cup of acerola juice while you wait.
 
 
If the run scilab this error appears on the screen:
 
"Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap","
 
To fix, do this:
$ sudo apt-get install gtk2-engines-pixbuf
 
=== Warning! ===
If you switch branches, e.g., from 5.3 and master (6.0), and then type 'make',
you will obtain some crazy random errors; do not forget to type 'make distclean'
after every branch switch ans start it *all* again.
 
=== Mac OS X ===
These instructions were tested in Mountain Lion (10.8.3) on a early 2013 macbook pro.
 
Basically follow most fink instructions from [http://wiki.scilab.org/Compiling%20Scilab%205.x%20under%20MacOSX].
Then when you run the ./configure script you might have to omit the HDF flags. Also, many of the required java
dependencies (.jar files) are met by following similar instructions to the Linux instructions above.
 
When compiling gluegen/jogl you might have to do this work-around fix for a bug in finding java:
* https://jogamp.org/bugzilla/show_bug.cgi?id=751
* Note, however, that I had to use the cheating method below because the latest jogl2 from git breaks Scilab API compatibility (gives a compile error)
 
==== Cheating: Getting dependency jar's from nightly build ====
You can download a nightly build for OS X, then install it. You can then steal the .jar's from this nightly build
to be used with your own build, for instance if configure complains of jhall our javahelp2 you can just do something like this:
sudo cp -i /Applications/scilab-master-1369319834.app/Contents/MacOS/thirdparty/jhall.jar /usr/share/java
 
==== Further dependencies ====
Certain dependencies are installed by hand.
 
* arpack-ng: I had to do the work-around edit of Makefile.am's as indicated in http://forge.scilab.org/index.php/p/arpack-ng/issues/1220/ then typing "automake" then "./configure" etc
* I used macports to install some dependencies. Some of them needed changing in order to be detected by scilab, e.g., for docbook I had to manually add a suitable path
    for dir in $with_docbook $SCI_SRCDIR_FULL/thirdparty/docbook/ /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/docbook2X/xslt/ma
  then typing autoconf prior to the next ./configure
* In Mavericks I switched compilers.. not sure if it was needed, but I was able to compile scilab by choosing gcc:
port install gcc_select
port select --list gcc
port select --set gcc mp-llvm-gcc42
 
== Using Scilab with Hybrid Graphics and Ubuntu ==
 
Hybrid Graphics is a concept where the machine works with integrated graphics and discrete graphics of a GPU at the same time (switching between the both).
Some machines and GPUs(graphical cards) are shipped with such concept, e.g. NVidia cards with Optimus Tech.
If you wanna your machine with Linux to work properly with such tech, including running programs like Scilab, until the date( ~ 07/2012) you have few options, one then is provided by the [https://wiki.ubuntu.com/Bumblebee Bumblebee Project].
 
The proper initialization of Scilab, under bumblebee daemon, is
>optirun scilab
 
Other references:
 
[http://askubuntu.com/questions/159767/nvidia-with-optimus-conflicting-in-ubuntu-12-04 NVidia Optimus Conflict in Ubuntu 12.04]
 
[https://help.ubuntu.com/community/HybridGraphics Hybrid Graphics]
 
== Examples ==
 
* The Scilab package Chaos
** [http://cpc.cs.qub.ac.uk/summaries/AEAP_v1_0.html site da distribuição].
* [[SIP]] image processing toolbox


== Compilando  ==
== Hacking ==


[http://wiki.scilab.org/Compiling%20Scilab%205.x%20under%20GNU-Linux%20Unix Passo a passo] do próprio site do Scilab
=== Navigating the souce code ===


<br>
* See the code organization at: http://doxygen.scilab.org/master_wg/


#Algumas das dependências necessárias:
=== Branches ===
#*gfortran (4:4.5.2)
#*libhdf5-serial-dev (1.8.4-patch1)
#*libncurses5-dev (5.7+20101128-1)
#*libfftw3-dev (3.2.2-1)
#*libblas-dev (1.2-8), liblapack-dev (3.3.0-3)
#*libsuitesparse-dev (1:3.4.0)
#*tcl8.4-dev (8.4.19)
#*tk8.4-dev (8.4.19-4)
#*libmatio-dev (1.3.4-2)
#*libjgraphx-java (1.4.1.0-3)
#*libjhdf5-java (2.6.1-1+b1)
#*libflexdock-java (0.5.2-dfsg1-2)
#*libjogl-java (1.1.1+dak1-9)
#*javahelp2 (2.0.05.ds1-4)
#*libjrosetta-java (1.0.2+gpl-3)
#*libjeuclid-core-java (3.1.9-1)
#*libjlatexmath-java (0.9.6-1)
#*pvm (3.4.5-12.2)
#*pvm-dev (3.4.5-12.2)
#*libxml2-dev (2.7.8)
#*libpcre3-dev (8.02-1.1)
#*docbook-xsl (1.75.2+dfsg-5)
#*libjlatexmath-fop-java (0.8.9-1)


* We work at the master branch (future 5.4), but you can try YaSp (future 6.x)
* See a description of the branches [http://wiki.scilab.org/Scilab%20branch%20policies]
* You might have to setup a '''working branch with the scilab team''' for pushes. If the agreed upon branch is, e.g., gsoc2012-interactions, then you must do:


mv .git/hooks /tmp/
cd .git/
ln -s ../git_hooks/ hooks


== Compilando v.2 (Fefo) ==
The .git/config should look like something like that (substitute your user name)


Depois de clonar o repositório do git um bom método para instalar as dependências é:
[core]
<pre>$ sudo apt-get build-dep scilab
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        '''url = ssh://sylvestre.ledru@git.scilab.org:29418/scilab'''
        push = gsoc2012-interactions:refs/for/gsoc2012-interactions
[branch "gsoc2012-interactions"]
        remote = origin
        merge = refs/heads/gsoc2012-interactions
        rebase = true


See some additional Git settings at http://wiki.scilab.org/gerrit


</pre>
=== Debugging e Profiling ===
ou
<pre>$ sudo aptitude build-dep scilab</pre>
Depois disso
<pre>$ ./configure</pre>
Provavelmente faltarão algumas dependencias (Necessária versão mais recente do que a instalada)


Procure na internet por elas, baixe da maneira que achar melhor (git ou .deb)
See [http://wiki.scilab.org/Debugging%20and%20Profiling%20Scilab%205 Debugging Scilab 5] at the Scilab wiki


Caso a dependencia que você baixou não venha com autogen.sh / configure / makefile etc.. Como foi o caso do meu libjgraphx (foi pedido o 1.7.0.6)
They suggest KDbg as a graphical debugger, but it doesn't seem to be in
synaptic. Therefore, ddd continues to be the best graphical debugger in our
opinion.


Baixe do site oficial. Extraia, entre na pasta jgraphx/lib/
Also see some useful kcachegrind tips in [[User:v1z]]'s blog.
<pre>$ sudo cp jgraphx.jar /usr/share/java
</pre>
e pronto, o jgraphx está instalado.


=== Searching the source code ===
There is a simple utility <tt>scisearch</tt> to search inside scilab code,
see [[Utils]].


=== Hacking Journal - xgetmouse ===
* xgetmouse is written in Java. The file is in scilab/modules/gui/src/java/org/scilab/modules/gui/events/Jxgetmouse.java
** '''very useful:'''  If you change Jxgetmouse.java, you only have to type "make" inside scilab/modules/gui/src. this will recompile only this part. Then you invoke './bin/scilab' inside the scilab top directory, and you're all set! No need for a time-consuming toplevel make or make install!!
* scilab core calls xgetmouse java from C++
** a JVM gets started in C++ at scilab/modules/gui/src/jni/Jxgetmouse.cpp
** developer writes the .java, as well as a .xml (scilab/modules/gui/src/jni/Jxgetmouse.giws.xml) to interface it with scilab (enabling a scilab language call xgetmouse to get java)
** the tool to get the xml and generate the .cpp and is called [http://forge.scilab.org/index.php/p/giws/page/GIWS-tutorial/ GIWS], developed by the Sciab team to ease calling Java inside C++
** there are other files which Im not sure if they are automagically generated:
*** /scilab/modules/graphics/sci_gateway/c/sci_xgetmouse.c  and  /scilab/modules/gui/includes/CallJxgetmouse.h


== Colaboradores do Lab Macambira ==
== Collaborators within Lab Macambira ==


[[Nivaldo Bondança]]  
[[Nivaldo Bondança]]  
Linha 74: Linha 196:
[[GT-Video]]  
[[GT-Video]]  


[[Category:Lab_Macambira]] [[Category:Video]]
[[Category:Lab_Macambira]] [[Category:Video]] [[Category:Java]]

Edição atual tal como às 19h30min de 24 de maio de 2016

Scilab is an easy programming language associated with a rich collection of numeric algorithms for covering most aspects of computational and scientific problems.


[Scilab and SIP are part of Google Summer of Code 2012 - click here]


Cloning

Cloning the Scilab repository. It is a large project - you will be downloading over 300MB of code.

Git

$ git clone git://git.scilab.org/scilab

Compiling

After cloning the git repository, a good approach for installing the required dependencies is:

$ sudo apt-get build-dep scilab

or

$ sudo aptitude build-dep scilab

After that,

$ ./configure

Probably there will be a couple of dependencies which are required to be more recent than the installed one. Look around the internet for them.

For the master branch, I had problems with libjgraphx (latest one was not available in Ubuntu 11.10).

$ sudo cp jgraphx.jar /usr/share/java/jgraphx-1.9.2.5.jar
$ sudo ln -sf /usr/share/java/jgraphx-1.9.2.5.jar /usr/share/java/jgraphx.jar

The master branch also asked for updated flexdock >= 0.5.3, jrosetta and jlatexmath. The graphic branch asked for scirenderer:

If configure complains of missing arpack, download from the link shown by configure, then compile and install it as usual. Type 'ldconfig' and then get back to compiling Scilab. If there is still any problems related to arpack/arpack-ng, try the dirty fixes in these bug reports:

If the proposed solutions above do not work, you can disable the compilation of ARPACK. Instead of using ". / Configure", do this:

$ ./configure --without-arpack-ng 

If configure complains of missing jogl2, this is a recently introduced problem in Scilab master branch. See

Finally,

$ make 
$ sudo make install

Build the documentation

$ make doc 

Warning: this takes a long time! go sip a cup of acerola juice while you wait.


If the run scilab this error appears on the screen:

"Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap","

To fix, do this:

$ sudo apt-get install gtk2-engines-pixbuf

Warning!

If you switch branches, e.g., from 5.3 and master (6.0), and then type 'make', you will obtain some crazy random errors; do not forget to type 'make distclean' after every branch switch ans start it *all* again.

Mac OS X

These instructions were tested in Mountain Lion (10.8.3) on a early 2013 macbook pro.

Basically follow most fink instructions from [1]. Then when you run the ./configure script you might have to omit the HDF flags. Also, many of the required java dependencies (.jar files) are met by following similar instructions to the Linux instructions above.

When compiling gluegen/jogl you might have to do this work-around fix for a bug in finding java:

Cheating: Getting dependency jar's from nightly build

You can download a nightly build for OS X, then install it. You can then steal the .jar's from this nightly build to be used with your own build, for instance if configure complains of jhall our javahelp2 you can just do something like this:

sudo cp -i /Applications/scilab-master-1369319834.app/Contents/MacOS/thirdparty/jhall.jar /usr/share/java

Further dependencies

Certain dependencies are installed by hand.

  • arpack-ng: I had to do the work-around edit of Makefile.am's as indicated in http://forge.scilab.org/index.php/p/arpack-ng/issues/1220/ then typing "automake" then "./configure" etc
  • I used macports to install some dependencies. Some of them needed changing in order to be detected by scilab, e.g., for docbook I had to manually add a suitable path
   for dir in $with_docbook $SCI_SRCDIR_FULL/thirdparty/docbook/ /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/docbook2X/xslt/ma
 then typing autoconf prior to the next ./configure
  • In Mavericks I switched compilers.. not sure if it was needed, but I was able to compile scilab by choosing gcc:
port install gcc_select
port select --list gcc
port select --set gcc mp-llvm-gcc42

Using Scilab with Hybrid Graphics and Ubuntu

Hybrid Graphics is a concept where the machine works with integrated graphics and discrete graphics of a GPU at the same time (switching between the both). Some machines and GPUs(graphical cards) are shipped with such concept, e.g. NVidia cards with Optimus Tech. If you wanna your machine with Linux to work properly with such tech, including running programs like Scilab, until the date( ~ 07/2012) you have few options, one then is provided by the Bumblebee Project.

The proper initialization of Scilab, under bumblebee daemon, is >optirun scilab

Other references:

NVidia Optimus Conflict in Ubuntu 12.04

Hybrid Graphics

Examples

Hacking

Navigating the souce code

Branches

  • We work at the master branch (future 5.4), but you can try YaSp (future 6.x)
  • See a description of the branches [2]
  • You might have to setup a working branch with the scilab team for pushes. If the agreed upon branch is, e.g., gsoc2012-interactions, then you must do:
mv .git/hooks /tmp/
cd .git/
ln -s ../git_hooks/ hooks

The .git/config should look like something like that (substitute your user name)

[core]
       repositoryformatversion = 0
       filemode = true
       bare = false
       logallrefupdates = true
[remote "origin"]
       fetch = +refs/heads/*:refs/remotes/origin/*
       url = ssh://sylvestre.ledru@git.scilab.org:29418/scilab
       push = gsoc2012-interactions:refs/for/gsoc2012-interactions
[branch "gsoc2012-interactions"]
       remote = origin
       merge = refs/heads/gsoc2012-interactions
       rebase = true

See some additional Git settings at http://wiki.scilab.org/gerrit

Debugging e Profiling

See Debugging Scilab 5 at the Scilab wiki

They suggest KDbg as a graphical debugger, but it doesn't seem to be in synaptic. Therefore, ddd continues to be the best graphical debugger in our opinion.

Also see some useful kcachegrind tips in User:v1z's blog.

Searching the source code

There is a simple utility scisearch to search inside scilab code, see Utils.

Hacking Journal - xgetmouse

  • xgetmouse is written in Java. The file is in scilab/modules/gui/src/java/org/scilab/modules/gui/events/Jxgetmouse.java
    • very useful: If you change Jxgetmouse.java, you only have to type "make" inside scilab/modules/gui/src. this will recompile only this part. Then you invoke './bin/scilab' inside the scilab top directory, and you're all set! No need for a time-consuming toplevel make or make install!!
  • scilab core calls xgetmouse java from C++
    • a JVM gets started in C++ at scilab/modules/gui/src/jni/Jxgetmouse.cpp
    • developer writes the .java, as well as a .xml (scilab/modules/gui/src/jni/Jxgetmouse.giws.xml) to interface it with scilab (enabling a scilab language call xgetmouse to get java)
    • the tool to get the xml and generate the .cpp and is called GIWS, developed by the Sciab team to ease calling Java inside C++
    • there are other files which Im not sure if they are automagically generated:
      • /scilab/modules/graphics/sci_gateway/c/sci_xgetmouse.c and /scilab/modules/gui/includes/CallJxgetmouse.h

Collaborators within Lab Macambira

Nivaldo Bondança

GT-Video