Scilab: mudanças entre as edições

De Pontão Nós Digitais
Ir para navegaçãoIr para pesquisar
(→‎Compilando: arpack)
 
(35 revisões intermediárias por 3 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


== Compilando ==
== Compiling ==


Depois de clonar o repositório do git um bom método para instalar as dependências é:  
After cloning the git repository, a good approach for installing the required dependencies is:


  $ sudo apt-get build-dep scilab
  $ sudo apt-get build-dep scilab


ou
or


  $ sudo aptitude build-dep scilab
  $ sudo aptitude build-dep scilab


Depois disso
After that,


  $ ./configure
  $ ./configure


Provavelmente faltarão algumas dependencias (Necessária versão mais recente do que a instalada)
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.


Procure na internet por elas, baixe da maneira que achar melhor (git ou .deb)  
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


Para o branch ''master'' deu pau com libjgraphx (foi pedido o 1.7.0.6, nao disponivel no Ubuntu 11.04).
The <tt>master</tt> branch also asked for updated flexdock >= 0.5.3,  jrosetta and
* Baixe do [http://www.jgraph.com/jgraphdownload.html site oficial].
jlatexmath. The <tt>graphic</tt> branch asked for scirenderer:
* Extraia, entre na pasta jgraphx/lib/
* Download them from
$ sudo cp jgraphx.jar /usr/share/java/jgraphx-1.7.0.6.jar
$ sudo ln -sf /usr/share/java/jgraphx-1.7.0.6.jar /usr/share/java/jgraphx.jar
 
O branch master tambem pediu o flexdock >= 0.5.3,  jrosetta e jlatexmath atualizados
* Baixe de:
** http://java.net/projects/flexdock/downloads
** http://java.net/projects/flexdock/downloads
** http://dev.artenum.com/projects/JRosetta
** http://dev.artenum.com/projects/JRosetta
** http://forge.scilab.org/index.php/p/jlatexmath/
** http://forge.scilab.org/index.php/p/jlatexmath
* O resto e' igual ao jgraphx.
** http://forge.scilab.org/index.php/p/scirenderer
* The remaining steps are like those given above for jgraphx.


Se reclamar da falta do 'arpack', baixe do link mostrado pelo <tt>configure</tt>, compile normalmente e instale. Digite 'ldconfig' e depois volte `a compilacao do scilab.
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


Finalmente,  
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  
  $ make  
  $ sudo make install
  $ sudo make install


Build na documentacao
Build the documentation
  $ make doc  
  $ make doc  


Aviso: isto eh demorado! tome um suco de acerola pra esperar.
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.


=== Cuidado! ===
=== Mac OS X ===
Se voce mudar de branch, p. ex. entre 5.3 e  master (6.0), e depois de dar um make obter alguns erros malucos,
These instructions were tested in Mountain Lion (10.8.3) on a early 2013 macbook pro.
nao se esqueca de dar um make distclean e comecar *tudo* de novo.


== Exemplos ==
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.


* O pacote de Scilab (autorado por C. C. Bordeianu, C. Besliu, Al. Jipa, D. Felea, I. V. Grossu ) entitulado Chaos, cujo o objetivo é o calculo de quantidades matemáticas ligadas à teoria de sistemas dinâmicos, é uma das vias práticas de compreender a linguagem Scilab. (Penalva)
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].
** [http://cpc.cs.qub.ac.uk/summaries/AEAP_v1_0.html site da distribuição].
* [[SIP]] image processing toolbox


== Hacking ==
== Hacking ==


=== Navegando o Codigo Fonte ===
=== Navigating the souce code ===


* Ver a organizacao do codigo em: http://doxygen.scilab.org/master_wg/
* See the code organization at: http://doxygen.scilab.org/master_wg/


=== Branches ===
=== Branches ===


* Estamos por default baseando no branch 5.3
* We work at the master branch (future 5.4), but you can try YaSp (future 6.x)
* Talvez seja melhor trabalharmos com o branch master (futuro 5.4) ou mesmo YaSp (futuro 6.x)
* See a description of the branches [http://wiki.scilab.org/Scilab%20branch%20policies]
* Veja uma descricao dos 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
 
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 ===
=== Debugging e Profiling ===


Veja [http://wiki.scilab.org/Debugging%20and%20Profiling%20Scilab%205 Debugging Scilab 5] na wiki do scilab.
See [http://wiki.scilab.org/Debugging%20and%20Profiling%20Scilab%205 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.


Eles sugerem o KDbg como debugger grafico, mas nao parece ter no synaptic.
=== Searching the source code ===
Portanto, o ddd continua sendo o melhor debugger grafico.
There is a simple utility <tt>scisearch</tt> to search inside scilab code,
see [[Utils]].


Ver tambem dicas de kcachegrind no blog do [[User:v1z]].
=== 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 88: 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