https://wiki.octave.org/wiki/api.php?action=feedcontributions&user=Crobar&feedformat=atomOctave - User contributions [en]2022-05-28T14:39:01ZUser contributionsMediaWiki 1.35.5https://wiki.octave.org/wiki/index.php?title=Projects&diff=7667Projects2016-02-03T08:50:20Z<p>Crobar: /* Implement classdef classes */</p>
<hr />
<div>The list below summarizes features or bug fixes we would like to see in Octave. if you start working steadily on a project, please let octave-maintainers@octave.org know. We might have information that could help you. You should also read the [http://www.gnu.org/software/octave/doc/interpreter/Contributing-Guidelines.html#Contributing-Guidelines Contributing Guidelines chapter] in the [http://www.gnu.org/software/octave/doc/interpreter/ Octave manual].<br />
<br />
This list is not exclusive -- there are many other things that might be good projects, but it might instead be something we already have. Also, some of the following items may not actually be considered good ideas now. So please check with octave-maintainers@octave.org before you start working on some large project.<br />
<br />
Summer of Code students, please also see [[SoC Project Ideas]].<br />
<br />
If you're looking for small project, something more suited to start getting involved with Octave development or to fill a boring evening, see [[short projects]]<br />
<br />
=Numerical=<br />
<br />
*Improve logm, and sqrtm (see this thread: http://octave.1599824.n4.nabble.com/matrix-functions-td3137935.html)<br />
<br />
*Improve complex mapper functions. See W. Kahan, ``Branch Cuts for Complex Elementary Functions, or Much Ado About Nothing's Sign Bit (in The State of the Art in Numerical Analysis, eds. Iserles and Powell, Clarendon Press, Oxford, 1987) for explicit trigonometric formulae.<br />
<br />
*Make functions like gamma() return the right IEEE Inf or NaN values for extreme args or other undefined cases.<br />
<br />
*Improve sqp.<br />
<br />
*Fix CollocWt? to handle Laguerre polynomials. Make it easy to extend it to other polynomial types.<br />
<br />
*Add optional arguments to colloc so that it's not restricted to Legendre polynomials.<br />
<br />
*Fix eig to also be able to solve the generalized eigenvalue problem, and to solve for eigenvalues and eigenvectors without performing a balancing step first.<br />
<br />
*Move rand, eye, xpow, xdiv, etc., functions to the matrix classes.<br />
<br />
*Improve design of ODE, DAE, classes.<br />
<br />
*Make QR more memory efficient for large matrices when not all the columns of Q are required (apparently this is not handled by the lapack code yet).<br />
<br />
*Evaluate harmonics and cross-correlations of unevenly sampled and nonstationary time series, as in http://www.jstatsoft.org/v11/i02 (which has C code with interface to R). (This is now partly implemented in the [http://octave.sourceforge.net/lssa/index.html lssa] package.)<br />
<br />
== General purpose Finite Element library ==<br />
<br />
Octave-Forge already has a set of packages for discretizing Partial Differential operators by Finite Elements and/or Finite Volumes,<br />
namely the [[bim package]] which relies on the [http://octave.sf.net/msh msh package] (which is in turn based on [http://geuz.org/gmsh/ gmsh]) for creating and managing 2D triangular and 3D tetrahedral meshes and on the [http://octave.sf.net/fpl fpl package] for visualizing 2D results within Octave or exporting 2D or 3D results in a format compatible with [http://www.paraview.org Paraview] or [https://wci.llnl.gov/codes/visit/ VisIT]. These packages, though, offer only a limited choice of spatial discretization methods which are based on low degree polynomials and therefore have a low order of accuracy even for problems with extremely smooth solutions.<br />
The [http://geopdes.sf.net GeoPDEs] project, on the other hand, offers a complete suite of functions for discretizing a wide range of<br />
differential operators related to important physical problems and uses basis functions of arbitrary polynomial degree that allow the construction of methods of high accuracy. These latter, though, are based on the IsoGeometric Analysis Method which, although very powerful and often better performing, is less widely known and adopted than the Finite Elements Method. The implementation of a general purpose library of Finite Elements seems therefore a valuable addition to Octave-Forge. Two possible interesting choices for implementing this package exist, the first consists of implementing the most common Finite Element spaces in the [http://geopdes.sf.net GeoPDEs] framework, which is possible as IsoGeometric Analysis can be viewed as a superset of the Finite Element Method, the other is to construct Octave language bindings for the free software library [http://fenicsproject.org/documentation/ FEniCS] based on the existing C++ or Python interfaces. This second approach has been developed during the GSOC 2013 and the Octave-Forge package [http://octave.sf.net/fem-fenics fem-fenics] is now available. However, fem-fenics could be extended in many different ways:<br />
* implement the bindings for the UFL language inside Octave<br />
* add new functions already available with Fenics but not yet in Octave<br />
* create new functions specifically suited for Octave<br />
* improve the efficiency of the code<br />
The main goal for the fem-fenics package is ultimately to be merged with the FEnics project itself, so that it can remain in-sync with the main library development.<br />
<br />
== Implement solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D ==<br />
<br />
The project will deliver a solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D similar to Matlab's function <tt>pdepe</tt>. A good starting point is the [http://en.wikipedia.org/wiki/Method_of_lines method of lines] for which you can find more details [http://en.wikibooks.org/wiki/Partial_Differential_Equations/Method_of_Lines here] and [http://www.scholarpedia.org/article/Method_of_lines here], whereas an example implementation can be found [http://www.scholarpedia.org/article/Method_of_Lines/Example_Implementation here]. In addition, [http://www.pdecomp.net/ this page] provides some useful material.<br />
<br />
== Implement solver for 1D nonlinear boundary value problems ==<br />
<br />
The project will complete the implementation of the bvp4c solver that is already available in an initial version in the odepkg package<br />
by adding a proper error estimator and will implement a matlab-compatible version of the bvp5c solver.<br />
Details on the methods to be implemented can be found in [http://dx.doi.org/10.1145/502800.502801 this paper] on bvp4c and [http://www.jnaiam.net/new/uploads/files/014dde86eef73328e7ab674d1a32aa9c.pdf this paper] on bvp5c. Further details are available in [http://books.google.it/books/about/Nonlinear_two_point_boundary_value_probl.html?id=s_pQAAAAMAAJ&redir_esc=y this book].<br />
<br />
== Geometric integrators for Hamiltonian Systems ==<br />
<br />
[http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration Geometric (AKA Symplectic) integrators] are useful for <br />
multi-dimensional classical mechanics problems and for molecular dynamics simulations.<br />
The odepkg package has a number of solvers for ODE, DAE and DDE problems but none of them is currently<br />
specifically suited for second order problems in general and Hamiltonian systems in particular.<br />
Therefore a new package for geometric integrators would be a useful contribution.<br />
This could be created as new package or added as a set of new functions for odepkg.<br />
The function interface should be consistent throughout the package and should be modeled to follow <br />
that of other functions in odepkg (or that of DASPK and LSODE) but will need specific extensions to accommodate for specific options that only make sense for this specific class of solvers.<br />
An initial list of methods to be implemented includes (but is not limited to)<br />
* Symplectic Euler methods, see [http://en.wikipedia.org/wiki/Semi-implicit_Euler_method here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Störmer-Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Velocity Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Symplectic partitioned Runge-Kutta methods, see [http://reference.wolfram.com/mathematica/tutorial/NDSolveSPRK.html here] or [http://dx.doi.org/10.1137/0733019 here]<br />
* Spectral Variational Integrator methods, see [http://www3.nd.edu/~izaguirr/papers/acta_numerica.pdf here] or [http://www.math.ucsd.edu/~mleok/pdf/HaLe2012_SVI.pdf here]<br />
<br />
For this latter there is an existing code which is already working but needs to be improved, posted on the patch tracker.<br />
Furthermore, methods to implement solutions of problems with rigid constraints should be implemented, e.g.<br />
* SHAKE, see [http://en.wikipedia.org/wiki/Constraint_algorithm here] or [http://dx.doi.org/10.1016/0021-9991(77)90098-5 here]<br />
* RATTLE, see [http://dx.doi.org/10.1016/0021-9991(83)90014-1 here] or [http://dx.doi.org/10.1002/jcc.540161003 here]<br />
<br />
== Matlab-compatible ODE solvers in core-Octave ==<br />
<br />
* Adapt "odeset" and "odeget" from the odepkg package so that the list of supported options is more Matlab-compatible, in the sense that all option names that are supported by Matlab should be available. On the other hand, Matlab returns an error if an option which is not in the list of known options is passed to "odeset", but we would rather make this a warning in order to allow for special extensions, for example for symplectic integrators.<br />
* Adapt the interface of "ode45" in odepkg to be completely Matlab compatible, fix its code and documentation style and move it to Octave-core.<br />
* Build Matlab compatible versions of "ode15s" and "ode15i". jwe has prototype implementations [https://savannah.gnu.org/patch/index.php?8102|here] of these built as wrappers to "dassl" and "daspk". An initial approach could be to just improve these wrappers, but eventually it would be better to have wrappers for "IDA" from the sundials library.<br />
* Implement Matlab compatible versions of "deval".<br />
<br />
== High Precision Arithmetic Computation ==<br />
<br />
The Linear Algebra Fortran libraries used by Octave make use of of single (32 bits) and double (64 bits) precision floating point numbers. Many operations are stopped when matrices condition number goes below 1e-16: such matrices are considered as ill-conditioned. There are cases where this is not enough, for instance simulations implying chemical concentrations covering the range 10^4 up to 10^34. There are a number of ways to increase the numerical resolution, like f.i. make use of 128 bits quadruple precision numbers available in GFortran. A simpler option is to build an interface over Gnu MPL arbitrary precision library, which is used internally by gcc and should be available on any platform where gcc runs. Such approach has been made available for MatLab under the name mptoolbox and is licensed under a BSD license. The author kindly provided a copy of the latest version and agreed to have it ported under Octave and re-distributed under GPL v3.0<br />
<br />
The architecture consists of an Octave class interface implementing "mp" (multi-precision) objects. Arithmetic operations are forwarded to MPL using MEX files. This is totally transparent to the end user, except when displaying numbers. This implementation needs to be ported and tested under Octave.<br />
<br />
=GUI/IDE=<br />
<br />
:''See also: [[Summer of Code Project Ideas#GUI]]''<br />
*Søren Hauberg has suggested that we need C++ code that can:<br />
**Determine if a line of code could be fully parsed, i.e. it would return true for "plot (x, y);", but false for "while (true)".<br />
**Evaluate a line of code and return the output as a string (it would be best if it could provide three strings: output, warnings and errors).<br />
**Query defined variables, i.e. get a list of currently defined variables. Bonus points if it could tell you if anything had changed since the last time you checked the variables (could also be done with signals).<br />
**Make the links in the "Experimental GUI info" dialog box (the one that appears when the button "More Info" is pressed) clickable. They are not clickable in the 3.8.2-2 version (at least not on Windows 7).<br />
<br />
== Implement a Qt widget for manipulating plots ==<br />
<br />
Octave has had for some time a native OpenGL plotter. The plotter requires some user interaction for manipulating the plots, and it's been using fltk for quite some time. We want to replace this with Qt, so it fits better with the overall GUI look-and-feel and is easier to extend in the future.<br />
<br />
[https://github.com/goffioul/QtHandles QtHandles] is a current work in progress integrating the octave OpenGL renderer plus good support for GUI elements (uicontrol, uimenu, uitoolbar...). This project may initially consists of integrating the existing QtHandles code base into Octave. Then if time permits, further improvements can be made to QtHandles.<br />
<br />
== Create a better (G)UI for the profiler ==<br />
<br />
During GSoC 2011, Daniel Kraft successfully implemented a profiler for Octave. It needs a better interface and a way to generate reports. This may be done with Qt, but not necessarily, and HTML reports might also be good.<br />
<br />
== Sisotool. Create a graphical design tool for tuning closed loop control system (control pkg) ==<br />
<br />
When tuning a SISO feedback system it is very helpful to be able to grab a pole or a zero and move them by dragging them with the mouse. As they are moving the software must update all the plotted lines. There should be the ability to display various graphs rlocuse, bode, step, impulse etc. and have them all change dynamically as the mouse is moving. The parameters of the compensator must be displayed and updated.<br />
<br />
=Sparse Matrices=<br />
<br />
The paper by [http://arxiv.org/abs/cs.MS/0604006 Bateman & Adler] is good reading for understanding the sparse matrix implementation.<br />
<br />
*Improve QR factorization functions, using idea based on CSPARSE cs_dmsol.m<br />
<br />
*Improve QR factorization by replacing CXSPARSE code with SPQR code, and make the linear solve return 2-norm solutions for ill-conditioned matrices based on this new code<br />
<br />
*Implement fourth argument to the sprand and sprandn, and addition arguments to sprandsym that the leading brand implements.<br />
<br />
*Sparse logical indexing in idx_vector class so that something like 'a=sprandn(1e6,1e6,1e-6); a(a<1) = 0' won't cause a memory overflow.<br />
<br />
*Other missing Functions<br />
**<strike>symmmd</strike> (Superseded by symamd)<br />
**<strike>colmmd</strike> (Superseded by colamd)<br />
**<strike>cholinc (or ichol)</strike><br />
**<strike>luinc (or ilu)</strike><br />
**<strike>bicg</strike> Moved into octave-core<br />
**<strike>gmres</strike>Moved into octave-core<br />
**lsqr<br />
**minres<br />
**qmr (see [https://savannah.gnu.org/patch/?8569 Savannah Patch Tracker])<br />
**symmlq<br />
<br />
=Strings=<br />
<br />
*Consider making octave_print_internal() print some sort of text representation for unprintable characters instead of sending them directly to the terminal. (But don't do this for fprintf!)<br />
<br />
*Consider changing the default value of `string_fill_char' from SPC to NUL.<br />
<br />
=Other Data Types=<br />
<br />
*Template functions for mixed-type ops.<br />
<br />
*Convert other functions for use with the floating point type including quad, dasrt, daspk, etc.<br />
<br />
=Input/Output=<br />
<br />
*Make fread and fwrite work for complex data. Iostreams based versions of these functions would also be nice, and if you are working on them, it would be good to support other size specifications (integer*2, etc.).<br />
<br />
*Move some pr-output stuff to liboctave.<br />
<br />
*Make the cutoff point for changing to packed storage a user-preference variable with default value 8192.<br />
<br />
*Complain if there is not enough disk space available (I think there is simply not enough error checking in the code that handles writing data).<br />
<br />
*Make it possible to tie arbitrary input and output streams together, similar to the way iostreams can be tied together.<br />
<br />
*Expand {{codeline|imwrite}} options. This shouldn't be too hard to implement, since it's wrapped around GraphicsMagick.<br />
<br />
*Extend Octave functions to work on stored arrays that are too big to fit in RAM, similar to available R [http://www.bigmemory.org/ packages.]<br />
<br />
* write {{codeline|xmlread}} and {{codeline|xmlwrite}}. This could be done using [http://xerces.apache.org/xerces-c/ Xerces C++ interface] which apparently is what [http://octave.1599824.n4.nabble.com/xml-in-octave-td4663034.html Matlab uses].<br />
<br />
* Implement hdf5 for .mat files (see [http://octave.1599824.n4.nabble.com/Reading-Matlab-td4650158.html this thread]).<br />
<br />
=Interpreter=<br />
<br />
The interpreter is written in C++, undocumented. There are many possible projects associated with it.<br />
<br />
'''Required skills''': ''Very good'' C and C++ knowledge, possibly also understanding of [http://en.wikipedia.org/wiki/Gnu_bison GNU bison] and [http://en.wikipedia.org/wiki/Flex_lexical_analyser flex]. Understanding how compilers and interpreters are made plus being able to understand how to use a profiler and a debugger will probably be essential skills.<br />
<br />
*Allow customization of the debug prompt.<br />
<br />
*Fix the parser so that<br />
<br />
if (expr) 'this is a string' end<br />
<br />
is parsed as IF expr STRING END. ''(see [https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2014-March/039554.html this] post on the mailing list)''<br />
<br />
*Clean up functions in input.cc that handle user input (there currently seems to be some unnecessary duplication of code and it seems overly complex).<br />
<br />
*Consider allowing an arbitrary property list to be attached to any variable. This could be a more general way to handle the help string that can currently be added with `document'.<br />
<br />
*Allow more command line options to be accessible as built-in variables (--echo-commands, etc.).<br />
<br />
*Make the interpreter run faster.<br />
<br />
*Allow arbitrary lower bounds for array indexing.<br />
<br />
*Improve performance of recursive function calls.<br />
<br />
*Improve the way ignore_function_time_stamp works to allow selecting by individual directories or functions.<br />
<br />
*Add a command-line option to tell Octave to just do syntax checking and not execute statements.<br />
<br />
*Clean up symtab and variable stuff.<br />
<br />
*Input stream class for parser files -- must manage buffers for flex and context for global variable settings.<br />
<br />
*make parser do more semantic checking, continue after errors when compiling functions, etc.<br />
<br />
*Make LEXICAL_ERROR have a value that is the error message for parse_error() to print?<br />
<br />
*Add a run-time alias mechanism that would allow things like alias fun function_with_a_very_long_name so that `function_with_a_very_long_name' could be invoked as `fun'.<br />
<br />
*Allow local changes to variables to be written more compactly than is currently possible with unwind_protect. For example, <br />
<br />
function f ()<br />
local prefer_column_vectors = something;<br />
...<br />
endfunction<br />
<br />
<br />
would be equivalent to<br />
<br />
function f ()<br />
save_prefer_column_vectors = prefer_column_vectors;<br />
unwind_protect<br />
prefer_column_vectors = something;<br />
...<br />
unwind_protect_cleanup<br />
prefer_column_vectors = save_prefer_column_vectors;<br />
end_unwind_protect<br />
endfunction<br />
<br />
<br />
*Fix all function files to check for bogus inputs (wrong number or types of input arguments, wrong number of output arguments).<br />
<br />
*Handle options for built-in functions more consistently.<br />
<br />
*Too much time is spent allocating and freeing memory. What can be done to improve performance?<br />
<br />
*Error output from Fortran code is ugly. Something should be done to make it look better.<br />
<br />
*It would be nice if output from the Fortran routines could be passed through the pager.<br />
<br />
*Attempt to recognize common subexpressions in the parser.<br />
<br />
*Consider making it possible to specify an empty matrix with a syntax like [](e1, e2). Of course at least one of the expressions must be zero...<br />
<br />
*Is Matrix::fortran_vec() really necessary?<br />
<br />
*Rewrite whos and the symbol_record_info class. Write a built-in function that gives all the basic information, then write who and whos as M-files.<br />
<br />
*On systems that support matherr(), make it possible for users to enable the printing of warning messages.<br />
<br />
*Make it possible to mark variables and functions as read-only.<br />
<br />
*Make it possible to write a function that gets a reference to a matrix in memory and change one or more elements without generating a second copy of the data.<br />
<br />
*Use nanosleep instead of usleep if it is available? Apparently nanosleep is to be preferred over usleep on Solaris systems.<br />
<br />
*<strike>Per the following discussion, allow bsxfun style singleton dimension expansion as the default behavior for the builtin element-wise operators: http://octave.1599824.n4.nabble.com/Vector-approach-to-row-margin-frequencies-tp1636361p1636367.html</strike> This is done. <strike>Now [[User:JordiGH|I]] just have to document it.</strike> This is done too!<br />
<br />
== Improve JIT compiling ==<br />
<br />
Octave's interpreter is ''very'' slow on some loops. Recently, thanks to Max Brister's work, an initial implementation of a just-in-time compiler (JITC) in [http://llvm.org LLVM] for GSoC 2012. This project consists in understanding Max's current implementation and extending it so that functions and exponents (e.g. 2^z) compile with the JITC. This requires knowledge of compilers, C++, LLVM, and the Octave or Matlab languages. A capable student who demonstrates the ability to acquire this knowledge quickly may also be considered. Max himself will mentor this project. [http://planet.octave.org/octconf2012/jit.pdf Here] is Max's OctConf 2012 presentation about his current implementation. See also [[JIT]].<br />
<br />
== Improve memory management ==<br />
<br />
From profiling the interpreter, it appears that a lot of time is spending allocating and deallocating memory. A better memory management algorithm might provide some improvement.<br />
<br />
== Implement classdef classes ==<br />
<br />
Matlab has two kinds of classes: old style @classes and new style classdef. Octave has only fully implemented the old style. There is partial support for classdef classes in version 4.0, refer to the [[Classdef|classdef status page]] for what is not yet implemented. There is irregular work here, and classdef is [http://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html a very] [http://www.mathworks.com/help/matlab/events-sending-and-responding-to-messages.html complicated] [http://www.mathworks.com/help/matlab/enumeration-classes.html thing] to fully implement. A successful project would be to implement enough of classdef for most basic usages. Familiarity with Matlab's current classdef support would be a huge plus. Michael Goffioul and jwe can mentor this.<br />
<br />
Although there's already a substantial classdef support in current octave code base, there are still many areas that are unimplemented or need improvements. The main ones that come to my mind are:<br />
* support for events<br />
* support for enums<br />
* support for "import" (this requires good understanding of octave internals, especially the symbol table)<br />
* improving multiple inheritance and method resolution<br />
* honoring and computing "Sealed" attribute<br />
* support for function handle to methods<br />
<br />
== Improve MPI package ==<br />
<br />
Octave Forge's [http://octave.sourceforge.net/mpi/index.html MPI package] <br />
is a wrapper for basic MPI functions for parallel computing. It is implemented <br />
by wrapping MPI function calls in simple DLD functions that map Octave's Datataypes to <br />
MPI Derived Datatypes. <br />
The proposed project deals with improving and extending the Octave MPI package, for example:<br />
* Octave MPI applications can currently be only run in batch mode, add the ability to launch parallel jobs and collect their output in an interactive Octave session.<br />
* Implement functions for non-blocking communication (MPI_Isend, MPI_Irecv)<br />
* Implement one-to-many (Broadcast, Scatter), many-to-one (Reduce, Gather), and many-to-many (All Reduce, Allgather) communication routines<br />
<br />
=Graphics=<br />
<br />
*Correctly handle case where DISPLAY is unset. Provide --no-window-system or --nodisplay (?) option. Provide --display=DISPLAY option? How will this work with gnuplot (i.e., how do we know whether gnuplot requires an X display to display graphics)?<br />
<br />
* Implement transparency and lighting in OpenGL backend(s). A basic implementation was available in [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/jhandles/ JHandles]. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of octave.<br />
<br />
* Implement a Cairo-based renderer for 2D-only graphics, with support for PS/PDF/SVG output (for printing).<br />
<br />
* On 'imagesc' plots, report the matrix values also based on the mouse position, updating on mouse moving.<br />
<br />
* Create a "getframe" function that receives a a graphics handle and returns a 3D matrix from the graphics window associated with that handle.<br />
<br />
* Add map-creating capabilities similar to the Matlab [http://www.mathworks.com/help/map/functionlist.html Mapping toolbox] for inclusion in the Octave Forge [https://sourceforge.net/p/octave/mapping mapping package].<br />
<br />
* Add data cursor to trace data values in figure.<br />
<br />
== Lighting ==<br />
<br />
Implement transparency and lighting in OpenGL backend(s). A basic implementation is available in [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/jhandles/ JHandles]. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of Octave.<br />
<br />
== Object selection in OpenGL renderer ==<br />
<br />
This project is about the implementation of a selection method of graphics elements within the OpenGL renderer [http://glprogramming.com/red/chapter13.html]<br />
<br />
== Non-OpenGL renderer ==<br />
<br />
Besides the original gnuplot backend, Octave also contains an OpenGL-based renderer for advanced and more powerful 3D plots. However, OpenGL is not perfectly suited for 2D-only plots where other methods could result in better graphics. The purpose of this project is to implement an alternate graphics renderer for 2D only plots (although 3D is definitely not the focus, extending the new graphics renderer to support basic 3D features should also be taken into account). There is no particular toolkit/library that must be used, but natural candidates are:<br />
* [http://qt.nokia.com Qt]: the GUI is currently written in Qt and work is also in progress to provide a Qt/OpenGL based backend [https://github.com/goffioul/QtHandles]<br />
* [http://en.wikipedia.org/wiki/Cairo_%28software%29 Cairo]: this library is widely used and known to provides high-quality graphics with support for PS/PDF/SVG output.<br />
<br />
== TeX/LaTeX markup ==<br />
<br />
Text objects in plots (like titles, labels, texts...) in the OpenGL renderer only support plain text mode without any formatting possibility. Support for TeX and/or LaTeX formatting needs to be added.<br />
<br />
* The TeX formatting support actually only consists of a very limited subset of the TeX language. This can be implemented directly in C++ into Octave by extending the existing text engine, avoiding to add a dependency on a full TeX system. Essentially, support for Greek letters, super/sub-scripts, and several mathematical symbols needs to be supported. For example,<br />
<br />
:<pre>\alpha \approx \beta_0 + \gamma^\chi</pre><br />
<br />
:Would be rendered as,<br />
<br />
:&alpha; &asymp; &beta;<sub>0</sub> + &gamma;<sup>&chi;</sup><br />
<br />
:This is analogous to how special characters may be included in a wiki using html.<br />
<br />
:<pre>&amp;alpha; &amp;asymp; &amp;beta;<sub>0</sub> + &amp;gamma;<sup>&amp;chi;</sup></pre><br />
<br />
:The text object's {{Codeline|extent}} for the rendered result needs to be calculated and the text placed the location specified by the text object's {{Codeline|position}} property. An itemized list of a text objects properties can be found [http://www.gnu.org/software/octave/doc/interpreter/Text-Properties.html here].<br />
<br />
* On the other hand, the LaTeX formatting support is expected to provide full LaTeX capabilities. This will require to use an external LaTeX system to produce text graphics in some format (to be specified) that is then integrated into Octave plots.<br />
<br />
:The matplotlib project [http://matplotlib.sourceforge.net/users/usetex.html has already done this in Python] and might be used as an example of how to do this in Octave. Mediawiki has also also done [http://en.wikipedia.org/wiki/Wikipedia:Texvc something similar]. There is also [http://forge.scilab.org/index.php/p/jlatexmath/ JLaTeXMath], a Java API to display LaTeX code in mathematical mode.<br />
<br />
=History=<br />
<br />
*Add an option to allow saving input from script files in the history list.<br />
<br />
*The history command should accept two numeric arguments to indicate a range of history entries to display, save or read.<br />
<br />
*Avoid writing the history file if the history list has not changed.<br />
<br />
*Avoid permission errors if the history file cannot be opened for writing.<br />
<br />
*Fix history problems — core dump if multiple processes are writing to the same history file?<br />
<br />
=Configuration and Installation=<br />
<br />
*Split config.h into a part for Octave-specific configuration things (this part can be installed) and the generic HAVE_X type of configure information that should not be installed.<br />
<br />
*Makefile changes:<br />
**eliminate for loops<br />
**define shell commands or eliminate them<br />
**consolidate targets<br />
<br />
*Create a docs-only distribution?<br />
<br />
*Better binary packaging and distribution, especially on Windows.<br />
<br />
*Octave Emacs mode needs maintenance.<br />
<br />
*Convert build system to a non-recursive Automake setup. See how Makefile.am files currently include module.mk files in subdirectories, extend this concept to the entire project so there is only one top-level Makefile.am.<br />
<br />
=Documentation and On-Line Help=<br />
<br />
*Document new features.<br />
<br />
*Improve the Texinfo Documentation for the interpreter. It would be useful to have lots more examples, to not have so many forward references, and to not have very many simple lists of functions.<br />
<br />
*The docs should mention something about efficiency and that using array operations is almost always a good idea for speed.<br />
<br />
*Doxygen documentation for the C++ classes.<br />
<br />
*Make index entries more consistent to improve behavior of `help -i'.<br />
<br />
*Make `help -i' try to find a whole word match first.<br />
<br />
*Clean up help stuff.<br />
<br />
*Demo files.<br />
<br />
*Document C++ sources, to make it easier for newcomers to get into writing code.<br />
<br />
*Flesh out this wiki<br />
<br />
=Tests=<br />
*Improved set of tests: [http://octave.1599824.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=370633]<br />
**Tests for various functions. Would be nice to have a test file corresponding to every function (see below)<br />
**Tests for element by element operators: + - .* ./ .\ .^ | & < <= == >= > != !<br />
**Tests for boolean operators: && ||<br />
**Tests for other operators: * / \ ' .'<br />
**Tests from bug reports.<br />
**Tests for indexed assignment. Need to consider the following:<br />
***fortran-style indexing<br />
***zero-one indexing<br />
***assignment of empty matrix as well as values resizing<br />
**Tests for all internal functions.<br />
<br />
* Implement a coverage tool for collecting coverage data and generating code coverage reports on m-file functions and scripts. This would be very useful for Octave development as well as for users who want a code coverage report for their own functions and scripts.<br />
<br />
We are far from even having one test for every function, so focus should be on getting the breadth of coverage first before trying to get the depth of 100% statement coverage. As of Dec 2015, 202 of 1020 m-files have no tests. Some of these will be plotting functions which have demos instead, but that leaves enough functions to be an interesting project. As of Dec 2015, there are 485 instances of C++ functions which need tests.<br />
<br />
After Octave is compiled, running the {{Codeline|make check}} build target will run the full test suite and generate a file called test/fntests.log in the build directory with a summary of the results. At the end of the file is a list of all functions for which no tests were found. An extract is posted in the [[files missing tests]] page. If you are not building Octave yourself, the test suite can be run on an installed binary copy by executing the {{Codeline|__run_test_suite__}} command at the Octave prompt. The fntests.log file will be written in the current directory in this case.<br />
<br />
There also need to be tests for functions written in the C++ files. See [[Add_BIST_tests_for_octave_functions_written_in_C%2B%2B]] for instructions and a list of instances.<br />
<br />
See also [[Continuous Build#Coverage Report]].<br />
<br />
=Programming=<br />
<br />
*Add support for listeners (addlistener, dellistener, etc) on the C++ side.<br />
<br />
*C++ namespace for Octave library functions.<br />
<br />
*Better error messages for missing operators?<br />
<br />
*Eliminate duplicate enums in pt-exp.cc, pt-const.cc, and ov.cc.<br />
<br />
*Handle octave_print_internal() stuff at the liboctave level. Then the octave_value classes could just call on the print() methods for the underlying classes.<br />
<br />
*As much as possible, eliminate explicit checks for the types of octave_value objects so that user-defined types will automatically do the right thing in more cases.<br />
<br />
*Only include config.h in files that actually need it, instead of including it in every .cc file. Unfortunately, this might not be so easy to figure out.<br />
<br />
*GNU coding standards:<br />
**Add a `Makefile' target to the Makefiles.<br />
**Comments on #else and #endif preprocessor commands.<br />
**Change error message format to match standards everywhere.<br />
<br />
*Eliminate more global variables.<br />
<br />
*Move procstream to liboctave.<br />
<br />
*Use references and classes in more places.<br />
<br />
*Share more code among the various _options functions.<br />
<br />
*Use non-empty identifiers in all warnings and errors issued by Octave, see [[Easy projects#Miscellaneous]].<br />
<br />
*Reduce the amount of datatypes in liboctave [[Project liboctave 4.2]]<br />
<br />
=Miscellaneous=<br />
<br />
*Implement some functions for interprocess communication: bind, accept, connect, gethostbyname, etc. (This functionality is already available in the octave sockets package, what is the purpose of moving it to core octave?)<br />
<br />
*The ability to transparently handle very large files: Juhana K Kouhia <kouhia@nic.funet.fi> wrote:<br />
*: If I have a one-dimensional signal data with the size 400 Mbytes, then what are my choices to operate with it:<br />
*:*I have to split the data<br />
*:*Octave has a virtual memory on its own and I don't have to worry about the splitting.<br />
*:If I split the data, then my easily programmed processing programs will become hard to program.<br />
*:If possible, I would like to have the virtual memory system in Octave i.e., the all big files, the user see as one big array or such. There could be several user selectable models to do the virtual memory depending on what kind of data the user have (1d, 2d) and in what order they are processed (stream or random access).<br />
<br />
*An interface to gdb. Michael Smolsky <fnsiguc@weizmann.weizmann.ac.il> wrote:<br />
*:I was thinking about a tool, which could be very useful for me in my numerical simulation work. It is an interconnection between gdb and octave. We are often managing very large arrays of data in our fortran or c codes, which might be studied with the help of octave at the algorithm development stages. Assume you're coding, say, wave equation. And want to debug the code. It would be great to pick some array from the memory of the code you're developing, fft it and see the image as a log-log plot of the spectral density. I'm facing similar problems now. To avoid high c-development cost, I develop in matlab/octave, and then rewrite into c. It might be so much easier, if I could off-load a c array right from the debugger into octave, study it, and, perhaps, change some [many] values with a convenient matlab/octave syntax, similar to <code>a(:,50:250)=zeros(100,200)</code>, and then store it back into the memory of my c code.<br />
<br />
*Implement gdb extensions for Octave types. Octave has the <code>etc/gdbinit</code> file, which has some basic support for displaying the contents of Octave types. Add more extensions to make it easier to debug octave_values and other Octave types.<br />
<br />
*Add a definition to lgrind so that it supports Octave. (See http://www.tex.ac.uk/tex-archive/support/lgrind/ for more information about lgrind.)<br />
<br />
*Spatial statistics, including covariogram estimation and kriging -- perhaps via an interface to [http://www.gstat.org/ gstat]?<br />
<br />
* the [http://octave.sourceforge.net/miscellaneous/function/units.html units] function from the miscellaneous package works by parsing the output of from a call to GNU units. This can be made much more robust by writing it in C++ and including its library "units.h"<br />
<br />
=Marketing and Community=<br />
<br />
*Make the website prettier. Maybe a new design, maybe a more "corporate" design (if we're heading down the "paid support for Octave" path.<br />
<br />
** FusionForge's "Submit a Snippet" and "Create A Package" would seem to be directly usable for Agora's "Post a Snippet" and "Share your Code", respectively: https://alioth.debian.org/snippet/. It is FLOSS.<br />
** ScipyCentral, http://scipy-central.org/ has all the features we need and is also free software. <br />
<br />
*Move [http://octave.sourceforge.net/ Octave-Forge] to [http://savannah.gnu.org/projects/octave/ Savannah] so everything is hosted in the same place.<br />
<br />
*For ideas, see the [http://openoffice.apache.org/orientation/intro-marketing.html Apache Open Office Introduction to Marketing]<br />
<br />
* Help design a user or a developer survey [http://www.openoffice.org/marketing/ooocon2006/presentations/wednesday_c10.pdf]<br />
<br />
* Help prepare and deliver presentations about Octave at colleges and universities.<br />
<br />
== Finish the Agora website ==<br />
<br />
In 2009, the Mathworks decided to restrict the terms of use Matlab Central, a place dedicated to Matlab collaboration. The Mathworks forbade copyleft licenses and using the "free" code found in Matlab central on anything other than Mathworks products (e.g. forbidding from using it on Octave, even if the authors of the code wanted to allow this). Thus Octave users have no place to centrally, quickly, and conveniently share Octave code. See the [[FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21|FAQ]] for more details.<br />
<br />
In response to this, a website started to form, [http://agora.octave.org/ Agora Octave].<br />
<br />
This should be relatively easy webdev in Python using [http://en.wikipedia.org/wiki/Django_%28web_framework%29 Django].<br />
<br />
Things to be considered when working on this:<br />
<br />
* [http://octave-forge.blogspot.ie/2012/08/octconf2012-agora-and-pkg.html discussion of Agora during OctConf2012]<br />
* [http://scipy-central.org/ Scipy Central] - a website with the same objective as Agora for Scipy. Their [https://github.com/scipy/SciPyCentral Code] is released under a BSD license. Might be useful to reuse some parts.<br />
<br />
Most of the basic functionality of Agora is already in, but there are many ways in which it could be improved, such as implementing comment threads, giving it an email interface, or a ReSTful API which could be used from Octave for package management. See also [[Agora]]. Talk to [[User:JordiGH|Jordi]]<br />
<br />
== Improve Windows binary packaging ==<br />
<br />
We are currently able to build and provide a [[Windows Installer|installer for Windows]]. The build process involves cross-compiling on a Linux system using a fork of the [http://mxe.cc/ MXE] project to build Octave and all of its dependencies. Any ideas for improving this process to make it easier or faster, or to improve the installer itself or the installation experience for Windows users would be appreciated.<br />
<br />
'''Skills Required''': Knowledge of GNU build systems, Makefiles, configure files, chasing library dependencies, how to use a compiler. No m-scripting or C++ necessary, beyond understanding [http://david.rothlis.net/c/compilation_model/ the C++ compilation model].<br />
<br />
== Improve Mac OS X binary packaging ==<br />
<br />
We would like to be able to easily generate binary packages for Mac OS X. Right now, it's difficult and tedious to do so. Most OS X users install Octave using one of the source-based package managers such as Homebrew or MacPorts. Any way to help us build a binary package would be appreciated. Required knowledge is understanding how building binaries in Mac OS X works. Our current approach to building binaries for Windows is to cross-compile from a GNU system using [http://mxe.cc/ MXE], something similar may be possible for OS X ([http://lilypond.org/gub/ GUB]?).<br />
<br />
'''Skills Required''': Knowledge of GNU build systems, Makefiles, configure files, chasing library dependencies, how to use a compiler. If you choose to work on GUB, Python will be required. No m-scripting or C++ necessary, beyond understanding [http://david.rothlis.net/c/compilation_model/ the C++ compilation model].<br />
<br />
=Performance=<br />
<br />
*A profiler for Octave would be a very useful tool. And now we have one! But it really needs a better interface.<br />
*Having {{Codeline|parfor}} functioning would speed code development and execution now that multicore architectures are widespread. See [http://octave.1599824.n4.nabble.com/Parfor-td4630575.html here] and [http://stackoverflow.com/questions/24970519/how-to-use-parallel-for-loop-in-octave-or-scilab here]. Existing code from the [[Parallel package | parallel]] and [http://octave.sourceforge.net/mpi/index.html mpi] packages could perhaps be adapted for this.<br />
<br />
=Packaging=<br />
<br />
* create a system that allows packages to deprecate functions as in core. Possibilities are:<br />
** get pkg to accept a deprecated directory inside the package and add it to the search path. Functions in those directories would have to be treated the same as the ones inside the core deprecated<br />
** PKG_ADD can be used to hack this. Package developers would still have to actually write the warnings on the function code but this would allow to have the functions in a separate directory so they don't foget to remove them on the next release<br />
** the package developer can also use something like Make to create a ''normal'' package from something that actually had a more complex structure, inclusive deprecated directories<br />
* get pkg to resolve dependencies automatically by downloading and installing them too<br />
* allow to download and install multiple versions of the same package<br />
* make the package just a bit more verbose by default (specifics?)<br />
* make pkg a little more like apt-get (what specific features of apt-get is this referring to?)<br />
* make pkg support more than one src directory<br />
** subdirectories with makefiles and top level make command of: cd <subdir> && ${MAKE}... ok as a substitute?<br />
* make pkg able to supply extra configure and make flags, useful for distributions, including -j for make (pkg now passes --jobs=N automatically, CFLAGS and CXXFLAGS environment variables are already respected, what's missing?)<br />
<br />
=Preferences=<br />
<br />
Octave has several functions for managing user preferences. Many function use persistent variables instead of relying upon the preference features.<br />
* The function {{Codeline|edit ()}} contains a persistent structure used as its personal set of preferences. These can all be moved to the user preference group for the editor.<br />
** "EDITOR"<br />
** "HOME"<br />
** "AUTHOR"<br />
** "EMAIL"<br />
** "LICENSE"<br />
** "MODE"<br />
** "EDITINPLACE"<br />
* The {{Codeline|savepath ()}} function modifies the startup script (rcfile), {{Codeline|~/.octaverc}} and inserts commands to allow the next session to begin with the same path. Instead user preference can be created for startup items and a preference for the user specified path can be added. Perhaps two path preferences should be used. One for the elements that should precede the core path and those that should follow. A start up directory preference might also be added to allow the user to specify where Octave should begin the next session.<br />
** "PREPATH"<br />
** "POSTPATH"<br />
** "STARTUPDIR"<br />
* A preference group for plotting can also be added. A preference for the default terminal would be useful for those who want to override the default. Preferences for the default {{Codeline|graphicstoolkit}} can also be added.<br />
** GNUPLOTTERM<br />
** GRAPHICSTOOLKIT<br />
* A preference group for printing can include preferences for the default printer, the ghostscript command, and possibly other parameters like orientation, and resolution.<br />
** PRINTER<br />
** GHOSTSCRIPTCOMMAND<br />
** ORIENTATION<br />
** RESOLUTION<br />
* Searching the m-files for use of {{Codeline|persistent}} should turn up other opportunities to use preferences.<br />
<br />
=Bugs=<br />
<br />
There is always bugs to fix. The [http://savannah.gnu.org/bugs/?group=octave bug tracker] is a good place to find tasks needing a hand. See also [[Short projects#Bugs]].<br />
<br />
= Matlab compatibility =<br />
<br />
== Missing functions ==<br />
<br />
There are certain functions present in MATLAB known to be missing in Octave.<br />
<br />
One list is provided on the source for function __unimplemented.m__, subfunction missing_functions; it can be edited in the Octave GUI or browsed at [http://hg.savannah.gnu.org/hgweb/octave/file/default/scripts/help/__unimplemented__.m#l547].<br />
<br />
Lists are also kept for the [[Image package|Image]], [[Mapping package|Mapping]], [[Optimization package|Optimization]], [[Signal package|Signal]], and [[Statistics package|Statistics]] packages.<br />
<br />
It is also possible to look at existing [[Wikipedia:Free and open-source software|FOSS]] implementations, from FreeMat and Scilab (for more closely compatible languages) to R or Scipy or Julia (for less compatible versions). Obviously, it is NOT OK to look at the Matlab implementation since this is not [[Wikipedia:Free software|free software]]!<br />
<br />
== Functions under different name ==<br />
<br />
Many Octave Forge functions perform the same as functions from matlab packages. However, they often exist under a different name or have incompatible API's. Often fixing this is a matter of changing their names, swap the order of their input arguments. At least, a list of this functions would be helpful.<br />
<br />
<br />
<br />
[[Category:Development]]<br />
[[Category:Project Ideas]]</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Projects&diff=7666Projects2016-02-03T08:48:54Z<p>Crobar: /* Interface to Electronic Circuit Simulator */ removed for now, Iproposed this, but no longer have time to mentor</p>
<hr />
<div>The list below summarizes features or bug fixes we would like to see in Octave. if you start working steadily on a project, please let octave-maintainers@octave.org know. We might have information that could help you. You should also read the [http://www.gnu.org/software/octave/doc/interpreter/Contributing-Guidelines.html#Contributing-Guidelines Contributing Guidelines chapter] in the [http://www.gnu.org/software/octave/doc/interpreter/ Octave manual].<br />
<br />
This list is not exclusive -- there are many other things that might be good projects, but it might instead be something we already have. Also, some of the following items may not actually be considered good ideas now. So please check with octave-maintainers@octave.org before you start working on some large project.<br />
<br />
Summer of Code students, please also see [[SoC Project Ideas]].<br />
<br />
If you're looking for small project, something more suited to start getting involved with Octave development or to fill a boring evening, see [[short projects]]<br />
<br />
=Numerical=<br />
<br />
*Improve logm, and sqrtm (see this thread: http://octave.1599824.n4.nabble.com/matrix-functions-td3137935.html)<br />
<br />
*Improve complex mapper functions. See W. Kahan, ``Branch Cuts for Complex Elementary Functions, or Much Ado About Nothing's Sign Bit (in The State of the Art in Numerical Analysis, eds. Iserles and Powell, Clarendon Press, Oxford, 1987) for explicit trigonometric formulae.<br />
<br />
*Make functions like gamma() return the right IEEE Inf or NaN values for extreme args or other undefined cases.<br />
<br />
*Improve sqp.<br />
<br />
*Fix CollocWt? to handle Laguerre polynomials. Make it easy to extend it to other polynomial types.<br />
<br />
*Add optional arguments to colloc so that it's not restricted to Legendre polynomials.<br />
<br />
*Fix eig to also be able to solve the generalized eigenvalue problem, and to solve for eigenvalues and eigenvectors without performing a balancing step first.<br />
<br />
*Move rand, eye, xpow, xdiv, etc., functions to the matrix classes.<br />
<br />
*Improve design of ODE, DAE, classes.<br />
<br />
*Make QR more memory efficient for large matrices when not all the columns of Q are required (apparently this is not handled by the lapack code yet).<br />
<br />
*Evaluate harmonics and cross-correlations of unevenly sampled and nonstationary time series, as in http://www.jstatsoft.org/v11/i02 (which has C code with interface to R). (This is now partly implemented in the [http://octave.sourceforge.net/lssa/index.html lssa] package.)<br />
<br />
== General purpose Finite Element library ==<br />
<br />
Octave-Forge already has a set of packages for discretizing Partial Differential operators by Finite Elements and/or Finite Volumes,<br />
namely the [[bim package]] which relies on the [http://octave.sf.net/msh msh package] (which is in turn based on [http://geuz.org/gmsh/ gmsh]) for creating and managing 2D triangular and 3D tetrahedral meshes and on the [http://octave.sf.net/fpl fpl package] for visualizing 2D results within Octave or exporting 2D or 3D results in a format compatible with [http://www.paraview.org Paraview] or [https://wci.llnl.gov/codes/visit/ VisIT]. These packages, though, offer only a limited choice of spatial discretization methods which are based on low degree polynomials and therefore have a low order of accuracy even for problems with extremely smooth solutions.<br />
The [http://geopdes.sf.net GeoPDEs] project, on the other hand, offers a complete suite of functions for discretizing a wide range of<br />
differential operators related to important physical problems and uses basis functions of arbitrary polynomial degree that allow the construction of methods of high accuracy. These latter, though, are based on the IsoGeometric Analysis Method which, although very powerful and often better performing, is less widely known and adopted than the Finite Elements Method. The implementation of a general purpose library of Finite Elements seems therefore a valuable addition to Octave-Forge. Two possible interesting choices for implementing this package exist, the first consists of implementing the most common Finite Element spaces in the [http://geopdes.sf.net GeoPDEs] framework, which is possible as IsoGeometric Analysis can be viewed as a superset of the Finite Element Method, the other is to construct Octave language bindings for the free software library [http://fenicsproject.org/documentation/ FEniCS] based on the existing C++ or Python interfaces. This second approach has been developed during the GSOC 2013 and the Octave-Forge package [http://octave.sf.net/fem-fenics fem-fenics] is now available. However, fem-fenics could be extended in many different ways:<br />
* implement the bindings for the UFL language inside Octave<br />
* add new functions already available with Fenics but not yet in Octave<br />
* create new functions specifically suited for Octave<br />
* improve the efficiency of the code<br />
The main goal for the fem-fenics package is ultimately to be merged with the FEnics project itself, so that it can remain in-sync with the main library development.<br />
<br />
== Implement solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D ==<br />
<br />
The project will deliver a solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D similar to Matlab's function <tt>pdepe</tt>. A good starting point is the [http://en.wikipedia.org/wiki/Method_of_lines method of lines] for which you can find more details [http://en.wikibooks.org/wiki/Partial_Differential_Equations/Method_of_Lines here] and [http://www.scholarpedia.org/article/Method_of_lines here], whereas an example implementation can be found [http://www.scholarpedia.org/article/Method_of_Lines/Example_Implementation here]. In addition, [http://www.pdecomp.net/ this page] provides some useful material.<br />
<br />
== Implement solver for 1D nonlinear boundary value problems ==<br />
<br />
The project will complete the implementation of the bvp4c solver that is already available in an initial version in the odepkg package<br />
by adding a proper error estimator and will implement a matlab-compatible version of the bvp5c solver.<br />
Details on the methods to be implemented can be found in [http://dx.doi.org/10.1145/502800.502801 this paper] on bvp4c and [http://www.jnaiam.net/new/uploads/files/014dde86eef73328e7ab674d1a32aa9c.pdf this paper] on bvp5c. Further details are available in [http://books.google.it/books/about/Nonlinear_two_point_boundary_value_probl.html?id=s_pQAAAAMAAJ&redir_esc=y this book].<br />
<br />
== Geometric integrators for Hamiltonian Systems ==<br />
<br />
[http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration Geometric (AKA Symplectic) integrators] are useful for <br />
multi-dimensional classical mechanics problems and for molecular dynamics simulations.<br />
The odepkg package has a number of solvers for ODE, DAE and DDE problems but none of them is currently<br />
specifically suited for second order problems in general and Hamiltonian systems in particular.<br />
Therefore a new package for geometric integrators would be a useful contribution.<br />
This could be created as new package or added as a set of new functions for odepkg.<br />
The function interface should be consistent throughout the package and should be modeled to follow <br />
that of other functions in odepkg (or that of DASPK and LSODE) but will need specific extensions to accommodate for specific options that only make sense for this specific class of solvers.<br />
An initial list of methods to be implemented includes (but is not limited to)<br />
* Symplectic Euler methods, see [http://en.wikipedia.org/wiki/Semi-implicit_Euler_method here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Störmer-Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Velocity Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Symplectic partitioned Runge-Kutta methods, see [http://reference.wolfram.com/mathematica/tutorial/NDSolveSPRK.html here] or [http://dx.doi.org/10.1137/0733019 here]<br />
* Spectral Variational Integrator methods, see [http://www3.nd.edu/~izaguirr/papers/acta_numerica.pdf here] or [http://www.math.ucsd.edu/~mleok/pdf/HaLe2012_SVI.pdf here]<br />
<br />
For this latter there is an existing code which is already working but needs to be improved, posted on the patch tracker.<br />
Furthermore, methods to implement solutions of problems with rigid constraints should be implemented, e.g.<br />
* SHAKE, see [http://en.wikipedia.org/wiki/Constraint_algorithm here] or [http://dx.doi.org/10.1016/0021-9991(77)90098-5 here]<br />
* RATTLE, see [http://dx.doi.org/10.1016/0021-9991(83)90014-1 here] or [http://dx.doi.org/10.1002/jcc.540161003 here]<br />
<br />
== Matlab-compatible ODE solvers in core-Octave ==<br />
<br />
* Adapt "odeset" and "odeget" from the odepkg package so that the list of supported options is more Matlab-compatible, in the sense that all option names that are supported by Matlab should be available. On the other hand, Matlab returns an error if an option which is not in the list of known options is passed to "odeset", but we would rather make this a warning in order to allow for special extensions, for example for symplectic integrators.<br />
* Adapt the interface of "ode45" in odepkg to be completely Matlab compatible, fix its code and documentation style and move it to Octave-core.<br />
* Build Matlab compatible versions of "ode15s" and "ode15i". jwe has prototype implementations [https://savannah.gnu.org/patch/index.php?8102|here] of these built as wrappers to "dassl" and "daspk". An initial approach could be to just improve these wrappers, but eventually it would be better to have wrappers for "IDA" from the sundials library.<br />
* Implement Matlab compatible versions of "deval".<br />
<br />
== High Precision Arithmetic Computation ==<br />
<br />
The Linear Algebra Fortran libraries used by Octave make use of of single (32 bits) and double (64 bits) precision floating point numbers. Many operations are stopped when matrices condition number goes below 1e-16: such matrices are considered as ill-conditioned. There are cases where this is not enough, for instance simulations implying chemical concentrations covering the range 10^4 up to 10^34. There are a number of ways to increase the numerical resolution, like f.i. make use of 128 bits quadruple precision numbers available in GFortran. A simpler option is to build an interface over Gnu MPL arbitrary precision library, which is used internally by gcc and should be available on any platform where gcc runs. Such approach has been made available for MatLab under the name mptoolbox and is licensed under a BSD license. The author kindly provided a copy of the latest version and agreed to have it ported under Octave and re-distributed under GPL v3.0<br />
<br />
The architecture consists of an Octave class interface implementing "mp" (multi-precision) objects. Arithmetic operations are forwarded to MPL using MEX files. This is totally transparent to the end user, except when displaying numbers. This implementation needs to be ported and tested under Octave.<br />
<br />
=GUI/IDE=<br />
<br />
:''See also: [[Summer of Code Project Ideas#GUI]]''<br />
*Søren Hauberg has suggested that we need C++ code that can:<br />
**Determine if a line of code could be fully parsed, i.e. it would return true for "plot (x, y);", but false for "while (true)".<br />
**Evaluate a line of code and return the output as a string (it would be best if it could provide three strings: output, warnings and errors).<br />
**Query defined variables, i.e. get a list of currently defined variables. Bonus points if it could tell you if anything had changed since the last time you checked the variables (could also be done with signals).<br />
**Make the links in the "Experimental GUI info" dialog box (the one that appears when the button "More Info" is pressed) clickable. They are not clickable in the 3.8.2-2 version (at least not on Windows 7).<br />
<br />
== Implement a Qt widget for manipulating plots ==<br />
<br />
Octave has had for some time a native OpenGL plotter. The plotter requires some user interaction for manipulating the plots, and it's been using fltk for quite some time. We want to replace this with Qt, so it fits better with the overall GUI look-and-feel and is easier to extend in the future.<br />
<br />
[https://github.com/goffioul/QtHandles QtHandles] is a current work in progress integrating the octave OpenGL renderer plus good support for GUI elements (uicontrol, uimenu, uitoolbar...). This project may initially consists of integrating the existing QtHandles code base into Octave. Then if time permits, further improvements can be made to QtHandles.<br />
<br />
== Create a better (G)UI for the profiler ==<br />
<br />
During GSoC 2011, Daniel Kraft successfully implemented a profiler for Octave. It needs a better interface and a way to generate reports. This may be done with Qt, but not necessarily, and HTML reports might also be good.<br />
<br />
== Sisotool. Create a graphical design tool for tuning closed loop control system (control pkg) ==<br />
<br />
When tuning a SISO feedback system it is very helpful to be able to grab a pole or a zero and move them by dragging them with the mouse. As they are moving the software must update all the plotted lines. There should be the ability to display various graphs rlocuse, bode, step, impulse etc. and have them all change dynamically as the mouse is moving. The parameters of the compensator must be displayed and updated.<br />
<br />
=Sparse Matrices=<br />
<br />
The paper by [http://arxiv.org/abs/cs.MS/0604006 Bateman & Adler] is good reading for understanding the sparse matrix implementation.<br />
<br />
*Improve QR factorization functions, using idea based on CSPARSE cs_dmsol.m<br />
<br />
*Improve QR factorization by replacing CXSPARSE code with SPQR code, and make the linear solve return 2-norm solutions for ill-conditioned matrices based on this new code<br />
<br />
*Implement fourth argument to the sprand and sprandn, and addition arguments to sprandsym that the leading brand implements.<br />
<br />
*Sparse logical indexing in idx_vector class so that something like 'a=sprandn(1e6,1e6,1e-6); a(a<1) = 0' won't cause a memory overflow.<br />
<br />
*Other missing Functions<br />
**<strike>symmmd</strike> (Superseded by symamd)<br />
**<strike>colmmd</strike> (Superseded by colamd)<br />
**<strike>cholinc (or ichol)</strike><br />
**<strike>luinc (or ilu)</strike><br />
**<strike>bicg</strike> Moved into octave-core<br />
**<strike>gmres</strike>Moved into octave-core<br />
**lsqr<br />
**minres<br />
**qmr (see [https://savannah.gnu.org/patch/?8569 Savannah Patch Tracker])<br />
**symmlq<br />
<br />
=Strings=<br />
<br />
*Consider making octave_print_internal() print some sort of text representation for unprintable characters instead of sending them directly to the terminal. (But don't do this for fprintf!)<br />
<br />
*Consider changing the default value of `string_fill_char' from SPC to NUL.<br />
<br />
=Other Data Types=<br />
<br />
*Template functions for mixed-type ops.<br />
<br />
*Convert other functions for use with the floating point type including quad, dasrt, daspk, etc.<br />
<br />
=Input/Output=<br />
<br />
*Make fread and fwrite work for complex data. Iostreams based versions of these functions would also be nice, and if you are working on them, it would be good to support other size specifications (integer*2, etc.).<br />
<br />
*Move some pr-output stuff to liboctave.<br />
<br />
*Make the cutoff point for changing to packed storage a user-preference variable with default value 8192.<br />
<br />
*Complain if there is not enough disk space available (I think there is simply not enough error checking in the code that handles writing data).<br />
<br />
*Make it possible to tie arbitrary input and output streams together, similar to the way iostreams can be tied together.<br />
<br />
*Expand {{codeline|imwrite}} options. This shouldn't be too hard to implement, since it's wrapped around GraphicsMagick.<br />
<br />
*Extend Octave functions to work on stored arrays that are too big to fit in RAM, similar to available R [http://www.bigmemory.org/ packages.]<br />
<br />
* write {{codeline|xmlread}} and {{codeline|xmlwrite}}. This could be done using [http://xerces.apache.org/xerces-c/ Xerces C++ interface] which apparently is what [http://octave.1599824.n4.nabble.com/xml-in-octave-td4663034.html Matlab uses].<br />
<br />
* Implement hdf5 for .mat files (see [http://octave.1599824.n4.nabble.com/Reading-Matlab-td4650158.html this thread]).<br />
<br />
=Interpreter=<br />
<br />
The interpreter is written in C++, undocumented. There are many possible projects associated with it.<br />
<br />
'''Required skills''': ''Very good'' C and C++ knowledge, possibly also understanding of [http://en.wikipedia.org/wiki/Gnu_bison GNU bison] and [http://en.wikipedia.org/wiki/Flex_lexical_analyser flex]. Understanding how compilers and interpreters are made plus being able to understand how to use a profiler and a debugger will probably be essential skills.<br />
<br />
*Allow customization of the debug prompt.<br />
<br />
*Fix the parser so that<br />
<br />
if (expr) 'this is a string' end<br />
<br />
is parsed as IF expr STRING END. ''(see [https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2014-March/039554.html this] post on the mailing list)''<br />
<br />
*Clean up functions in input.cc that handle user input (there currently seems to be some unnecessary duplication of code and it seems overly complex).<br />
<br />
*Consider allowing an arbitrary property list to be attached to any variable. This could be a more general way to handle the help string that can currently be added with `document'.<br />
<br />
*Allow more command line options to be accessible as built-in variables (--echo-commands, etc.).<br />
<br />
*Make the interpreter run faster.<br />
<br />
*Allow arbitrary lower bounds for array indexing.<br />
<br />
*Improve performance of recursive function calls.<br />
<br />
*Improve the way ignore_function_time_stamp works to allow selecting by individual directories or functions.<br />
<br />
*Add a command-line option to tell Octave to just do syntax checking and not execute statements.<br />
<br />
*Clean up symtab and variable stuff.<br />
<br />
*Input stream class for parser files -- must manage buffers for flex and context for global variable settings.<br />
<br />
*make parser do more semantic checking, continue after errors when compiling functions, etc.<br />
<br />
*Make LEXICAL_ERROR have a value that is the error message for parse_error() to print?<br />
<br />
*Add a run-time alias mechanism that would allow things like alias fun function_with_a_very_long_name so that `function_with_a_very_long_name' could be invoked as `fun'.<br />
<br />
*Allow local changes to variables to be written more compactly than is currently possible with unwind_protect. For example, <br />
<br />
function f ()<br />
local prefer_column_vectors = something;<br />
...<br />
endfunction<br />
<br />
<br />
would be equivalent to<br />
<br />
function f ()<br />
save_prefer_column_vectors = prefer_column_vectors;<br />
unwind_protect<br />
prefer_column_vectors = something;<br />
...<br />
unwind_protect_cleanup<br />
prefer_column_vectors = save_prefer_column_vectors;<br />
end_unwind_protect<br />
endfunction<br />
<br />
<br />
*Fix all function files to check for bogus inputs (wrong number or types of input arguments, wrong number of output arguments).<br />
<br />
*Handle options for built-in functions more consistently.<br />
<br />
*Too much time is spent allocating and freeing memory. What can be done to improve performance?<br />
<br />
*Error output from Fortran code is ugly. Something should be done to make it look better.<br />
<br />
*It would be nice if output from the Fortran routines could be passed through the pager.<br />
<br />
*Attempt to recognize common subexpressions in the parser.<br />
<br />
*Consider making it possible to specify an empty matrix with a syntax like [](e1, e2). Of course at least one of the expressions must be zero...<br />
<br />
*Is Matrix::fortran_vec() really necessary?<br />
<br />
*Rewrite whos and the symbol_record_info class. Write a built-in function that gives all the basic information, then write who and whos as M-files.<br />
<br />
*On systems that support matherr(), make it possible for users to enable the printing of warning messages.<br />
<br />
*Make it possible to mark variables and functions as read-only.<br />
<br />
*Make it possible to write a function that gets a reference to a matrix in memory and change one or more elements without generating a second copy of the data.<br />
<br />
*Use nanosleep instead of usleep if it is available? Apparently nanosleep is to be preferred over usleep on Solaris systems.<br />
<br />
*<strike>Per the following discussion, allow bsxfun style singleton dimension expansion as the default behavior for the builtin element-wise operators: http://octave.1599824.n4.nabble.com/Vector-approach-to-row-margin-frequencies-tp1636361p1636367.html</strike> This is done. <strike>Now [[User:JordiGH|I]] just have to document it.</strike> This is done too!<br />
<br />
== Improve JIT compiling ==<br />
<br />
Octave's interpreter is ''very'' slow on some loops. Recently, thanks to Max Brister's work, an initial implementation of a just-in-time compiler (JITC) in [http://llvm.org LLVM] for GSoC 2012. This project consists in understanding Max's current implementation and extending it so that functions and exponents (e.g. 2^z) compile with the JITC. This requires knowledge of compilers, C++, LLVM, and the Octave or Matlab languages. A capable student who demonstrates the ability to acquire this knowledge quickly may also be considered. Max himself will mentor this project. [http://planet.octave.org/octconf2012/jit.pdf Here] is Max's OctConf 2012 presentation about his current implementation. See also [[JIT]].<br />
<br />
== Improve memory management ==<br />
<br />
From profiling the interpreter, it appears that a lot of time is spending allocating and deallocating memory. A better memory management algorithm might provide some improvement.<br />
<br />
== Implement classdef classes ==<br />
<br />
Matlab has two kinds of classes: old style @classes and new style classdef. Octave has only fully implemented the old style. There is partial support for classdef classes in version 4.0, refer to the [[Classdef|classdef status page]] for what is not yet implemented. There is irregular work here, and classdef is [http://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html a very] [http://www.mathworks.com/help/matlab/events-sending-and-responding-to-messages.html complicated] [http://www.mathworks.com/help/matlab/enumeration-classes.html thing] to fully implement. A successful project would be to implement enough of classdef for most basic usages. Familiarity with Matlab's current classdef support would be a huge plus. Michael Goffioul and jwe can mentor this.<br />
<br />
Although there's already a substantial classdef support in current octave code base, there are still many areas that are unimplemented or need improvements. The main ones that come to my mind are:<br />
* support for events<br />
* support for enums<br />
* support for "import" (this requires good understanding of octave internals, especially he symbol table)<br />
* improving multiple inheritance and method resolution<br />
* honoring and computing "Sealed" attribute<br />
* support for function handle to methods<br />
<br />
== Improve MPI package ==<br />
<br />
Octave Forge's [http://octave.sourceforge.net/mpi/index.html MPI package] <br />
is a wrapper for basic MPI functions for parallel computing. It is implemented <br />
by wrapping MPI function calls in simple DLD functions that map Octave's Datataypes to <br />
MPI Derived Datatypes. <br />
The proposed project deals with improving and extending the Octave MPI package, for example:<br />
* Octave MPI applications can currently be only run in batch mode, add the ability to launch parallel jobs and collect their output in an interactive Octave session.<br />
* Implement functions for non-blocking communication (MPI_Isend, MPI_Irecv)<br />
* Implement one-to-many (Broadcast, Scatter), many-to-one (Reduce, Gather), and many-to-many (All Reduce, Allgather) communication routines<br />
<br />
=Graphics=<br />
<br />
*Correctly handle case where DISPLAY is unset. Provide --no-window-system or --nodisplay (?) option. Provide --display=DISPLAY option? How will this work with gnuplot (i.e., how do we know whether gnuplot requires an X display to display graphics)?<br />
<br />
* Implement transparency and lighting in OpenGL backend(s). A basic implementation was available in [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/jhandles/ JHandles]. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of octave.<br />
<br />
* Implement a Cairo-based renderer for 2D-only graphics, with support for PS/PDF/SVG output (for printing).<br />
<br />
* On 'imagesc' plots, report the matrix values also based on the mouse position, updating on mouse moving.<br />
<br />
* Create a "getframe" function that receives a a graphics handle and returns a 3D matrix from the graphics window associated with that handle.<br />
<br />
* Add map-creating capabilities similar to the Matlab [http://www.mathworks.com/help/map/functionlist.html Mapping toolbox] for inclusion in the Octave Forge [https://sourceforge.net/p/octave/mapping mapping package].<br />
<br />
* Add data cursor to trace data values in figure.<br />
<br />
== Lighting ==<br />
<br />
Implement transparency and lighting in OpenGL backend(s). A basic implementation is available in [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/jhandles/ JHandles]. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of Octave.<br />
<br />
== Object selection in OpenGL renderer ==<br />
<br />
This project is about the implementation of a selection method of graphics elements within the OpenGL renderer [http://glprogramming.com/red/chapter13.html]<br />
<br />
== Non-OpenGL renderer ==<br />
<br />
Besides the original gnuplot backend, Octave also contains an OpenGL-based renderer for advanced and more powerful 3D plots. However, OpenGL is not perfectly suited for 2D-only plots where other methods could result in better graphics. The purpose of this project is to implement an alternate graphics renderer for 2D only plots (although 3D is definitely not the focus, extending the new graphics renderer to support basic 3D features should also be taken into account). There is no particular toolkit/library that must be used, but natural candidates are:<br />
* [http://qt.nokia.com Qt]: the GUI is currently written in Qt and work is also in progress to provide a Qt/OpenGL based backend [https://github.com/goffioul/QtHandles]<br />
* [http://en.wikipedia.org/wiki/Cairo_%28software%29 Cairo]: this library is widely used and known to provides high-quality graphics with support for PS/PDF/SVG output.<br />
<br />
== TeX/LaTeX markup ==<br />
<br />
Text objects in plots (like titles, labels, texts...) in the OpenGL renderer only support plain text mode without any formatting possibility. Support for TeX and/or LaTeX formatting needs to be added.<br />
<br />
* The TeX formatting support actually only consists of a very limited subset of the TeX language. This can be implemented directly in C++ into Octave by extending the existing text engine, avoiding to add a dependency on a full TeX system. Essentially, support for Greek letters, super/sub-scripts, and several mathematical symbols needs to be supported. For example,<br />
<br />
:<pre>\alpha \approx \beta_0 + \gamma^\chi</pre><br />
<br />
:Would be rendered as,<br />
<br />
:&alpha; &asymp; &beta;<sub>0</sub> + &gamma;<sup>&chi;</sup><br />
<br />
:This is analogous to how special characters may be included in a wiki using html.<br />
<br />
:<pre>&amp;alpha; &amp;asymp; &amp;beta;<sub>0</sub> + &amp;gamma;<sup>&amp;chi;</sup></pre><br />
<br />
:The text object's {{Codeline|extent}} for the rendered result needs to be calculated and the text placed the location specified by the text object's {{Codeline|position}} property. An itemized list of a text objects properties can be found [http://www.gnu.org/software/octave/doc/interpreter/Text-Properties.html here].<br />
<br />
* On the other hand, the LaTeX formatting support is expected to provide full LaTeX capabilities. This will require to use an external LaTeX system to produce text graphics in some format (to be specified) that is then integrated into Octave plots.<br />
<br />
:The matplotlib project [http://matplotlib.sourceforge.net/users/usetex.html has already done this in Python] and might be used as an example of how to do this in Octave. Mediawiki has also also done [http://en.wikipedia.org/wiki/Wikipedia:Texvc something similar]. There is also [http://forge.scilab.org/index.php/p/jlatexmath/ JLaTeXMath], a Java API to display LaTeX code in mathematical mode.<br />
<br />
=History=<br />
<br />
*Add an option to allow saving input from script files in the history list.<br />
<br />
*The history command should accept two numeric arguments to indicate a range of history entries to display, save or read.<br />
<br />
*Avoid writing the history file if the history list has not changed.<br />
<br />
*Avoid permission errors if the history file cannot be opened for writing.<br />
<br />
*Fix history problems — core dump if multiple processes are writing to the same history file?<br />
<br />
=Configuration and Installation=<br />
<br />
*Split config.h into a part for Octave-specific configuration things (this part can be installed) and the generic HAVE_X type of configure information that should not be installed.<br />
<br />
*Makefile changes:<br />
**eliminate for loops<br />
**define shell commands or eliminate them<br />
**consolidate targets<br />
<br />
*Create a docs-only distribution?<br />
<br />
*Better binary packaging and distribution, especially on Windows.<br />
<br />
*Octave Emacs mode needs maintenance.<br />
<br />
*Convert build system to a non-recursive Automake setup. See how Makefile.am files currently include module.mk files in subdirectories, extend this concept to the entire project so there is only one top-level Makefile.am.<br />
<br />
=Documentation and On-Line Help=<br />
<br />
*Document new features.<br />
<br />
*Improve the Texinfo Documentation for the interpreter. It would be useful to have lots more examples, to not have so many forward references, and to not have very many simple lists of functions.<br />
<br />
*The docs should mention something about efficiency and that using array operations is almost always a good idea for speed.<br />
<br />
*Doxygen documentation for the C++ classes.<br />
<br />
*Make index entries more consistent to improve behavior of `help -i'.<br />
<br />
*Make `help -i' try to find a whole word match first.<br />
<br />
*Clean up help stuff.<br />
<br />
*Demo files.<br />
<br />
*Document C++ sources, to make it easier for newcomers to get into writing code.<br />
<br />
*Flesh out this wiki<br />
<br />
=Tests=<br />
*Improved set of tests: [http://octave.1599824.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=370633]<br />
**Tests for various functions. Would be nice to have a test file corresponding to every function (see below)<br />
**Tests for element by element operators: + - .* ./ .\ .^ | & < <= == >= > != !<br />
**Tests for boolean operators: && ||<br />
**Tests for other operators: * / \ ' .'<br />
**Tests from bug reports.<br />
**Tests for indexed assignment. Need to consider the following:<br />
***fortran-style indexing<br />
***zero-one indexing<br />
***assignment of empty matrix as well as values resizing<br />
**Tests for all internal functions.<br />
<br />
* Implement a coverage tool for collecting coverage data and generating code coverage reports on m-file functions and scripts. This would be very useful for Octave development as well as for users who want a code coverage report for their own functions and scripts.<br />
<br />
We are far from even having one test for every function, so focus should be on getting the breadth of coverage first before trying to get the depth of 100% statement coverage. As of Dec 2015, 202 of 1020 m-files have no tests. Some of these will be plotting functions which have demos instead, but that leaves enough functions to be an interesting project. As of Dec 2015, there are 485 instances of C++ functions which need tests.<br />
<br />
After Octave is compiled, running the {{Codeline|make check}} build target will run the full test suite and generate a file called test/fntests.log in the build directory with a summary of the results. At the end of the file is a list of all functions for which no tests were found. An extract is posted in the [[files missing tests]] page. If you are not building Octave yourself, the test suite can be run on an installed binary copy by executing the {{Codeline|__run_test_suite__}} command at the Octave prompt. The fntests.log file will be written in the current directory in this case.<br />
<br />
There also need to be tests for functions written in the C++ files. See [[Add_BIST_tests_for_octave_functions_written_in_C%2B%2B]] for instructions and a list of instances.<br />
<br />
See also [[Continuous Build#Coverage Report]].<br />
<br />
=Programming=<br />
<br />
*Add support for listeners (addlistener, dellistener, etc) on the C++ side.<br />
<br />
*C++ namespace for Octave library functions.<br />
<br />
*Better error messages for missing operators?<br />
<br />
*Eliminate duplicate enums in pt-exp.cc, pt-const.cc, and ov.cc.<br />
<br />
*Handle octave_print_internal() stuff at the liboctave level. Then the octave_value classes could just call on the print() methods for the underlying classes.<br />
<br />
*As much as possible, eliminate explicit checks for the types of octave_value objects so that user-defined types will automatically do the right thing in more cases.<br />
<br />
*Only include config.h in files that actually need it, instead of including it in every .cc file. Unfortunately, this might not be so easy to figure out.<br />
<br />
*GNU coding standards:<br />
**Add a `Makefile' target to the Makefiles.<br />
**Comments on #else and #endif preprocessor commands.<br />
**Change error message format to match standards everywhere.<br />
<br />
*Eliminate more global variables.<br />
<br />
*Move procstream to liboctave.<br />
<br />
*Use references and classes in more places.<br />
<br />
*Share more code among the various _options functions.<br />
<br />
*Use non-empty identifiers in all warnings and errors issued by Octave, see [[Easy projects#Miscellaneous]].<br />
<br />
*Reduce the amount of datatypes in liboctave [[Project liboctave 4.2]]<br />
<br />
=Miscellaneous=<br />
<br />
*Implement some functions for interprocess communication: bind, accept, connect, gethostbyname, etc. (This functionality is already available in the octave sockets package, what is the purpose of moving it to core octave?)<br />
<br />
*The ability to transparently handle very large files: Juhana K Kouhia <kouhia@nic.funet.fi> wrote:<br />
*: If I have a one-dimensional signal data with the size 400 Mbytes, then what are my choices to operate with it:<br />
*:*I have to split the data<br />
*:*Octave has a virtual memory on its own and I don't have to worry about the splitting.<br />
*:If I split the data, then my easily programmed processing programs will become hard to program.<br />
*:If possible, I would like to have the virtual memory system in Octave i.e., the all big files, the user see as one big array or such. There could be several user selectable models to do the virtual memory depending on what kind of data the user have (1d, 2d) and in what order they are processed (stream or random access).<br />
<br />
*An interface to gdb. Michael Smolsky <fnsiguc@weizmann.weizmann.ac.il> wrote:<br />
*:I was thinking about a tool, which could be very useful for me in my numerical simulation work. It is an interconnection between gdb and octave. We are often managing very large arrays of data in our fortran or c codes, which might be studied with the help of octave at the algorithm development stages. Assume you're coding, say, wave equation. And want to debug the code. It would be great to pick some array from the memory of the code you're developing, fft it and see the image as a log-log plot of the spectral density. I'm facing similar problems now. To avoid high c-development cost, I develop in matlab/octave, and then rewrite into c. It might be so much easier, if I could off-load a c array right from the debugger into octave, study it, and, perhaps, change some [many] values with a convenient matlab/octave syntax, similar to <code>a(:,50:250)=zeros(100,200)</code>, and then store it back into the memory of my c code.<br />
<br />
*Implement gdb extensions for Octave types. Octave has the <code>etc/gdbinit</code> file, which has some basic support for displaying the contents of Octave types. Add more extensions to make it easier to debug octave_values and other Octave types.<br />
<br />
*Add a definition to lgrind so that it supports Octave. (See http://www.tex.ac.uk/tex-archive/support/lgrind/ for more information about lgrind.)<br />
<br />
*Spatial statistics, including covariogram estimation and kriging -- perhaps via an interface to [http://www.gstat.org/ gstat]?<br />
<br />
* the [http://octave.sourceforge.net/miscellaneous/function/units.html units] function from the miscellaneous package works by parsing the output of from a call to GNU units. This can be made much more robust by writing it in C++ and including its library "units.h"<br />
<br />
=Marketing and Community=<br />
<br />
*Make the website prettier. Maybe a new design, maybe a more "corporate" design (if we're heading down the "paid support for Octave" path.<br />
<br />
** FusionForge's "Submit a Snippet" and "Create A Package" would seem to be directly usable for Agora's "Post a Snippet" and "Share your Code", respectively: https://alioth.debian.org/snippet/. It is FLOSS.<br />
** ScipyCentral, http://scipy-central.org/ has all the features we need and is also free software. <br />
<br />
*Move [http://octave.sourceforge.net/ Octave-Forge] to [http://savannah.gnu.org/projects/octave/ Savannah] so everything is hosted in the same place.<br />
<br />
*For ideas, see the [http://openoffice.apache.org/orientation/intro-marketing.html Apache Open Office Introduction to Marketing]<br />
<br />
* Help design a user or a developer survey [http://www.openoffice.org/marketing/ooocon2006/presentations/wednesday_c10.pdf]<br />
<br />
* Help prepare and deliver presentations about Octave at colleges and universities.<br />
<br />
== Finish the Agora website ==<br />
<br />
In 2009, the Mathworks decided to restrict the terms of use Matlab Central, a place dedicated to Matlab collaboration. The Mathworks forbade copyleft licenses and using the "free" code found in Matlab central on anything other than Mathworks products (e.g. forbidding from using it on Octave, even if the authors of the code wanted to allow this). Thus Octave users have no place to centrally, quickly, and conveniently share Octave code. See the [[FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21|FAQ]] for more details.<br />
<br />
In response to this, a website started to form, [http://agora.octave.org/ Agora Octave].<br />
<br />
This should be relatively easy webdev in Python using [http://en.wikipedia.org/wiki/Django_%28web_framework%29 Django].<br />
<br />
Things to be considered when working on this:<br />
<br />
* [http://octave-forge.blogspot.ie/2012/08/octconf2012-agora-and-pkg.html discussion of Agora during OctConf2012]<br />
* [http://scipy-central.org/ Scipy Central] - a website with the same objective as Agora for Scipy. Their [https://github.com/scipy/SciPyCentral Code] is released under a BSD license. Might be useful to reuse some parts.<br />
<br />
Most of the basic functionality of Agora is already in, but there are many ways in which it could be improved, such as implementing comment threads, giving it an email interface, or a ReSTful API which could be used from Octave for package management. See also [[Agora]]. Talk to [[User:JordiGH|Jordi]]<br />
<br />
== Improve Windows binary packaging ==<br />
<br />
We are currently able to build and provide a [[Windows Installer|installer for Windows]]. The build process involves cross-compiling on a Linux system using a fork of the [http://mxe.cc/ MXE] project to build Octave and all of its dependencies. Any ideas for improving this process to make it easier or faster, or to improve the installer itself or the installation experience for Windows users would be appreciated.<br />
<br />
'''Skills Required''': Knowledge of GNU build systems, Makefiles, configure files, chasing library dependencies, how to use a compiler. No m-scripting or C++ necessary, beyond understanding [http://david.rothlis.net/c/compilation_model/ the C++ compilation model].<br />
<br />
== Improve Mac OS X binary packaging ==<br />
<br />
We would like to be able to easily generate binary packages for Mac OS X. Right now, it's difficult and tedious to do so. Most OS X users install Octave using one of the source-based package managers such as Homebrew or MacPorts. Any way to help us build a binary package would be appreciated. Required knowledge is understanding how building binaries in Mac OS X works. Our current approach to building binaries for Windows is to cross-compile from a GNU system using [http://mxe.cc/ MXE], something similar may be possible for OS X ([http://lilypond.org/gub/ GUB]?).<br />
<br />
'''Skills Required''': Knowledge of GNU build systems, Makefiles, configure files, chasing library dependencies, how to use a compiler. If you choose to work on GUB, Python will be required. No m-scripting or C++ necessary, beyond understanding [http://david.rothlis.net/c/compilation_model/ the C++ compilation model].<br />
<br />
=Performance=<br />
<br />
*A profiler for Octave would be a very useful tool. And now we have one! But it really needs a better interface.<br />
*Having {{Codeline|parfor}} functioning would speed code development and execution now that multicore architectures are widespread. See [http://octave.1599824.n4.nabble.com/Parfor-td4630575.html here] and [http://stackoverflow.com/questions/24970519/how-to-use-parallel-for-loop-in-octave-or-scilab here]. Existing code from the [[Parallel package | parallel]] and [http://octave.sourceforge.net/mpi/index.html mpi] packages could perhaps be adapted for this.<br />
<br />
=Packaging=<br />
<br />
* create a system that allows packages to deprecate functions as in core. Possibilities are:<br />
** get pkg to accept a deprecated directory inside the package and add it to the search path. Functions in those directories would have to be treated the same as the ones inside the core deprecated<br />
** PKG_ADD can be used to hack this. Package developers would still have to actually write the warnings on the function code but this would allow to have the functions in a separate directory so they don't foget to remove them on the next release<br />
** the package developer can also use something like Make to create a ''normal'' package from something that actually had a more complex structure, inclusive deprecated directories<br />
* get pkg to resolve dependencies automatically by downloading and installing them too<br />
* allow to download and install multiple versions of the same package<br />
* make the package just a bit more verbose by default (specifics?)<br />
* make pkg a little more like apt-get (what specific features of apt-get is this referring to?)<br />
* make pkg support more than one src directory<br />
** subdirectories with makefiles and top level make command of: cd <subdir> && ${MAKE}... ok as a substitute?<br />
* make pkg able to supply extra configure and make flags, useful for distributions, including -j for make (pkg now passes --jobs=N automatically, CFLAGS and CXXFLAGS environment variables are already respected, what's missing?)<br />
<br />
=Preferences=<br />
<br />
Octave has several functions for managing user preferences. Many function use persistent variables instead of relying upon the preference features.<br />
* The function {{Codeline|edit ()}} contains a persistent structure used as its personal set of preferences. These can all be moved to the user preference group for the editor.<br />
** "EDITOR"<br />
** "HOME"<br />
** "AUTHOR"<br />
** "EMAIL"<br />
** "LICENSE"<br />
** "MODE"<br />
** "EDITINPLACE"<br />
* The {{Codeline|savepath ()}} function modifies the startup script (rcfile), {{Codeline|~/.octaverc}} and inserts commands to allow the next session to begin with the same path. Instead user preference can be created for startup items and a preference for the user specified path can be added. Perhaps two path preferences should be used. One for the elements that should precede the core path and those that should follow. A start up directory preference might also be added to allow the user to specify where Octave should begin the next session.<br />
** "PREPATH"<br />
** "POSTPATH"<br />
** "STARTUPDIR"<br />
* A preference group for plotting can also be added. A preference for the default terminal would be useful for those who want to override the default. Preferences for the default {{Codeline|graphicstoolkit}} can also be added.<br />
** GNUPLOTTERM<br />
** GRAPHICSTOOLKIT<br />
* A preference group for printing can include preferences for the default printer, the ghostscript command, and possibly other parameters like orientation, and resolution.<br />
** PRINTER<br />
** GHOSTSCRIPTCOMMAND<br />
** ORIENTATION<br />
** RESOLUTION<br />
* Searching the m-files for use of {{Codeline|persistent}} should turn up other opportunities to use preferences.<br />
<br />
=Bugs=<br />
<br />
There is always bugs to fix. The [http://savannah.gnu.org/bugs/?group=octave bug tracker] is a good place to find tasks needing a hand. See also [[Short projects#Bugs]].<br />
<br />
= Matlab compatibility =<br />
<br />
== Missing functions ==<br />
<br />
There are certain functions present in MATLAB known to be missing in Octave.<br />
<br />
One list is provided on the source for function __unimplemented.m__, subfunction missing_functions; it can be edited in the Octave GUI or browsed at [http://hg.savannah.gnu.org/hgweb/octave/file/default/scripts/help/__unimplemented__.m#l547].<br />
<br />
Lists are also kept for the [[Image package|Image]], [[Mapping package|Mapping]], [[Optimization package|Optimization]], [[Signal package|Signal]], and [[Statistics package|Statistics]] packages.<br />
<br />
It is also possible to look at existing [[Wikipedia:Free and open-source software|FOSS]] implementations, from FreeMat and Scilab (for more closely compatible languages) to R or Scipy or Julia (for less compatible versions). Obviously, it is NOT OK to look at the Matlab implementation since this is not [[Wikipedia:Free software|free software]]!<br />
<br />
== Functions under different name ==<br />
<br />
Many Octave Forge functions perform the same as functions from matlab packages. However, they often exist under a different name or have incompatible API's. Often fixing this is a matter of changing their names, swap the order of their input arguments. At least, a list of this functions would be helpful.<br />
<br />
<br />
<br />
[[Category:Development]]<br />
[[Category:Project Ideas]]</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=7441Classdef2016-02-01T08:56:29Z<p>Crobar: /* Not Supported */ Added another workaround for function handles to fcns in packages</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
=== Not Supported ===<br />
<br />
* '''enumeration'''<br />
<br />
<br />
* '''build-in class as superclass'''<br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects].''' <br />
<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access.'''<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
<br />
* '''Function handles to package methods and static class methods.'''<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. Another workaround for package function handles is to use <code>str2func</code>, e.g. <code>fh = str2func ("mypackage.myfunc")</code>.<br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* '''Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working.''' <br />
For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
* '''debugging in classdef methods (and +package directory functions)'''<br />
<br />
Breakpoints cannot currently be set in classdef methods from the gui, but only from the command line:<br />
<source lang="octave"><br />
dbstop @aclass\amethod <br />
</source><br />
<br />
=== Supported ===<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Octave_for_Debian_systems&diff=7134Octave for Debian systems2016-01-04T20:13:52Z<p>Crobar: /* HDF5 */ added information about non-standard hdf5 locations on Debian</p>
<hr />
<div>For Debian, and Debian based distributions such as Ubuntu, specific solutions.<br />
<br />
== Pre-compiled binaries ==<br />
<br />
Binary packages for Octave and many Octave-Forge packages are provided by all versions of Debian and Ubuntu. These are the most well-tested binaries available and should work best for most users.<br />
<br />
sudo apt-get install octave<br />
<br />
Aside the {{codeline|octave}} package that installs GNU Octave, other pieces of it are split over multiple packages. These are {{codeline|octave-doc}}, {{codeline|octave-info}}, and {{codeline|octave-htmldoc}} for the documentation; {{codeline|liboctave-dev}} for the octave development header files and mkoctfile (required to install Octave Forge packages); and {{codeline|octave-dbg}} for the debugging symbols.<br />
<br />
For Debian stable users, there may also be newer packages available in backports, so don't forget to check there.<br />
<br />
=== Octave packages ===<br />
<br />
Many Octave packages are also distributed by your Linux distribution. These are tested to work the best with your Octave version. For example:<br />
<br />
sudo apt-get install octave-control octave-image octave-io octave-optim octave-signal octave-statistics<br />
<br />
=== Octave's Personal Package Archive (PPA) for Ubuntu ===<br />
<br />
For some Ubuntu releases the octave packages are too old (Ubuntu 12.04 only has Octave version 3.2). The [https://launchpad.net/~octave GNU Octave Team] on Launchpad maintains a PPA providing more up to date packages of Octave for all versions of Ubuntu. These are backported from Debian unstable (the Ubuntu Octave Team needs help testing and preparing the packages so if you can help with this, contact [[User:Mtmiller|Mike Miller]]). To set up your system to install these packages:<br />
<br />
sudo apt-add-repository ppa:octave/stable<br />
sudo apt-get update<br />
sudo apt-get install octave<br />
<br />
== Compiling from source ==<br />
<br />
The ''only'' tricky part is to install the dependencies. Once that is solved, installing from source should be as easy as {{Codeline|./configure && make && make install}}. See the manual for [http://www.gnu.org/software/octave/doc/interpreter/Running-Configure-and-Make.html configure options].<br />
<br />
=== Install dependencies ===<br />
<br />
Note that different Debian and Ubuntu versions may have slightly different package names but their differences should be pretty small, mostly limited to version numbers.<br />
<br />
==== The easy way (but likely incorrect) ====<br />
<br />
This approach is ''only'' suitable if you are building from source the ''same'' version that your Linux distribution already has packaged.<br />
<br />
The easy way to install ''most'' of the necessary dependencies is to {{Codeline|sudo apt-get build-dep octave}}. This will install all packages necessary to build and prepare a Debian package for the octave version available on your system repositories. However:<br />
* will install unnecessary packages related to the building of a Debian package;<br />
* may miss some new dependencies;<br />
* may install packages that are no longer octave dependencies.<br />
<br />
==== The even easier way (but experimental) ====<br />
<br />
The [[MXE|MXE-octave]] package provides a way to compile Octave for different platforms. Dependencies and certain flags are handled automatically.<br />
<br />
==== The right way ====<br />
<br />
The right way is to select and install all the dependencies as listed in the {{Path|INSTALL.OCTAVE}} file. The following are their package names in Debian repositories (they will have their own dependencies which your package manager will solve automatically). If you are building development versions, you'll require some more packages as listed on {{Path|etc/HACKING}} and {{Path|INSTALL}}. Many of them will already be installed on your system. Install the dependencies by typing<br />
<br />
sudo apt-get install<br />
<br />
followed by the package names of the table below.<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Dependency !! Debian 8 Jessie (stable) !! Ubuntu 14.04 Trusty Tahr (LTS)<br />
|-<br />
!colspan="3" style="text-align:center;" | Required build tools<br />
|-<br />
| C compiler<br />
|| [https://packages.debian.org/jessie/gcc gcc]<br />
|| [http://packages.ubuntu.com/trusty/gcc gcc]<br />
|-<br />
| C++ compiler<br />
|| [https://packages.debian.org/jessie/g++ g++]<br />
|| [http://packages.ubuntu.com/trusty/g++ g++]<br />
|-<br />
| Fortran compiler<br />
|| [https://packages.debian.org/jessie/gfortran gfortran]<br />
|| [http://packages.ubuntu.com/trusty/gfortran gfortran]<br />
|-<br />
| GNU make<br />
|| [https://packages.debian.org/jessie/make make]<br />
|| [http://packages.ubuntu.com/trusty/make make]<br />
|-<br />
!colspan="3" style="text-align:center;"| Required external packages<br />
|-<br />
| BLAS<br />
|| [https://packages.debian.org/jessie/libblas-dev libblas-dev]<br />
|| [http://packages.ubuntu.com/trusty/libblas-dev libblas-dev]<br />
|-<br />
| LAPACK<br />
|| [https://packages.debian.org/jessie/liblapack-dev liblapack-dev]<br />
|| [http://packages.ubuntu.com/trusty/liblapack-dev liblapack-dev]<br />
|-<br />
| PCRE<br />
|| [https://packages.debian.org/jessie/libpcre3-dev libpcre3-dev]<br />
|| [http://packages.ubuntu.com/trusty/libpcre3-dev libpcre3-dev]<br />
|-<br />
!colspan="3" style="text-align:center;"| ''Strongly'' recommended. Check the [http://www.gnu.org/software/octave/doc/interpreter/External-Packages.html Octave manual] for more information.<br />
|-<br />
| ARPACK<br />
|| [https://packages.debian.org/jessie/libarpack2-dev libarpack2-dev]<br />
|| [http://packages.ubuntu.com/trusty/libarpack2-dev libarpack2-dev]<br />
|-<br />
| cURL<br />
|| [https://packages.debian.org/jessie/libcurl4-gnutls-dev libcurl4-gnutls-dev]<br />
|| [http://packages.ubuntu.com/trusty/libcurl4-gnutls-dev libcurl4-gnutls-dev]<br />
|-<br />
| epstool<br />
|| [https://packages.debian.org/jessie/epstool epstool]<br />
|| [http://packages.ubuntu.com/trusty/epstool epstool]<br />
|-<br />
| FFTW3<br />
|| [https://packages.debian.org/jessie/libfftw3-dev libfftw3-dev]<br />
|| [http://packages.ubuntu.com/trusty/libfftw3-dev libfftw3-dev]<br />
|-<br />
| fig2dev<br />
|| [https://packages.debian.org/jessie/transfig transfig]<br />
|| [http://packages.ubuntu.com/trusty/transfig transfig]<br />
|-<br />
| FLTK<br />
|| [https://packages.debian.org/jessie/libfltk1.3-dev libfltk1.3-dev]<br />
|| [http://packages.ubuntu.com/trusty/libfltk1.3-dev libfltk1.3-dev]<br />
|-<br />
| fontconfig<br />
|| [https://packages.debian.org/jessie/libfontconfig1-dev libfontconfig1-dev]<br />
|| [http://packages.ubuntu.com/trusty/libfontconfig1-dev libfontconfig1-dev]<br />
|-<br />
| FreeType<br />
|| [https://packages.debian.org/jessie/libfreetype6-dev libfreetype6-dev]<br />
|| [http://packages.ubuntu.com/trusty/libfreetype6-dev libfreetype6-dev]<br />
|-<br />
| gl2ps<br />
|| [https://packages.debian.org/jessie/libgl2ps-dev libgl2ps-dev]<br />
|| [http://packages.ubuntu.com/trusty/libgl2ps-dev libgl2ps-dev]<br />
|-<br />
| GLPK<br />
|| [https://packages.debian.org/jessie/libglpk-dev libglpk-dev]<br />
|| [http://packages.ubuntu.com/trusty/libglpk-dev libglpk-dev]<br />
|-<br />
| GNU Readline<br />
|| [https://packages.debian.org/jessie/libreadline-dev libreadline-dev]<br />
|| [http://packages.ubuntu.com/trusty/libreadline-dev libreadline-dev]<br />
|-<br />
| gnuplot<br />
|| [https://packages.debian.org/jessie/gnuplot gnuplot]<br />
|| [http://packages.ubuntu.com/trusty/gnuplot gnuplot-x11]<br />
|-<br />
| GraphicsMagick++<br />
|| [https://packages.debian.org/jessie/libgraphicsmagick++1-dev libgraphicsmagick++1-dev]<br />
|| [http://packages.ubuntu.com/trusty/libgraphicsmagick++1-dev libgraphicsmagick++1-dev]<br />
|-<br />
| HDF5<br />
|| [https://packages.debian.org/jessie/libhdf5-serial-dev libhdf5-serial-dev]<br />
|| [http://packages.ubuntu.com/trusty/libhdf5-serial-dev libhdf5-serial-dev]<br />
|-<br />
| Java JDK<br />
|| [https://packages.debian.org/jessie/openjdk-7-jdk openjdk-7-jdk]<br />
|| [http://packages.ubuntu.com/trusty/openjdk-7-jdk openjdk-7-jdk]<br />
|-<br />
| libsndfile<br />
|| [https://packages.debian.org/jessie/libsndfile1-dev libsndfile1-dev]<br />
|| [http://packages.ubuntu.com/trusty/libsndfile1-dev libsndfile1-dev]<br />
|-<br />
| LLVM<br />
|| [https://packages.debian.org/jessie/llvm-dev llvm-dev]<br />
|| [http://packages.ubuntu.com/trusty/llvm-dev llvm-dev]<br />
|-<br />
| lpr<br />
|| [https://packages.debian.org/jessie/lpr lpr]<br />
|| [http://packages.ubuntu.com/trusty/lpr lpr]<br />
|-<br />
| makeinfo<br />
|| [https://packages.debian.org/jessie/texinfo texinfo]<br />
|| [http://packages.ubuntu.com/trusty/texinfo texinfo]<br />
|-<br />
| OpenGL<br />
|| [https://packages.debian.org/jessie/libgl1-mesa-dev libgl1-mesa-dev]<br />
|| [http://packages.ubuntu.com/trusty/libgl1-mesa-dev libgl1-mesa-dev]<br />
|-<br />
| OSMesa<br />
|| [https://packages.debian.org/jessie/libosmesa6-dev libosmesa6-dev]<br />
|| [http://packages.ubuntu.com/trusty/libosmesa6-dev libosmesa6-dev]<br />
|-<br />
| pstoedit<br />
|| [https://packages.debian.org/jessie/pstoedit pstoedit]<br />
|| [http://packages.ubuntu.com/trusty/pstoedit pstoedit]<br />
|-<br />
| PortAudio<br />
|| [https://packages.debian.org/jessie/portaudio19-dev portaudio19-dev]<br />
|| [http://packages.ubuntu.com/trusty/portaudio19-dev portaudio19-dev]<br />
|-<br />
| Qhull<br />
|| [https://packages.debian.org/jessie/libqhull-dev libqhull-dev]<br />
|| [http://packages.ubuntu.com/trusty/libqhull-dev libqhull-dev]<br />
|-<br />
| QRUPDATE<br />
|| [https://packages.debian.org/jessie/libqrupdate-dev libqrupdate-dev]<br />
|| [http://packages.ubuntu.com/trusty/libqrupdate-dev libqrupdate-dev]<br />
|-<br />
| QScintilla<br />
|| [https://packages.debian.org/jessie/libqscintilla2-dev libqscintilla2-dev]<br />
|| [http://packages.ubuntu.com/trusty/libqscintilla2-dev libqscintilla2-dev]<br />
|-<br />
| Qt<br />
||<br />
[https://packages.debian.org/jessie/libqt4-dev libqt4-dev]<br />
[https://packages.debian.org/jessie/libqtcore4 libqtcore4]<br />
[https://packages.debian.org/jessie/libqtwebkit4 libqtwebkit4]<br />
[https://packages.debian.org/jessie/libqt4-network libqt4-network]<br />
[https://packages.debian.org/jessie/libqtgui4 libqtgui4]<br />
[https://packages.debian.org/jessie/libqt4-opengl-dev libqt4-opengl-dev]<br />
||<br />
[http://packages.ubuntu.com/trusty/libqt4-dev libqt4-dev]<br />
[http://packages.ubuntu.com/trusty/libqtcore4 libqtcore4]<br />
[http://packages.ubuntu.com/trusty/libqtwebkit4 libqtwebkit4]<br />
[http://packages.ubuntu.com/trusty/libqt4-network libqt4-network]<br />
[http://packages.ubuntu.com/trusty/libqtgui4 libqtgui4]<br />
|-<br />
| SuiteSparse<br />
|| [https://packages.debian.org/jessie/libsuitesparse-dev libsuitesparse-dev]<br />
|| [http://packages.ubuntu.com/trusty/libsuitesparse-dev libsuitesparse-dev]<br />
|-<br />
| Texlive<br />
|| texlive<br />
|| texlive<br />
|-<br />
| Xft<br />
|| [https://packages.debian.org/jessie/libxft-dev libxft-dev]<br />
|| [http://packages.ubuntu.com/trusty/libxft-dev libxft-dev]<br />
|-<br />
| zlib<br />
|| [https://packages.debian.org/jessie/zlib1g-dev zlib1g-dev]<br />
|| [http://packages.ubuntu.com/trusty/zlib1g-dev zlib1g-dev]<br />
|-<br />
!colspan="3" style="text-align:center;"| Required to build from development sources<br />
|-<br />
| Autoconf<br />
|| [https://packages.debian.org/jessie/autoconf autoconf]<br />
|| [http://packages.ubuntu.com/trusty/autoconf autoconf]<br />
|-<br />
| Automake<br />
|| [https://packages.debian.org/jessie/automake automake]<br />
|| [http://packages.ubuntu.com/trusty/automake automake]<br />
|-<br />
| Bison<br />
|| [https://packages.debian.org/jessie/bison bison]<br />
|| [http://packages.ubuntu.com/trusty/bison bison]<br />
|-<br />
| Flex<br />
|| [https://packages.debian.org/jessie/flex flex]<br />
|| [http://packages.ubuntu.com/trusty/flex flex]<br />
|-<br />
| gperf<br />
|| [https://packages.debian.org/jessie/gperf gperf]<br />
|| [http://packages.ubuntu.com/trusty/gperf gperf]<br />
|-<br />
| gzip<br />
|| [https://packages.debian.org/jessie/gzip gzip]<br />
|| [http://packages.ubuntu.com/trusty/gzip gzip]<br />
|-<br />
| icoutils<br />
|| [https://packages.debian.org/jessie/icoutils icoutils]<br />
|| [http://packages.ubuntu.com/trusty/icoutils icoutils]<br />
|-<br />
| rsvg-convert<br />
|| [https://packages.debian.org/jessie/librsvg2-bin librsvg2-bin]<br />
|| [http://packages.ubuntu.com/trusty/librsvg2-bin librsvg2-bin]<br />
|-<br />
| libtool<br />
|| [https://packages.debian.org/jessie/libtool libtool]<br />
|| [http://packages.ubuntu.com/trusty/libtool libtool]<br />
|-<br />
| perl<br />
|| [https://packages.debian.org/jessie/perl perl]<br />
|| [http://packages.ubuntu.com/trusty/perl perl]<br />
|-<br />
| rsync<br />
|| [https://packages.debian.org/jessie/rsync rsync]<br />
|| [http://packages.ubuntu.com/trusty/rsync rsync]<br />
|-<br />
| tar<br />
|| [https://packages.debian.org/jessie/tar tar]<br />
|| [http://packages.ubuntu.com/trusty/tar tar]<br />
|}<br />
<br />
{{Warning|<ul><li>The Debian repositoriy has several libraries for dealing with HDF data files. The recommended is {{Codeline|libhdf5-serial-dev}}. However, the {{Forge|msh|msh package}} requires [http://www.geuz.org/gmsh/ gmsh] which is incompatible with it.</li><br />
<li>The GraphicsMagick++ library (libgraphicsmagick++1-dev) on the Debian repositories was compiled with quantum 8 which limits reading images to 8 bit. The solution is to recompile [[GraphicsMagick]] with quantum 16 or 32 before building Octave.</li></ul>}}<br />
<br />
=== Configuration ===<br />
<br />
As mentioned above, Octave can be compiled with the default settings using {{Codeline|./configure && make && make install}}. You can also tweak the setup using configure options. Some examples are given below for a Linux system.<br />
<br />
==== 64 bit ====<br />
<br />
To get [https://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html 64-bit] requires all linked libraries to support 64-bit variables. You can omit most of these except BLAS which gives a fatal error. This is remedied by compiling [http://www.openblas.net/ OpenBLAS] with edits to its Makefile.rule so that BINARY=64 INTERFACE64=1.<br />
<br />
<code>./configure LD_LIBRARY_PATH=/opt/OpenBLAS/lib CPPFLAGS=-I/opt/OpenBLAS/include LDFLAGS=-L/opt/OpenBLAS/lib --enable-64</code><br />
<br />
==== Java JIT ====<br />
<br />
To get the just-in-time compiler, you should specify the location of the java compiler since the autodetection script often fails.<br />
<br />
<code>./configure JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" --enable-jit</code><br />
<br />
==== HDF5 ====<br />
<br />
With current Debian versions you may get the following when building from source:<br />
<br />
HDF5 library not found. Octave will not be able to save or load HDF5 data files.<br />
<br />
The problem is that there are multiple versions of the hdf5 package. Octave was written with the serial version in mind but it is likely to work with the others (OpenMPI and Mpich). Due to the naming scheme done in Debian, it is required to specify the location of the libraries. See bug {{bug|38928}} for details but basically, use the following when running configure:<br />
<br />
./configure CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial<br />
<br />
Another issue you may have on Debian systems, even when using the correct hdf5 libraries, is that they are installed in a non-standard location which is not found by configure. This will result in the following warning after running configure:<br />
<br />
WARNING: HDF5 library not found. Octave will not be able to save or load HDF5 data files.<br />
<br />
To avoid this you can manually specify the hdf5 locations in the following way:<br />
<br />
./configure --with-hdf5-includedir=/usr/include/hdf5/serial --with-hdf5-libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial<br />
<br />
Further information can be found in [https://savannah.gnu.org/bugs/?38928 this bug discussion] starting with comment #19.<br />
<br />
[[Category:Building]]<br />
[[Category:Installation]]<br />
[[Category:Debian]]</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6475Classdef2015-06-25T13:53:46Z<p>Crobar: /* Not Supported */ corrected information</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
=== Not Supported ===<br />
<br />
* '''enumeration'''<br />
<br />
<br />
* '''build-in class as superclass'''<br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects].''' <br />
<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access.'''<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
<br />
* '''Function handles to package methods and static class methods.'''<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* '''Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working.''' <br />
For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
* '''debugging in classdef methods (and +package directory functions)'''<br />
<br />
Breakpoints cannot currently be set in classdef methods from the gui, but only from the command line:<br />
<source lang="octave"><br />
dbstop @aclass\amethod <br />
</source><br />
<br />
=== Supported ===<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6474Classdef2015-06-25T10:27:15Z<p>Crobar: /* Not Supported */</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
=== Not Supported ===<br />
<br />
* '''debugging in classdef methods (and +package directory functions)'''<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
<br />
* '''enumeration'''<br />
<br />
<br />
* '''build-in class as superclass'''<br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects].''' <br />
<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access.'''<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
<br />
* '''Function handles to package methods and static class methods.'''<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* '''Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working.''' <br />
For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
=== Supported ===<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6473Classdef2015-06-25T10:26:40Z<p>Crobar: /* Not Supported */</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
=== Not Supported ===<br />
<br />
* '''debugging in classdef methods (and +package directory functions)'''<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
<br />
* '''enumeration'''<br />
<br />
<br />
* build-in class as superclass <br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects].''' <br />
<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access.'''<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
<br />
* '''Function handles to package methods and static class methods.'''<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* '''Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working.''' <br />
For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
=== Supported ===<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6472Classdef2015-06-25T10:25:48Z<p>Crobar: /* supported */</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
=== Not Supported ===<br />
<br />
* '''debugging in classdef methods (and +package directory functions)'''<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
<br />
* '''enumeration'''<br />
<br />
<br />
* build-in class as superclass <br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects].''' <br />
<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:'''<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
<br />
* '''Function handles to package methods and static class methods.'''<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* '''Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working.''' <br />
For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
=== Supported ===<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6471Classdef2015-06-25T10:25:26Z<p>Crobar: /* not supported */</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
=== Not Supported ===<br />
<br />
* '''debugging in classdef methods (and +package directory functions)'''<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
<br />
* '''enumeration'''<br />
<br />
<br />
* build-in class as superclass <br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects].''' <br />
<br />
Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
<br />
* '''[http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:'''<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
<br />
* '''Function handles to package methods and static class methods.'''<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* '''Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working.''' <br />
For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6470Classdef2015-06-25T10:20:44Z<p>Crobar: /* not supported */</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
==== not supported ====<br />
<br />
* debugging in classdef methods (and +package directory functions)<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
* enumeration<br />
<br />
* build-in class as superclass <br />
<source lang="octave"><br />
classdef nonsense < uint32<br />
<br />
end<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects]. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
* Function handles to package methods and static class methods.<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6469Classdef2015-06-25T10:18:50Z<p>Crobar: /* supported */ aded working properties</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
==== not supported ====<br />
<br />
* debugging in classdef methods (and +package directory functions)<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
* enumeration<br />
<br />
* build-in class as superclass <br />
** <source lang="octave" enclose="none">classdef nonsense < uint32</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects]. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
* Function handles to package methods and static class methods.<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
* properties<br />
** SetAccess (public/private/protected)<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6468Classdef2015-06-25T10:11:39Z<p>Crobar: /* not supported */ moved debugging problems to the top</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
==== not supported ====<br />
<br />
* debugging in classdef methods (and +package directory functions)<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
* enumeration<br />
<br />
* build-in class as superclass <br />
** <source lang="octave" enclose="none">classdef nonsense < uint32</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects]. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
* Function handles to package methods and static class methods.<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6467Classdef2015-06-25T10:10:41Z<p>Crobar: /* not supported */ added fuller example from bug report</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
==== not supported ====<br />
<br />
* enumeration<br />
<br />
* build-in class as superclass <br />
** <source lang="octave" enclose="none">classdef nonsense < uint32</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects]. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
* Function handles to package methods and static class methods.<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported. <br />
<br />
A fuller example is also given below:<br />
<source lang="octave"><br />
classdef method_function_handle_test<br />
<br />
% properties<br />
% <br />
% <br />
% end<br />
<br />
properties (Hidden, SetAccess = protected)<br />
hfoo = [];% handle to function<br />
end<br />
<br />
methods<br />
<br />
function self = method_function_handle_test ()<br />
self.hfoo = @foo; <br />
end<br />
<br />
function bar (self)<br />
self.hfoo (self); <br />
end<br />
<br />
end<br />
<br />
methods (Hidden, Access = protected)<br />
function foo (self)<br />
disp ('hello!');<br />
end<br />
end<br />
<br />
end<br />
</source><br />
Then running:<br />
<source lang="text"><br />
>> x = method_function_handle_test<br />
error: @foo: no function and no method found<br />
error: called from<br />
method_function_handle_test at line 17 column 17<br />
stopped in <****>/scratch/mfiles/octave_tests/method_function_handle_test.m at line 17<br />
17: self.hfoo = @foo;<br />
</source><br />
<br />
<br />
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
* debugging in classdef methods (and +package directory functions)<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6466Classdef2015-06-25T09:58:34Z<p>Crobar: /* Classdef examples in the wild */ Added FinEALE which uses classdef extensively</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
==== not supported ====<br />
<br />
* enumeration<br />
<br />
* build-in class as superclass <br />
** <source lang="octave" enclose="none">classdef nonsense < uint32</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects]. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
* Function handles to package methods and static class methods.<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported.<br />
<br />
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
* debugging in classdef methods (and +package directory functions)<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis<br />
* https://github.com/PetrKryslUCSD/FinEALE</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Classdef&diff=6465Classdef2015-06-25T09:56:52Z<p>Crobar: /* not supported */ add debugging info</p>
<hr />
<div>This page is a stub. We should begin documenting what classdef is implemented and what is not.<br />
<br />
==== not supported ====<br />
<br />
* enumeration<br />
<br />
* build-in class as superclass <br />
** <source lang="octave" enclose="none">classdef nonsense < uint32</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/redefining-concatenation-for-your-class.html concatenating objects] into [http://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html array of objects]. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
end<br />
<br />
c = MyClass();<br />
cc = [c, c]; % won't work<br />
</source><br />
<br />
For now you can use a cell-array of objects instead:<br />
<source lang="octave"><br />
cc = {c, c}; % ok<br />
</source><br />
<br />
* [http://www.mathworks.com/help/matlab/matlab_oop/mutable-and-immutable-properties.html Immutable property] set access. Example:<br />
<source lang="octave"><br />
classdef MyClass < handle<br />
properties (SetAccess = immutable)<br />
x<br />
end<br />
methods<br />
function obj = MyClass()<br />
x = rand();<br />
end<br />
end<br />
end<br />
</source><br />
<br />
Use "private" properties as workaround.<br />
<br />
* Function handles to package methods and static class methods.<br />
For example if we have <code>+mypackage/myfunc.m</code>, creating a function handle as <code>fh = @mypackage.myfunc</code> won't work.<br />
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.<br />
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported.<br />
<br />
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:<br />
<source lang="octave"><br />
classdef MyClass<br />
methods<br />
function obj = MyClass()<br />
myfunc()<br />
end<br />
end<br />
end<br />
<br />
function myfunc()<br />
disp('myfunc')<br />
end<br />
</source><br />
<br />
* debugging in classdef methods (and +package directory functions)<br />
<br />
Breakpoints cannot currently be set in classdef methods (or at least they are ignored). They also can't be set in functions in +package directories (which is a related issue).<br />
<br />
==== supported ====<br />
<br />
* methods<br />
** static<br />
** private<br />
<br />
==== Classdef examples in the wild ====<br />
<br />
* http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/general/inputParser.m<br />
* https://github.com/markuman/go-redis</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Summer_of_Code_-_Getting_Started&diff=4148Summer of Code - Getting Started2014-02-26T10:30:09Z<p>Crobar: /* Interface to Electronic Circuit Simulator */</p>
<hr />
<div>The following is distilled from the [[Projects]] page for the benefit of potential [http://code.google.com/soc/Google Summer] [http://sophia.estec.esa.int/socis2012/?q=node/13 of Code] (SoC) students. Although students are welcome to attempt any of the projects in that page or any of their own choosing, here we offer some suggestions on what good student projects might be.<br />
<br />
= Steps Toward a Successful Application =<br />
<br />
If you like any of the projects described below these are the steps you need to follow to apply:<br />
<br />
* '''Help Us Get To Know You'''<br><br />
: If you aren't communicating with us before the application is due, your application will not be accepted.<br />
:: '''Join the maintainers mailing list''' or read the archives and see what topics we discuss and how the developers interact with each other.<br />
:: '''Hang out in our IRC channel'''. Ask questions, submit patches, show us that you are motivated and well-prepared. There will be more applicants than we can effectively mentor, so do ask for feedback on your public application to increase the strength of your proposal!<br />
* '''Find Something That Interests You'''<br />
: It's '''critical''' that you '''find a project that excites you''' You'll be spending most of the summer working on it (we expect you to treat the SoC as a full-time job). But don't just tell us how interested you are, show us. You can do that by fixing a few bugs or interacting with us on IRC well before the deadline. Our experience shows us that successful SoC students demonstrate their interest early and often.<br />
* '''Prepare Your Proposal With Us'''<br />
: By working with us to prepare your proposal, you'll be getting to know us and showing us how you approach problems. The best place for this is your wiki user page and the IRC channel.<br />
* '''Complete Your Application'''<br />
: Fill out our '''''public''''' application template.<br />
:: This is best done by '''[[Special:CreateAccount|creating an account at this wiki]]''' and copying the '''[[Template:Student_application_template_public|template]]''' from its page.<br/><br />
:: You really only need to copy and answer the '''''public''''' part there, there is no need to showcase everything else to everybody reading your user page!<br />
: Fill out our '''''private''''' application template.<br />
:: This is best done by copying the '''[[Template:Student_application_template_private|template]]''' from its page and '''adding the required information to your application at Google (melange)''' or at '''ESA'''.<br><br />
:: Only the organization admin and the possible mentors will see this data. You can still edit it after submitting until the deadline!<br />
<br />
== Things You'll be Expected to Know or Quickly Learn ==<br />
<br />
Octave is mostly written in C++ and its own scripting language that is mostly compatible with Matlab. There are bits and pieces of Fortran, Perl, C, awk, and Unix shell scripts here and there. In addition to being familiar with C++ and Octave's scripting language, successful applicants will be familiar with or able to quickly learn about Octave's infrastructure. You can't spend the whole summer learning how to build Octave or prepare a changeset and still successfully complete your project.<br />
<br />
* '''The Build System'''<br />
: [http://en.wikipedia.org/wiki/GNU_build_system The GNU build system] is used to build Octave.<br />
: While you generally don't need to understand too much unless you actually want to change how Octave is built, you should be able to understand enough to get a general idea of how to build Octave.<br />
: If you've ever done a <tt>configure && make && make install</tt> series of commands, you have already used the GNU build system.<br />
: '''You must demonstrate that you are able to build the development version of Octave from sources before the application deadline.'''<br />
* '''The Version Control System'''<br />
: We use [http://mercurial.selenic.com/ Mercurial] (abbreviated hg).<br />
: Mercurial is the [http://en.wikipedia.org/wiki/Distributed_Version_Control_System distributed version control system] (DVCS) we use for managing our source code. You should have some basic understanding of how a DVCS works, but hg is pretty easy to pick up, especially if you already know a VCS like git or svn.<br />
* '''The Procedure for Contributing Changesets'''<br />
: You will be expected to follow the same procedures as other contributors and core developers.<br />
: You will be helping current and future Octave developers by using the same style for changes, commit messages, and so on. You should also read the same [http://www.gnu.org/software/octave/doc/interpreter/Contributing-Guidelines.html#Contributing-Guidelines contributing] [http://hg.savannah.gnu.org/hgweb/octave/file/tip/etc/HACKING guidelines] we have for everyone.<br />
* '''The Maintainers Mailing List'''<br />
: We primarily use [https://mailman.cae.wisc.edu/listinfo/octave-maintainers mailing lists] for communication among developers.<br />
: The mailing list is used most often for discussions about non-trivial changes to Octave, or for setting the direction of development.<br />
: You should follow basic mailing list etiquette. For us, this mostly means "do not [http://en.wikipedia.org/wiki/Top_posting#Top-posting top post]".<br />
* '''The IRC Channel'''<br />
: We also have [http://webchat.freenode.net?channels=octave the #octave IRC channel in Freenode].<br />
: You should be familiar with the IRC channel. It's very helpful for new contributors (you) to get immediate feedback on ideas and code.<br />
: Unless your primary mentor has a strong preference for some other method of communication, the IRC channel will likely be your primary means of communicating with your mentor and Octave developers.<br />
* '''The Octave Forge Project'''<br />
: [http://octave.sf.net Octave-Forge] is a project closely related to Octave where packages reside. They are somewhat analogous to Matlab's toolboxes.<br />
* '''Related Skills'''<br />
: In addition, you probably should know '''some''' mathematics, engineering, or experimental science or something of the sort.<br />
: If you've used Matlab before, you probably have already been exposed to the kinds of problems that Octave is used for.<br />
<br />
<noinclude>[[Category:Summer of Code]]</noinclude><br />
<br />
= Suggested projects =<br />
<br />
The following projects are broadly grouped by category and probable skills required to tackle each. Remember to check [[Projects]] for more ideas if none of these suit you, and your own ideas are always welcome.<br />
<br />
== Numerical ==<br />
<br />
These projects involve implementing certain mathematical functions in Octave.<br />
<br />
'''Required skills''': You should understand quite a bit of mathematics. Words like "eigenvalue", "analytic", and "Taylor series" shouldn't scare you at all. There is probably little C++ experience required, and probably many of these problems can be solved with m-scripts.<br />
<br />
'''Difficulty''': Mid-to-hard depending how much mathematics you know and how well you can read numerical analysis journal articles.<br />
<br />
'''Potential mentor''': Carlo de Falco, Fotios Kasolis, Luis Gustavo Lira<br />
<br />
=== Incomplete sparse factorizations ichol, ilu ===<br />
<br />
Octave still lacks of an incomplete Cholesky and LU factorization for sparse matrices. These functions are [http://www.mathworks.com/help/matlab/matrix-decomposition.html available in Matlab] as ichol and ilu. Incomplete factorizations are useful as preconditioners for iterative solvers such as [http://hg.savannah.gnu.org/hgweb/octave/file/812162c34a93/scripts/sparse/gmres.m gmres] or [http://hg.savannah.gnu.org/hgweb/octave/file/812162c34a93/scripts/sparse/pcg.m pcg].<br />
<br />
Good introductions to the math behind these factorizations are:<br />
* [http://netlib.org/linalg/html_templates/node81.html Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods] especially [http://netlib.org/linalg/html_templates/node100.html#SECTION00933000000000000000 this chapter] <br />
* [http://www-users.cs.umn.edu/~saad/IterMethBook_2ndEd.pdf Iterative Methods for Sparse Linear Systems (2nd Edition)] chapter 10 (also available as textbook)<br />
<br />
One should additionally familiarize with Octave's internal sparse matrix format which is [http://netlib.org/linalg/html_templates/node92.html#SECTION00931200000000000000 CCS] rather than [http://netlib.org/linalg/html_templates/node91.html#SECTION00931100000000000000 CRS], used in the listed textbooks. In the past GSoC a solution using [http://www-users.cs.umn.edu/~saad/software/ITSOL/ ITSOL] has been created. This work needs several improvements before it can be integrated into the Octave core. Read more about the past GSoC project in [http://siko1056-gsoc.blogspot.de/ this blog]. A [http://siko1056-gsoc.blogspot.de/p/getting-my-work.html demo implementation] is also available from there.<br />
<br />
Compared to other projects in this section this one might require more knowledge of C++ and mathematical software programming. But this project doesn't need to be started from scratch and can be continued from the previous approach, if desired. For more information feel free to contact <k.ohlhus@gmail.com>.<br />
<br />
=== General purpose Finite Element library ===<br />
<br />
Octave-Forge already has a set of packages for discretizing Partial Differential operators by Finite Elements and/or Finite Volumes,<br />
namely the [[bim package]] which relies on the [http://octave.sf.net/msh msh package] (which is in turn based on [http://geuz.org/gmsh/ gmsh]) for creating and managing 2D triangular and 3D tetrahedral meshes and on the [http://octave.sf.net/fpl fpl package] for visualizing 2D results within Octave or exporting 2D or 3D results in a format compatible with [http://www.paraview.org Paraview] or [https://wci.llnl.gov/codes/visit/ VisIT]. These packages, though, offer only a limited choice of spatial discretization methods which are based on low degree polynomials and therefore have a low order of accuracy even for problems with extremely smooth solutions.<br />
The [http://geopdes.sf.net GeoPDEs] project, on the other hand, offers a complete suite of functions for discretizing a wide range of<br />
differential operators related to important physical problems and uses basis functions of arbitrary polynomial degree that allow the construction of methods of high accuracy. These latter, though, are based on the IsoGeometric Analysis Method which, although very powerful and often better performing, is less widely known and adopted than the Finite Elements Method. The implementation of a general purpose library of Finite Elements seems therefore a valuable addition to Octave-Forge. Two possible interesting choices for implementing this package exist, the first consists of implementing the most common Finite Element spaces in the [http://geopdes.sf.net GeoPDEs] framework, which is possible as IsoGeometric Analysis can be viewed as a superset of the Finite Element Method, the other is to construct Octave language bindings for the free software library [http://fenicsproject.org/documentation/ FEniCS] based on the existing C++ or Python interfaces. This second approach has been developed during the GSOC 2013 and the Octave-Forge package [http://octave.sf.net/fem-fenics fem-fenics] is now available. However, fem-fenics could be extended in many different ways:<br />
* implement the bindings for the UFL language inside Octave<br />
* add new functions already available with Fenics but not yet in Octave<br />
* create new functions specifically suited for Octave<br />
* improve the efficiency of the code<br />
The main goal for the fem-fenics package is ultimately to be merged with the FEnics project itself, so that it can remain in-sync with the main library development.<br />
<br />
=== Improve logm, sqrtm, funm ===<br />
<br />
The goal here is to implement some missing Matlab functions related to matrix functions like the [http://en.wikipedia.org/wiki/Matrix_exponential matrix exponential]. There is [http://octave.1599824.n4.nabble.com/matrix-functions-td3137935.html a general discussion] of the problem.<br />
<br />
=== Generalised eigenvalue problem ===<br />
<br />
[http://www.mathworks.com/help/techdoc/ref/eig.html Certain calling forms] of the <tt>eig</tt> function are missing. The problem is to understand what those missing forms are and implement them.<br />
<br />
=== Various sparse matrix improvements ===<br />
<br />
The implementation of sparse matrices in Octave needs several improvements. Any of [[Projects#Sparse Matrices|these]] would be good. The paper by [http://arxiv.org/abs/cs.MS/0604006 Bateman & Adler] is good reading for understanding the sparse matrix implementation.<br />
<br />
=== Implement solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D ===<br />
<br />
The project will deliver a solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D similar to Matlab's function <tt>pdepe</tt>. A good starting point is the [http://en.wikipedia.org/wiki/Method_of_lines method of lines] for which you can find more details [http://en.wikibooks.org/wiki/Partial_Differential_Equations/Method_of_Lines here] and [http://www.scholarpedia.org/article/Method_of_lines here], whereas an example implementation can be found [http://www.scholarpedia.org/article/Method_of_Lines/Example_Implementation here]. In addition, [http://www.pdecomp.net/ this page] provides some useful material.<br />
<br />
=== Implement solver for 1D nonlinear boundary value problems ===<br />
<br />
The project will complete the implementation of the bvp4c solver that is already available in an initial version in the odepkg package<br />
by adding a proper error estimator and will implement a matlab-compatible version of the bvp5c solver.<br />
Details on the methods to be implemented can be found in [http://dx.doi.org/10.1145/502800.502801 this paper] on bvp4c and [http://www.jnaiam.net/new/uploads/files/014dde86eef73328e7ab674d1a32aa9c.pdf this paper] on bvp5c. Further details are available in [http://books.google.it/books/about/Nonlinear_two_point_boundary_value_probl.html?id=s_pQAAAAMAAJ&redir_esc=y this book].<br />
<br />
=== Geometric integrators for Hamiltonian Systems ===<br />
<br />
[http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration Geometric (AKA Symplectic) integrators] are useful for <br />
multi-dimensional classical mechanics problems and for molecular dynamics simulations.<br />
The odepkg package has a number of solvers for ODE, DAE and DDE problems but none of them is currently<br />
specifically suited for second order problems in general and Hamiltonian systems in particular.<br />
Therefore a new package for geometric integrators would be a useful contribution.<br />
This could be created as new package or added as a set of new functions for odepkg.<br />
The function interface should be consistent throughout the package and should be modeled to follow <br />
that of other functions in odepkg (or that of DASPK and LSODE) but will need specific extensions to accommodate for specific options that only make sense for this specific class of solvers.<br />
An initial list of methods to be implemented includes (but is not limited to)<br />
* Symplectic Euler methods, see [http://en.wikipedia.org/wiki/Semi-implicit_Euler_method here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Störmer-Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Velocity Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Symplectic partitioned Runge-Kutta methods, see [http://reference.wolfram.com/mathematica/tutorial/NDSolveSPRK.html here] or [http://dx.doi.org/10.1137/0733019 here]<br />
* Spectral Variational Integrator methods, see [http://www3.nd.edu/~izaguirr/papers/acta_numerica.pdf here] or [http://www.math.ucsd.edu/~mleok/pdf/HaLe2012_SVI.pdf here]<br />
<br />
For this latter there is an existing code which is already working but needs to be improved, posted on the patch tracker.<br />
Furthermore, methods to implement solutions of problems with rigid constraints should be implemented, e.g.<br />
* SHAKE, see [http://en.wikipedia.org/wiki/Constraint_algorithm here] or [http://dx.doi.org/10.1016/0021-9991(77)90098-5 here]<br />
* RATTLE, see [http://dx.doi.org/10.1016/0021-9991(83)90014-1 here] or [http://dx.doi.org/10.1002/jcc.540161003 here]<br />
<br />
'''Potential mentor:''' Mattia Penati, Edie Miglio, Carlo de Falco<br />
<br />
=== Matlab-compatible ODE solvers in core-Octave ===<br />
<br />
* Adapt "odeset" and "odeget" from the odepkg package so that the list of supported options is more Matlab-compatible, in the sense that all option names that are supported by Matlab should be available. On the other hand, Matlab returns an error if an option which is not in the list of known options is passed to "odeset", but we would rather make this a warning in order to allow for special extensions, for example for symplectic integrators.<br />
* Adapt the interface of "ode45" in odepkg to be completely Matlab compatible, fix its code and documentation style and move it to Octave-core.<br />
* Build Matlab compatible versions of "ode15s" and "ode15i". jwe has prototype implementations [https://savannah.gnu.org/patch/index.php?8102|here] of these built as wrappers to "dassl" and "daspk". An initial approach could be to just improve these wrappers, but eventually it would be better to have wrappers for "IDA" from the sundials library.<br />
* Implement Matlab compatible versions of "deval".<br />
<br />
'''Potential mentor:''' Sebastian Schöps, Carlo de Falco<br />
<br />
== GUI ==<br />
<br />
Octave currently includes an experimental native GUI, written in Qt. There are various ways in which it could be improved.<br />
<br />
'''Required skills''': C++ and Qt. Whatever tools you want to use to write Qt code are fine, but Qt Creator is a popular choice nowadays.<br />
<br />
'''Difficulty''': Mostly medium, depending if you've had Qt or GUI development experience before.<br />
<br />
'''Potential mentor''': Jordi Gutiérrez Hermoso, Michael Goffioul, Torsten<br />
<br />
=== Finish the Octave GUI ===<br />
<strike><br />
The GUI is currently on its own branch in hg. It is not stable enough and its design is still in flux. It is in a very alpha stage and needs to be turned into a real usable product. At the moment, it consists of the basic building blocks (terminal window, editor, variable browser, history, file browser) that are put together into a main interface. The GUI uses the Qt library. Among the things to improve are:<br />
* improve integration with octave: variable browser/editor, debugger, profiler...<br />
* define and implement an option/preferences dialog<br />
* improve additional components like the documentation browser<br />
</strike><br />
Fix existing bugs related to the GUI, which can be browsed [https://savannah.gnu.org/bugs/index.php?go_report=Apply&group=octave&func=browse&set=custom&msort=0&report_id=100&advsrch=0&status_id=1&resolution_id=0&assigned_to=0&category_id=107&bug_group_id=0&history_search=0&history_field=0&history_event=modified&history_date_dayfd=5&history_date_monthfd=2&history_date_yearfd=2014&chunksz=50&spamscore=5&boxoptionwanted=1#options here]<br />
<br />
=== Implement a Qt widget for manipulating plots ===<br />
<br />
Octave has had for some time a native OpenGL plotter. The plotter requires some user interaction for manipulating the plots, and it's been using fltk for quite some time. We want to replace this with Qt, so it fits better with the overall GUI look-and-feel and is easier to extend in the future.<br />
<br />
[https://github.com/goffioul/QtHandles QtHandles] is a current work in progress integrating the octave OpenGL renderer plus good support for GUI elements (uicontrol, uimenu, uitoolbar...). This project may initially consists of integrating the existing QtHandles code base into Octave. Then if time permits, further improvements can be made to QtHandles.<br />
<br />
=== Create a better (G)UI for the profiler ===<br />
<br />
During GSoC 2011, Daniel Kraft successfully implemented a profiler for Octave. It needs a better interface and a way to generate reports. This may be done with Qt, but not necessarily, and HTML reports might also be good.<br />
<br />
=== Create a graphical design tool for tuning closed loop control system (control pkg) ===<br />
<br />
When tuning a SISO feedback system it is very helpful to be able to grab a pole or a zero and move them by dragging them with the mouse. As they are moving the software must update all the plotted lines. There should be the ability to display various graphs rlocuse, bode, step, impulse etc. and have them all change dynamically as the mouse is moving. The parameters of the compensator must be displayed and updated.<br />
Potential mentor: Doug Stewart<br />
<br />
== Graphics ==<br />
<br />
Octave has a new native OpenGL plotter (currently via [http://en.wikipedia.org/wiki/Fltk fltk], but we want to move away from that). There are several possible projects involved with it.<br />
<br />
'''Required skills''': C++ and OpenGL. General understanding of computer graphics.<br />
<br />
'''Difficulty''': Medium, depending on your previous understanding of the topic.<br />
<br />
'''Potential mentor''': Michael Goffioul<br />
<br />
=== Lighting ===<br />
<br />
Implement transparency and lighting in OpenGL backend(s). A basic implementation is available in [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/jhandles/ JHandles]. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of Octave.<br />
<br />
=== Object selection in OpenGL renderer ===<br />
<br />
This project is about the implementation of a selection method of graphics elements within the OpenGL renderer [http://glprogramming.com/red/chapter13.html]<br />
<br />
=== Non-OpenGL renderer ===<br />
<br />
Besides the original gnuplot backend, Octave also contains an OpenGL-based renderer for advanced and more powerful 3D plots. However, OpenGL is not perfectly suited for 2D-only plots where other methods could result in better graphics. The purpose of this project is to implement an alternate graphics renderer for 2D only plots (although 3D is definitely not the focus, extending the new graphics renderer to support basic 3D features should also be taken into account). There is no particular toolkit/library that must be used, but natural candidates are:<br />
* [http://qt.nokia.com Qt]: the GUI is currently written in Qt and work is also in progress to provide a Qt/OpenGL based backend [https://github.com/goffioul/QtHandles]<br />
* [http://en.wikipedia.org/wiki/Cairo_%28software%29 Cairo]: this library is widely used and known to provides high-quality graphics with support for PS/PDF/SVG output.<br />
<br />
=== TeX/LaTeX markup ===<br />
<br />
Text objects in plots (like titles, labels, texts...) in the OpenGL renderer only support plain text mode without any formatting possibility. Support for TeX and/or LaTeX formatting needs to be added.<br />
<br />
* The TeX formatting support actually only consists of a very limited subset of the TeX language. This can be implemented directly in C++ into Octave by extending the existing text engine, avoiding to add a dependency on a full TeX system. Essentially, support for Greek letters, super/sub-scripts, and several mathematical symbols needs to be supported. For example,<br />
<br />
:<pre>\alpha \approx \beta_0 + \gamma^\chi</pre><br />
<br />
:Would be rendered as,<br />
<br />
:&alpha; &asymp; &beta;<sub>0</sub> + &gamma;<sup>&chi;</sup><br />
<br />
:This is analogous to how special characters may be included in a wiki using html.<br />
<br />
:<pre>&amp;alpha; &amp;asymp; &amp;beta;<sub>0</sub> + &amp;gamma;<sup>&amp;chi;</sup></pre><br />
<br />
:The text object's {{Codeline|extent}} for the rendered result needs to be calculated and the text placed the location specified by the text object's {{Codeline|position}} property. An itemized list of a text objects properties can be found [http://www.gnu.org/software/octave/doc/interpreter/Text-Properties.html here].<br />
<br />
* On the other hand, the LaTeX formatting support is expected to provide full LaTeX capabilities. This will require to use an external LaTeX system to produce text graphics in some format (to be specified) that is then integrated into Octave plots.<br />
<br />
:The matplotlib project [http://matplotlib.sourceforge.net/users/usetex.html has already done this in Python] and might be used as an example of how to do this in Octave. Mediawiki has also also done [http://en.wikipedia.org/wiki/Wikipedia:Texvc something similar]. There is also [http://forge.scilab.org/index.php/p/jlatexmath/ JLaTeXMath], a Java API to display LaTeX code in mathematical mode.<br />
<br />
== Interpreter ==<br />
<br />
The interpreter is written in C++, undocumented. There are many possible projects associated with it.<br />
<br />
'''Required skills''': ''Very good'' C and C++ knowledge, possibly also understanding of [http://en.wikipedia.org/wiki/Gnu_bison GNU bison] and [http://en.wikipedia.org/wiki/Flex_lexical_analyser flex]. Understanding how compilers and interpreters are made plus being able to understand how to use a profiler and a debugger will probably be essential skills.<br />
<br />
'''Difficulty''': Mid hard to very hard. Some of the biggest problems will probably be the interpreter.<br />
<br />
'''Potential mentors''': John W. Eaton, Jordi Gutiérrez Hermoso, Max Brister.<br />
<br />
=== Improve JIT compiling ===<br />
<br />
Octave's interpreter is ''very'' slow on some loops. Last year, thanks to Max Brister's work, an initial implement of a just-in-time compiler (JITC) in [http://llvm.org LLVM] for GSoC 2012. This project consists in understanding Max's current implementation and extending it so that functions and exponents (e.g. 2^z) compile with the JITC. This requires knowledge of compilers, C++, LLVM, and the Octave or Matlab languages. A capable student who demonstrates the ability to acquire this knowledge quickly may also be considered. Max himself will mentor this project. [http://planet.octave.org/octconf2012/jit.pdf Here] is Max's OctConf 2012 presentation about his current implementation. See also [[JIT]].<br />
<br />
=== Improve memory management ===<br />
<br />
From profiling the interpreter, it appears that a lot of time is spending allocating and deallocating memory. A better memory management algorithm might provide some improvement.<br />
<br />
=== Implement classdef classes ===<br />
<br />
Matlab has two kinds of classes: old style @classes and new style classdef. Octave has only fully implemented the old style. There is partial support for new classes in [http://hg.savannah.gnu.org/hgweb/octave/shortlog/classdef our classdef branch]. There is irregular work here, and classdef is [http://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html a very] [http://www.mathworks.com/help/matlab/events-sending-and-responding-to-messages.html complicated] [http://www.mathworks.com/help/matlab/enumeration-classes.html thing] to fully implement. A successful project would be to implement enough of classdef for most basic usages. Familiarity with Matlab's current classdef support would be a huge plus. Michael Goffioul and jwe can mentor this.<br />
<br />
== Infrastructure ==<br />
<br />
There are several projects closely related to Octave but not exactly core Octave that could be worked on. They are mostly infrastructure around Octave, stuff that would help a lot.<br />
<br />
'''Required skills''': Various. See below.<br />
<br />
'''Difficulty''': Various. See below.<br />
<br />
'''Potential mentor''': Jordi Gutiérrez Hermoso, Carlo de Falco<br />
<br />
=== Finish the Agora website ===<br />
<br />
In 2009, the Mathworks decided to restrict the terms of use Matlab Central, a place dedicated to Matlab collaboration. The Mathworks forbade copyleft licenses and using the "free" code found in Matlab central on anything other than Mathworks products (e.g. forbidding from using it on Octave, even if the authors of the code wanted to allow this). Thus Octave users have no place to centrally, quickly, and conveniently share Octave code. See the [[FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21|FAQ]] for more details.<br />
<br />
In response to this, a website started to form, [http://agora.octave.org/ Agora Octave].<br />
<br />
This should be relatively easy webdev in Python using [http://en.wikipedia.org/wiki/Django_%28web_framework%29 Django].<br />
<br />
Things to be considered when working on this:<br />
<br />
* [http://octave-forge.blogspot.ie/2012/08/octconf2012-agora-and-pkg.html discussion of Agora during OctConf2012]<br />
* [http://scipy-central.org/ Scipy Central] - a website with the same objective as Agora for Scipy. Their [https://github.com/kgdunn/SciPyCentral/ code] is released under a BSD license. Might be useful to reuse some parts.<br />
<br />
Most of the basic functionality of Agora is already in, but there are many ways in which it could be improved, such as implementing comment threads, giving it an email interface, or a ReSTful API which could be used from Octave for package management. See also [[Agora]].<br />
<br />
=== Improve binary packaging ===<br />
<br />
We would like to be able to easily generate binary packages for Windows and Mac OS X. Right now, it's difficult and tedious to do so. Any way to help us do this in a faster way would be appreciated. Required knowledge is understanding how building binaries in Windows and Mac OS X works. Our current approach to fixing this is to cross-compile from a GNU system using [http://mxe.cc/ MXE] or [http://lilypond.org/gub/ GUB].<br />
<br />
'''Skills Required''': Knowledge of GNU build systems, Makefiles, configure files, chasing library dependencies, how to use a compiler. If you choose to work on GUB, Python will be required. No m-scripting or C++ necessary, beyond understanding [http://david.rothlis.net/c/compilation_model/ the C++ compilation model].<br />
<br />
'''Difficulty''': Medium to easy. You need to understand how build systems work and how to fix packages when they don't build.<br />
<br />
'''Possible mentors''': John W. Eaton or Jordi Gutiérrez Hermoso<br />
<br />
=== Installation of packages ===<br />
We would like to enhance the management of Octave-forge packages from within Octave environment. Currently there is a working (but rather monolithic) function that is used to do the job. The work would be to improve the way Octave interacts with the package server. Since the functionality is already sketched by the current function, the most important skill is software design.<br />
<br />
'''Minimum requirements''': Ability to read and write Octave code. Minimal FTP/HTTP knowledge.<br />
<br />
'''Difficulty''': Easy<br />
<br />
== Octave-Forge packages ==<br />
<br />
=== Improve MPI package ===<br />
Octave Forge's [http://octave.sourceforge.net/mpi/index.html MPI package] <br />
is a wrapper for basic MPI functions for parallel computing. It is implemented <br />
by wrapping MPI function calls in simple DLD functions that map Octave's Datataypes to <br />
MPI Derived Datatypes. <br />
The proposed project deals with improving and extending the Octave MPI package, for example:<br />
* Octave MPI applications can currently be only run in batch mode, add the ability to launch parallel jobs and collect their output in an interactive Octave session.<br />
* Implement functions for non-blocking communication (MPI_Isend, MPI_Irecv)<br />
* Implement one-to-many (Broadcast, Scatter), many-to-one (Reduce, Gather), and many-to-many (All Reduce, Allgather) communication routines<br />
<br />
'''Required skills''': C++. Message Passing Interface (MPI).<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Carlo de Falco, Michael Creel, Sukanta Basu<br />
<br />
=== Rewrite symbolic package ===<br />
Octave's current [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/symbolic/ symbolic] package for symbolic computation is outdated, fragile and limited in its capabilities. The new symbolic package should offer better Matlab compatibility, for example handling of symbolic matrices. Like the current symbolic package, the new package could use the proven [http://www.ginac.de/ GiNaC] library for symbolic computations.<br />
<br />
The work would be to integrate GiNaC by using Octave's objects and classes. This can be done in C++ in a way similar to Michele Martone's new [http://librsb.sourceforge.net/ sparsersb] package.<br />
<br />
This idea has not been selected by any SoC student yet, if you want to see it happen before next SoC<br />
you can offer a bounty [http://www.freedomsponsors.org/core/issue/289/gnu-octave-rewrite-the-symbolic-package here].<br />
<br />
'''Required skills''': C++. Ability to understand Octave and GiNaC API documentation.<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Lukas Reichlin<br />
<br />
=== Improvements to N-dimensional image processing ===<br />
<br />
The image package has partial functionality for N-dimensional images. These images do exist in practice for example in medical imaging where slices from scans are assembled to form anatomical 3D images, or even exposures taken over time on different wavelengths can result in 5D images. As part of GSoC 2013, the core functions {{codeline|imwrite}} and {{codeline|imread}} were extended to better support this type of images. Likewise, many functions in the image package, mostly morphology operators, were expanded to deal with this type of images. Still, many are left to, specially image transformation and analysis of ROIs.<br />
<br />
Note that while many of the functions in the image package will not complain about ND images, they are actually not correctly implemented and will give incorrect results.<br />
<br />
'''Required skills''': Mostly m-file scripting, some C++. Familiarity with common CS algorithms will be useful.<br />
<br />
'''Difficulty''': difficult.<br />
<br />
'''Potential mentor''': Jordi Gutiérrez Hermoso<br />
<br />
=== Interface to Electronic Circuit Simulator ===<br />
<br />
[http://sourceforge.net/projects/qucs/ Qucs] is a C++ based circuit simulation package. This project aims to improve the interface to the Qucs algorithms to allow the transient, i.e. time series, simulation of circuits in Octave within a larger ODE system simulation driven by Octave. Other possible goals would be to make other analysis types available directly from Octave. There is an existing C++ interface which is based on handle class syntax available in the development version of Octave. The Qucs interface is intended to have two modes, synchronous and asynchronous. The asynchronous mode uses qucs to solve a circuit between two given time steps (internally taking as many smaller time steps as required), returning only the final result. This method is well developed. The alternative synchronous mode is intended to give full control of the time steps to Octave, and it is this mode which requires more work. A simple synchronous interface exists which can be built upon.<br />
<br />
'''Required skills''': C++ and m-file scripting. Familiarity with new classdef syntax would be useful. May require some modification/adaptation of the Qucs sources. Familiarity with the Octave ODE solvers useful but not essential. Ability to compile Octave from the development sources.<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Richard Crozier<br />
<br />
'''Main Goals'''<br />
* Improve the functionality of the transient solver interface by implementing a robust synchronous simulation mode that integrates well with Octave ode solvers, particularly those from the odepkg package from OctaveForge. <br />
* Create interface to other analysis types (AC, DC, S-Parameter and Harmonic Balance)<br />
* Packaging the interface for Octave, to make it available through OctaveForge<br />
<br />
=== Color management functions in image package ===<br />
<br />
The goal is to implement these functions:<br />
<br />
iccread<br />
iccwrite<br />
makecform<br />
applycform<br />
<br />
These functions are useful for color management, in particular for converting data (especially images) between color spaces. ICC profiles are essentially used to store look-up tables or matrix transforms (or both) that define the conversions. For example, to convert an CMYK image to sRGB, you would load a "print" ICC profile that defines the conversion from CMYK to L*a*b* (the CIE color space that is supposed to match the human visual system), then load another profile that defines the conversion from L*a*b* to sRGB (there is a standard profile for this conversion (IEC 61966-2-1), which is why Matlab has a built-in conversion from sRGB to L*a*b*). To do the above conversions in Matlab, you would use the following code:<br />
<br />
<syntaxhighlight lang="octave"><br />
cmykImage = double(imread('cmyk-image-filename.tif'));<br />
iccProfile = iccread('icc-profile-filename.icc');<br />
labImage = applycform(cmykImage, makecform('clut', iccProfile, 'AToB3'));<br />
rgbImage = applycform(labImage, makecform('lab2srgb'));<br />
</syntaxhighlight><br />
<br />
The <code>'AToB3'</code> selects one of the color transforms (look-up tables) contained in the profile. This one is "Absolute Colorimetric." More details on ICC profiles may be obtained from [http://www.color.org/icc_specs2.xalter the ICC spec].<br />
<br />
Knowledge of ICC profiles (at least knowledge of their application) would be a prerequisite. Since [http://www.littlecms.com/ littlecms] implements all the necessary functions for reading, writing, and applying profiles, it would be primarily a matter of integrating this library into Octave (assuming that is the preferred implementation -- one could certainly read the ICC files directly, but why reinvent that particular wheel).<br />
<br />
'''Required skills''': C++ programming, some knowledge of ICC profiles desirable.<br />
<br />
'''Difficulty''': Easy.<br />
<br />
'''Possible Mentor''': Patrick Noffke <patrick.noffke@gmail.com><br />
<br />
=== High Precision Arithmetic Computation ===<br />
The Linear Algebra Fortran libraries used by Octave make use of of single (32 bits) and double (64 bits) precision floating point numbers. Many operations are stopped when matrices condition number goes below 1e-16: such matrices are considered as ill-conditionned. There are cases where this is not enough, for instance simulations implying chemical concentrations covering the range 10^4 up to 10^34. There are a number of ways to increase the numerical resolution, like f.i. make use of 128 bits quadruple precision numbers available in GFortran. A simpler option is to build an interface over Gnu MPL arbitrary precision library, which is used internally by gcc and should be available on any platform where gcc runs. Such approach has been made available for MatLab under the name mptoolbox and is licensed under a BSD license. The author kindly provided a copy of the latest version and agreed to have it ported under Octave and re-distributed under GPL v3.0<br />
<br />
The architecture consists of an Octave class interface implementing "mp" (multi-precision) objects. Arithmetic operations are forwarded to MPL using MEX files. This is totally transparent to the end user, except when displaying numbers. This implementation needs to be ported and tested under Octave. <br />
<br />
'''Required skills''': Octave classes and object programming. C for understanding the MEX glue code.<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Pascal Dupuis<br />
<br />
=== Mapping package ===<br />
The [[Mapping package]] has started but lacks many functions, see [[Mapping package#Missing functions]]. Source code for some of the calculations has been donated and could be ported, or at least used for testing. Choose this project if you'd like to learn more about mapping and GPS!<br />
<br />
'''Required skills''': m-file scripting<br />
<br />
'''Difficulty''': medium<br />
<br />
'''Potential mentor''': TBD<br />
<br />
= HG Procedures for students and mentors =<br />
<br />
[[Hg_instructions_for_mentors#Mercurial_Tips_for_SoC_students | This page]] describes the procedures students are expected to use to publicly display their progress in a public mercurial repo during their work.<br />
<br />
[[hg instructions for mentors | This page]] describes what mentors should do to review their work.<br />
<br />
[[Category:Summer of Code]]<br />
[[Category:Project Ideas]]</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Summer_of_Code_-_Getting_Started&diff=4147Summer of Code - Getting Started2014-02-26T10:24:55Z<p>Crobar: /* Interface to Electronic Circuit Simulator */</p>
<hr />
<div>The following is distilled from the [[Projects]] page for the benefit of potential [http://code.google.com/soc/Google Summer] [http://sophia.estec.esa.int/socis2012/?q=node/13 of Code] (SoC) students. Although students are welcome to attempt any of the projects in that page or any of their own choosing, here we offer some suggestions on what good student projects might be.<br />
<br />
= Steps Toward a Successful Application =<br />
<br />
If you like any of the projects described below these are the steps you need to follow to apply:<br />
<br />
* '''Help Us Get To Know You'''<br><br />
: If you aren't communicating with us before the application is due, your application will not be accepted.<br />
:: '''Join the maintainers mailing list''' or read the archives and see what topics we discuss and how the developers interact with each other.<br />
:: '''Hang out in our IRC channel'''. Ask questions, submit patches, show us that you are motivated and well-prepared. There will be more applicants than we can effectively mentor, so do ask for feedback on your public application to increase the strength of your proposal!<br />
* '''Find Something That Interests You'''<br />
: It's '''critical''' that you '''find a project that excites you''' You'll be spending most of the summer working on it (we expect you to treat the SoC as a full-time job). But don't just tell us how interested you are, show us. You can do that by fixing a few bugs or interacting with us on IRC well before the deadline. Our experience shows us that successful SoC students demonstrate their interest early and often.<br />
* '''Prepare Your Proposal With Us'''<br />
: By working with us to prepare your proposal, you'll be getting to know us and showing us how you approach problems. The best place for this is your wiki user page and the IRC channel.<br />
* '''Complete Your Application'''<br />
: Fill out our '''''public''''' application template.<br />
:: This is best done by '''[[Special:CreateAccount|creating an account at this wiki]]''' and copying the '''[[Template:Student_application_template_public|template]]''' from its page.<br/><br />
:: You really only need to copy and answer the '''''public''''' part there, there is no need to showcase everything else to everybody reading your user page!<br />
: Fill out our '''''private''''' application template.<br />
:: This is best done by copying the '''[[Template:Student_application_template_private|template]]''' from its page and '''adding the required information to your application at Google (melange)''' or at '''ESA'''.<br><br />
:: Only the organization admin and the possible mentors will see this data. You can still edit it after submitting until the deadline!<br />
<br />
== Things You'll be Expected to Know or Quickly Learn ==<br />
<br />
Octave is mostly written in C++ and its own scripting language that is mostly compatible with Matlab. There are bits and pieces of Fortran, Perl, C, awk, and Unix shell scripts here and there. In addition to being familiar with C++ and Octave's scripting language, successful applicants will be familiar with or able to quickly learn about Octave's infrastructure. You can't spend the whole summer learning how to build Octave or prepare a changeset and still successfully complete your project.<br />
<br />
* '''The Build System'''<br />
: [http://en.wikipedia.org/wiki/GNU_build_system The GNU build system] is used to build Octave.<br />
: While you generally don't need to understand too much unless you actually want to change how Octave is built, you should be able to understand enough to get a general idea of how to build Octave.<br />
: If you've ever done a <tt>configure && make && make install</tt> series of commands, you have already used the GNU build system.<br />
: '''You must demonstrate that you are able to build the development version of Octave from sources before the application deadline.'''<br />
* '''The Version Control System'''<br />
: We use [http://mercurial.selenic.com/ Mercurial] (abbreviated hg).<br />
: Mercurial is the [http://en.wikipedia.org/wiki/Distributed_Version_Control_System distributed version control system] (DVCS) we use for managing our source code. You should have some basic understanding of how a DVCS works, but hg is pretty easy to pick up, especially if you already know a VCS like git or svn.<br />
* '''The Procedure for Contributing Changesets'''<br />
: You will be expected to follow the same procedures as other contributors and core developers.<br />
: You will be helping current and future Octave developers by using the same style for changes, commit messages, and so on. You should also read the same [http://www.gnu.org/software/octave/doc/interpreter/Contributing-Guidelines.html#Contributing-Guidelines contributing] [http://hg.savannah.gnu.org/hgweb/octave/file/tip/etc/HACKING guidelines] we have for everyone.<br />
* '''The Maintainers Mailing List'''<br />
: We primarily use [https://mailman.cae.wisc.edu/listinfo/octave-maintainers mailing lists] for communication among developers.<br />
: The mailing list is used most often for discussions about non-trivial changes to Octave, or for setting the direction of development.<br />
: You should follow basic mailing list etiquette. For us, this mostly means "do not [http://en.wikipedia.org/wiki/Top_posting#Top-posting top post]".<br />
* '''The IRC Channel'''<br />
: We also have [http://webchat.freenode.net?channels=octave the #octave IRC channel in Freenode].<br />
: You should be familiar with the IRC channel. It's very helpful for new contributors (you) to get immediate feedback on ideas and code.<br />
: Unless your primary mentor has a strong preference for some other method of communication, the IRC channel will likely be your primary means of communicating with your mentor and Octave developers.<br />
* '''The Octave Forge Project'''<br />
: [http://octave.sf.net Octave-Forge] is a project closely related to Octave where packages reside. They are somewhat analogous to Matlab's toolboxes.<br />
* '''Related Skills'''<br />
: In addition, you probably should know '''some''' mathematics, engineering, or experimental science or something of the sort.<br />
: If you've used Matlab before, you probably have already been exposed to the kinds of problems that Octave is used for.<br />
<br />
<noinclude>[[Category:Summer of Code]]</noinclude><br />
<br />
= Suggested projects =<br />
<br />
The following projects are broadly grouped by category and probable skills required to tackle each. Remember to check [[Projects]] for more ideas if none of these suit you, and your own ideas are always welcome.<br />
<br />
== Numerical ==<br />
<br />
These projects involve implementing certain mathematical functions in Octave.<br />
<br />
'''Required skills''': You should understand quite a bit of mathematics. Words like "eigenvalue", "analytic", and "Taylor series" shouldn't scare you at all. There is probably little C++ experience required, and probably many of these problems can be solved with m-scripts.<br />
<br />
'''Difficulty''': Mid-to-hard depending how much mathematics you know and how well you can read numerical analysis journal articles.<br />
<br />
'''Potential mentor''': Carlo de Falco, Fotios Kasolis, Luis Gustavo Lira<br />
<br />
=== Incomplete sparse factorizations ichol, ilu ===<br />
<br />
Octave still lacks of an incomplete Cholesky and LU factorization for sparse matrices. These functions are [http://www.mathworks.com/help/matlab/matrix-decomposition.html available in Matlab] as ichol and ilu. Incomplete factorizations are useful as preconditioners for iterative solvers such as [http://hg.savannah.gnu.org/hgweb/octave/file/812162c34a93/scripts/sparse/gmres.m gmres] or [http://hg.savannah.gnu.org/hgweb/octave/file/812162c34a93/scripts/sparse/pcg.m pcg].<br />
<br />
Good introductions to the math behind these factorizations are:<br />
* [http://netlib.org/linalg/html_templates/node81.html Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods] especially [http://netlib.org/linalg/html_templates/node100.html#SECTION00933000000000000000 this chapter] <br />
* [http://www-users.cs.umn.edu/~saad/IterMethBook_2ndEd.pdf Iterative Methods for Sparse Linear Systems (2nd Edition)] chapter 10 (also available as textbook)<br />
<br />
One should additionally familiarize with Octave's internal sparse matrix format which is [http://netlib.org/linalg/html_templates/node92.html#SECTION00931200000000000000 CCS] rather than [http://netlib.org/linalg/html_templates/node91.html#SECTION00931100000000000000 CRS], used in the listed textbooks. In the past GSoC a solution using [http://www-users.cs.umn.edu/~saad/software/ITSOL/ ITSOL] has been created. This work needs several improvements before it can be integrated into the Octave core. Read more about the past GSoC project in [http://siko1056-gsoc.blogspot.de/ this blog]. A [http://siko1056-gsoc.blogspot.de/p/getting-my-work.html demo implementation] is also available from there.<br />
<br />
Compared to other projects in this section this one might require more knowledge of C++ and mathematical software programming. But this project doesn't need to be started from scratch and can be continued from the previous approach, if desired. For more information feel free to contact <k.ohlhus@gmail.com>.<br />
<br />
=== General purpose Finite Element library ===<br />
<br />
Octave-Forge already has a set of packages for discretizing Partial Differential operators by Finite Elements and/or Finite Volumes,<br />
namely the [[bim package]] which relies on the [http://octave.sf.net/msh msh package] (which is in turn based on [http://geuz.org/gmsh/ gmsh]) for creating and managing 2D triangular and 3D tetrahedral meshes and on the [http://octave.sf.net/fpl fpl package] for visualizing 2D results within Octave or exporting 2D or 3D results in a format compatible with [http://www.paraview.org Paraview] or [https://wci.llnl.gov/codes/visit/ VisIT]. These packages, though, offer only a limited choice of spatial discretization methods which are based on low degree polynomials and therefore have a low order of accuracy even for problems with extremely smooth solutions.<br />
The [http://geopdes.sf.net GeoPDEs] project, on the other hand, offers a complete suite of functions for discretizing a wide range of<br />
differential operators related to important physical problems and uses basis functions of arbitrary polynomial degree that allow the construction of methods of high accuracy. These latter, though, are based on the IsoGeometric Analysis Method which, although very powerful and often better performing, is less widely known and adopted than the Finite Elements Method. The implementation of a general purpose library of Finite Elements seems therefore a valuable addition to Octave-Forge. Two possible interesting choices for implementing this package exist, the first consists of implementing the most common Finite Element spaces in the [http://geopdes.sf.net GeoPDEs] framework, which is possible as IsoGeometric Analysis can be viewed as a superset of the Finite Element Method, the other is to construct Octave language bindings for the free software library [http://fenicsproject.org/documentation/ FEniCS] based on the existing C++ or Python interfaces. This second approach has been developed during the GSOC 2013 and the Octave-Forge package [http://octave.sf.net/fem-fenics fem-fenics] is now available. However, fem-fenics could be extended in many different ways:<br />
* implement the bindings for the UFL language inside Octave<br />
* add new functions already available with Fenics but not yet in Octave<br />
* create new functions specifically suited for Octave<br />
* improve the efficiency of the code<br />
The main goal for the fem-fenics package is ultimately to be merged with the FEnics project itself, so that it can remain in-sync with the main library development.<br />
<br />
=== Improve logm, sqrtm, funm ===<br />
<br />
The goal here is to implement some missing Matlab functions related to matrix functions like the [http://en.wikipedia.org/wiki/Matrix_exponential matrix exponential]. There is [http://octave.1599824.n4.nabble.com/matrix-functions-td3137935.html a general discussion] of the problem.<br />
<br />
=== Generalised eigenvalue problem ===<br />
<br />
[http://www.mathworks.com/help/techdoc/ref/eig.html Certain calling forms] of the <tt>eig</tt> function are missing. The problem is to understand what those missing forms are and implement them.<br />
<br />
=== Various sparse matrix improvements ===<br />
<br />
The implementation of sparse matrices in Octave needs several improvements. Any of [[Projects#Sparse Matrices|these]] would be good. The paper by [http://arxiv.org/abs/cs.MS/0604006 Bateman & Adler] is good reading for understanding the sparse matrix implementation.<br />
<br />
=== Implement solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D ===<br />
<br />
The project will deliver a solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D similar to Matlab's function <tt>pdepe</tt>. A good starting point is the [http://en.wikipedia.org/wiki/Method_of_lines method of lines] for which you can find more details [http://en.wikibooks.org/wiki/Partial_Differential_Equations/Method_of_Lines here] and [http://www.scholarpedia.org/article/Method_of_lines here], whereas an example implementation can be found [http://www.scholarpedia.org/article/Method_of_Lines/Example_Implementation here]. In addition, [http://www.pdecomp.net/ this page] provides some useful material.<br />
<br />
=== Implement solver for 1D nonlinear boundary value problems ===<br />
<br />
The project will complete the implementation of the bvp4c solver that is already available in an initial version in the odepkg package<br />
by adding a proper error estimator and will implement a matlab-compatible version of the bvp5c solver.<br />
Details on the methods to be implemented can be found in [http://dx.doi.org/10.1145/502800.502801 this paper] on bvp4c and [http://www.jnaiam.net/new/uploads/files/014dde86eef73328e7ab674d1a32aa9c.pdf this paper] on bvp5c. Further details are available in [http://books.google.it/books/about/Nonlinear_two_point_boundary_value_probl.html?id=s_pQAAAAMAAJ&redir_esc=y this book].<br />
<br />
=== Geometric integrators for Hamiltonian Systems ===<br />
<br />
[http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration Geometric (AKA Symplectic) integrators] are useful for <br />
multi-dimensional classical mechanics problems and for molecular dynamics simulations.<br />
The odepkg package has a number of solvers for ODE, DAE and DDE problems but none of them is currently<br />
specifically suited for second order problems in general and Hamiltonian systems in particular.<br />
Therefore a new package for geometric integrators would be a useful contribution.<br />
This could be created as new package or added as a set of new functions for odepkg.<br />
The function interface should be consistent throughout the package and should be modeled to follow <br />
that of other functions in odepkg (or that of DASPK and LSODE) but will need specific extensions to accommodate for specific options that only make sense for this specific class of solvers.<br />
An initial list of methods to be implemented includes (but is not limited to)<br />
* Symplectic Euler methods, see [http://en.wikipedia.org/wiki/Semi-implicit_Euler_method here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Störmer-Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Velocity Verlet method, see [http://en.wikipedia.org/wiki/Verlet_integration here] and [http://openlibrary.org/books/OL9056139M/Geometric_Numerical_Integration here]<br />
* Symplectic partitioned Runge-Kutta methods, see [http://reference.wolfram.com/mathematica/tutorial/NDSolveSPRK.html here] or [http://dx.doi.org/10.1137/0733019 here]<br />
* Spectral Variational Integrator methods, see [http://www3.nd.edu/~izaguirr/papers/acta_numerica.pdf here] or [http://www.math.ucsd.edu/~mleok/pdf/HaLe2012_SVI.pdf here]<br />
<br />
For this latter there is an existing code which is already working but needs to be improved, posted on the patch tracker.<br />
Furthermore, methods to implement solutions of problems with rigid constraints should be implemented, e.g.<br />
* SHAKE, see [http://en.wikipedia.org/wiki/Constraint_algorithm here] or [http://dx.doi.org/10.1016/0021-9991(77)90098-5 here]<br />
* RATTLE, see [http://dx.doi.org/10.1016/0021-9991(83)90014-1 here] or [http://dx.doi.org/10.1002/jcc.540161003 here]<br />
<br />
'''Potential mentor:''' Mattia Penati, Edie Miglio, Carlo de Falco<br />
<br />
=== Matlab-compatible ODE solvers in core-Octave ===<br />
<br />
* Adapt "odeset" and "odeget" from the odepkg package so that the list of supported options is more Matlab-compatible, in the sense that all option names that are supported by Matlab should be available. On the other hand, Matlab returns an error if an option which is not in the list of known options is passed to "odeset", but we would rather make this a warning in order to allow for special extensions, for example for symplectic integrators.<br />
* Adapt the interface of "ode45" in odepkg to be completely Matlab compatible, fix its code and documentation style and move it to Octave-core.<br />
* Build Matlab compatible versions of "ode15s" and "ode15i". jwe has prototype implementations [https://savannah.gnu.org/patch/index.php?8102|here] of these built as wrappers to "dassl" and "daspk". An initial approach could be to just improve these wrappers, but eventually it would be better to have wrappers for "IDA" from the sundials library.<br />
* Implement Matlab compatible versions of "deval".<br />
<br />
'''Potential mentor:''' Sebastian Schöps, Carlo de Falco<br />
<br />
== GUI ==<br />
<br />
Octave currently includes an experimental native GUI, written in Qt. There are various ways in which it could be improved.<br />
<br />
'''Required skills''': C++ and Qt. Whatever tools you want to use to write Qt code are fine, but Qt Creator is a popular choice nowadays.<br />
<br />
'''Difficulty''': Mostly medium, depending if you've had Qt or GUI development experience before.<br />
<br />
'''Potential mentor''': Jordi Gutiérrez Hermoso, Michael Goffioul, Torsten<br />
<br />
=== Finish the Octave GUI ===<br />
<strike><br />
The GUI is currently on its own branch in hg. It is not stable enough and its design is still in flux. It is in a very alpha stage and needs to be turned into a real usable product. At the moment, it consists of the basic building blocks (terminal window, editor, variable browser, history, file browser) that are put together into a main interface. The GUI uses the Qt library. Among the things to improve are:<br />
* improve integration with octave: variable browser/editor, debugger, profiler...<br />
* define and implement an option/preferences dialog<br />
* improve additional components like the documentation browser<br />
</strike><br />
Fix existing bugs related to the GUI, which can be browsed [https://savannah.gnu.org/bugs/index.php?go_report=Apply&group=octave&func=browse&set=custom&msort=0&report_id=100&advsrch=0&status_id=1&resolution_id=0&assigned_to=0&category_id=107&bug_group_id=0&history_search=0&history_field=0&history_event=modified&history_date_dayfd=5&history_date_monthfd=2&history_date_yearfd=2014&chunksz=50&spamscore=5&boxoptionwanted=1#options here]<br />
<br />
=== Implement a Qt widget for manipulating plots ===<br />
<br />
Octave has had for some time a native OpenGL plotter. The plotter requires some user interaction for manipulating the plots, and it's been using fltk for quite some time. We want to replace this with Qt, so it fits better with the overall GUI look-and-feel and is easier to extend in the future.<br />
<br />
[https://github.com/goffioul/QtHandles QtHandles] is a current work in progress integrating the octave OpenGL renderer plus good support for GUI elements (uicontrol, uimenu, uitoolbar...). This project may initially consists of integrating the existing QtHandles code base into Octave. Then if time permits, further improvements can be made to QtHandles.<br />
<br />
=== Create a better (G)UI for the profiler ===<br />
<br />
During GSoC 2011, Daniel Kraft successfully implemented a profiler for Octave. It needs a better interface and a way to generate reports. This may be done with Qt, but not necessarily, and HTML reports might also be good.<br />
<br />
=== Create a graphical design tool for tuning closed loop control system (control pkg) ===<br />
<br />
When tuning a SISO feedback system it is very helpful to be able to grab a pole or a zero and move them by dragging them with the mouse. As they are moving the software must update all the plotted lines. There should be the ability to display various graphs rlocuse, bode, step, impulse etc. and have them all change dynamically as the mouse is moving. The parameters of the compensator must be displayed and updated.<br />
Potential mentor: Doug Stewart<br />
<br />
== Graphics ==<br />
<br />
Octave has a new native OpenGL plotter (currently via [http://en.wikipedia.org/wiki/Fltk fltk], but we want to move away from that). There are several possible projects involved with it.<br />
<br />
'''Required skills''': C++ and OpenGL. General understanding of computer graphics.<br />
<br />
'''Difficulty''': Medium, depending on your previous understanding of the topic.<br />
<br />
'''Potential mentor''': Michael Goffioul<br />
<br />
=== Lighting ===<br />
<br />
Implement transparency and lighting in OpenGL backend(s). A basic implementation is available in [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/jhandles/ JHandles]. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of Octave.<br />
<br />
=== Object selection in OpenGL renderer ===<br />
<br />
This project is about the implementation of a selection method of graphics elements within the OpenGL renderer [http://glprogramming.com/red/chapter13.html]<br />
<br />
=== Non-OpenGL renderer ===<br />
<br />
Besides the original gnuplot backend, Octave also contains an OpenGL-based renderer for advanced and more powerful 3D plots. However, OpenGL is not perfectly suited for 2D-only plots where other methods could result in better graphics. The purpose of this project is to implement an alternate graphics renderer for 2D only plots (although 3D is definitely not the focus, extending the new graphics renderer to support basic 3D features should also be taken into account). There is no particular toolkit/library that must be used, but natural candidates are:<br />
* [http://qt.nokia.com Qt]: the GUI is currently written in Qt and work is also in progress to provide a Qt/OpenGL based backend [https://github.com/goffioul/QtHandles]<br />
* [http://en.wikipedia.org/wiki/Cairo_%28software%29 Cairo]: this library is widely used and known to provides high-quality graphics with support for PS/PDF/SVG output.<br />
<br />
=== TeX/LaTeX markup ===<br />
<br />
Text objects in plots (like titles, labels, texts...) in the OpenGL renderer only support plain text mode without any formatting possibility. Support for TeX and/or LaTeX formatting needs to be added.<br />
<br />
* The TeX formatting support actually only consists of a very limited subset of the TeX language. This can be implemented directly in C++ into Octave by extending the existing text engine, avoiding to add a dependency on a full TeX system. Essentially, support for Greek letters, super/sub-scripts, and several mathematical symbols needs to be supported. For example,<br />
<br />
:<pre>\alpha \approx \beta_0 + \gamma^\chi</pre><br />
<br />
:Would be rendered as,<br />
<br />
:&alpha; &asymp; &beta;<sub>0</sub> + &gamma;<sup>&chi;</sup><br />
<br />
:This is analogous to how special characters may be included in a wiki using html.<br />
<br />
:<pre>&amp;alpha; &amp;asymp; &amp;beta;<sub>0</sub> + &amp;gamma;<sup>&amp;chi;</sup></pre><br />
<br />
:The text object's {{Codeline|extent}} for the rendered result needs to be calculated and the text placed the location specified by the text object's {{Codeline|position}} property. An itemized list of a text objects properties can be found [http://www.gnu.org/software/octave/doc/interpreter/Text-Properties.html here].<br />
<br />
* On the other hand, the LaTeX formatting support is expected to provide full LaTeX capabilities. This will require to use an external LaTeX system to produce text graphics in some format (to be specified) that is then integrated into Octave plots.<br />
<br />
:The matplotlib project [http://matplotlib.sourceforge.net/users/usetex.html has already done this in Python] and might be used as an example of how to do this in Octave. Mediawiki has also also done [http://en.wikipedia.org/wiki/Wikipedia:Texvc something similar]. There is also [http://forge.scilab.org/index.php/p/jlatexmath/ JLaTeXMath], a Java API to display LaTeX code in mathematical mode.<br />
<br />
== Interpreter ==<br />
<br />
The interpreter is written in C++, undocumented. There are many possible projects associated with it.<br />
<br />
'''Required skills''': ''Very good'' C and C++ knowledge, possibly also understanding of [http://en.wikipedia.org/wiki/Gnu_bison GNU bison] and [http://en.wikipedia.org/wiki/Flex_lexical_analyser flex]. Understanding how compilers and interpreters are made plus being able to understand how to use a profiler and a debugger will probably be essential skills.<br />
<br />
'''Difficulty''': Mid hard to very hard. Some of the biggest problems will probably be the interpreter.<br />
<br />
'''Potential mentors''': John W. Eaton, Jordi Gutiérrez Hermoso, Max Brister.<br />
<br />
=== Improve JIT compiling ===<br />
<br />
Octave's interpreter is ''very'' slow on some loops. Last year, thanks to Max Brister's work, an initial implement of a just-in-time compiler (JITC) in [http://llvm.org LLVM] for GSoC 2012. This project consists in understanding Max's current implementation and extending it so that functions and exponents (e.g. 2^z) compile with the JITC. This requires knowledge of compilers, C++, LLVM, and the Octave or Matlab languages. A capable student who demonstrates the ability to acquire this knowledge quickly may also be considered. Max himself will mentor this project. [http://planet.octave.org/octconf2012/jit.pdf Here] is Max's OctConf 2012 presentation about his current implementation. See also [[JIT]].<br />
<br />
=== Improve memory management ===<br />
<br />
From profiling the interpreter, it appears that a lot of time is spending allocating and deallocating memory. A better memory management algorithm might provide some improvement.<br />
<br />
=== Implement classdef classes ===<br />
<br />
Matlab has two kinds of classes: old style @classes and new style classdef. Octave has only fully implemented the old style. There is partial support for new classes in [http://hg.savannah.gnu.org/hgweb/octave/shortlog/classdef our classdef branch]. There is irregular work here, and classdef is [http://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html a very] [http://www.mathworks.com/help/matlab/events-sending-and-responding-to-messages.html complicated] [http://www.mathworks.com/help/matlab/enumeration-classes.html thing] to fully implement. A successful project would be to implement enough of classdef for most basic usages. Familiarity with Matlab's current classdef support would be a huge plus. Michael Goffioul and jwe can mentor this.<br />
<br />
== Infrastructure ==<br />
<br />
There are several projects closely related to Octave but not exactly core Octave that could be worked on. They are mostly infrastructure around Octave, stuff that would help a lot.<br />
<br />
'''Required skills''': Various. See below.<br />
<br />
'''Difficulty''': Various. See below.<br />
<br />
'''Potential mentor''': Jordi Gutiérrez Hermoso, Carlo de Falco<br />
<br />
=== Finish the Agora website ===<br />
<br />
In 2009, the Mathworks decided to restrict the terms of use Matlab Central, a place dedicated to Matlab collaboration. The Mathworks forbade copyleft licenses and using the "free" code found in Matlab central on anything other than Mathworks products (e.g. forbidding from using it on Octave, even if the authors of the code wanted to allow this). Thus Octave users have no place to centrally, quickly, and conveniently share Octave code. See the [[FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21|FAQ]] for more details.<br />
<br />
In response to this, a website started to form, [http://agora.octave.org/ Agora Octave].<br />
<br />
This should be relatively easy webdev in Python using [http://en.wikipedia.org/wiki/Django_%28web_framework%29 Django].<br />
<br />
Things to be considered when working on this:<br />
<br />
* [http://octave-forge.blogspot.ie/2012/08/octconf2012-agora-and-pkg.html discussion of Agora during OctConf2012]<br />
* [http://scipy-central.org/ Scipy Central] - a website with the same objective as Agora for Scipy. Their [https://github.com/kgdunn/SciPyCentral/ code] is released under a BSD license. Might be useful to reuse some parts.<br />
<br />
Most of the basic functionality of Agora is already in, but there are many ways in which it could be improved, such as implementing comment threads, giving it an email interface, or a ReSTful API which could be used from Octave for package management. See also [[Agora]].<br />
<br />
=== Improve binary packaging ===<br />
<br />
We would like to be able to easily generate binary packages for Windows and Mac OS X. Right now, it's difficult and tedious to do so. Any way to help us do this in a faster way would be appreciated. Required knowledge is understanding how building binaries in Windows and Mac OS X works. Our current approach to fixing this is to cross-compile from a GNU system using [http://mxe.cc/ MXE] or [http://lilypond.org/gub/ GUB].<br />
<br />
'''Skills Required''': Knowledge of GNU build systems, Makefiles, configure files, chasing library dependencies, how to use a compiler. If you choose to work on GUB, Python will be required. No m-scripting or C++ necessary, beyond understanding [http://david.rothlis.net/c/compilation_model/ the C++ compilation model].<br />
<br />
'''Difficulty''': Medium to easy. You need to understand how build systems work and how to fix packages when they don't build.<br />
<br />
'''Possible mentors''': John W. Eaton or Jordi Gutiérrez Hermoso<br />
<br />
=== Installation of packages ===<br />
We would like to enhance the management of Octave-forge packages from within Octave environment. Currently there is a working (but rather monolithic) function that is used to do the job. The work would be to improve the way Octave interacts with the package server. Since the functionality is already sketched by the current function, the most important skill is software design.<br />
<br />
'''Minimum requirements''': Ability to read and write Octave code. Minimal FTP/HTTP knowledge.<br />
<br />
'''Difficulty''': Easy<br />
<br />
== Octave-Forge packages ==<br />
<br />
=== Improve MPI package ===<br />
Octave Forge's [http://octave.sourceforge.net/mpi/index.html MPI package] <br />
is a wrapper for basic MPI functions for parallel computing. It is implemented <br />
by wrapping MPI function calls in simple DLD functions that map Octave's Datataypes to <br />
MPI Derived Datatypes. <br />
The proposed project deals with improving and extending the Octave MPI package, for example:<br />
* Octave MPI applications can currently be only run in batch mode, add the ability to launch parallel jobs and collect their output in an interactive Octave session.<br />
* Implement functions for non-blocking communication (MPI_Isend, MPI_Irecv)<br />
* Implement one-to-many (Broadcast, Scatter), many-to-one (Reduce, Gather), and many-to-many (All Reduce, Allgather) communication routines<br />
<br />
'''Required skills''': C++. Message Passing Interface (MPI).<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Carlo de Falco, Michael Creel, Sukanta Basu<br />
<br />
=== Rewrite symbolic package ===<br />
Octave's current [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/symbolic/ symbolic] package for symbolic computation is outdated, fragile and limited in its capabilities. The new symbolic package should offer better Matlab compatibility, for example handling of symbolic matrices. Like the current symbolic package, the new package could use the proven [http://www.ginac.de/ GiNaC] library for symbolic computations.<br />
<br />
The work would be to integrate GiNaC by using Octave's objects and classes. This can be done in C++ in a way similar to Michele Martone's new [http://librsb.sourceforge.net/ sparsersb] package.<br />
<br />
This idea has not been selected by any SoC student yet, if you want to see it happen before next SoC<br />
you can offer a bounty [http://www.freedomsponsors.org/core/issue/289/gnu-octave-rewrite-the-symbolic-package here].<br />
<br />
'''Required skills''': C++. Ability to understand Octave and GiNaC API documentation.<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Lukas Reichlin<br />
<br />
=== Improvements to N-dimensional image processing ===<br />
<br />
The image package has partial functionality for N-dimensional images. These images do exist in practice for example in medical imaging where slices from scans are assembled to form anatomical 3D images, or even exposures taken over time on different wavelengths can result in 5D images. As part of GSoC 2013, the core functions {{codeline|imwrite}} and {{codeline|imread}} were extended to better support this type of images. Likewise, many functions in the image package, mostly morphology operators, were expanded to deal with this type of images. Still, many are left to, specially image transformation and analysis of ROIs.<br />
<br />
Note that while many of the functions in the image package will not complain about ND images, they are actually not correctly implemented and will give incorrect results.<br />
<br />
'''Required skills''': Mostly m-file scripting, some C++. Familiarity with common CS algorithms will be useful.<br />
<br />
'''Difficulty''': difficult.<br />
<br />
'''Potential mentor''': Jordi Gutiérrez Hermoso<br />
<br />
=== Interface to Electronic Circuit Simulator ===<br />
<br />
[http://sourceforge.net/projects/qucs/ Qucs] is a C++ based circuit simulation package. This project aims to improve the interface to the Qucs algorithms to allow the transient, i.e. time series, simulation of circuits in Octave within a larger ODE system simulation driven by Octave. Other possible goals would be to make other analysis types available directly from Octave. There is an existing C++ interface which is based on handle class syntax available in the development version of Octave. The Qucs interface is intended to have two modes, synchronous and asynchronous. The asynchronous mode uses qucs to solve a circuit between two given time steps (internally taking as many smaller time steps as required), returning only the final result. This method is well developed. The alternative synchronous mode is intended to give full control of the time steps to Octave, and it is this mode which requires more work. A simple synchronous interface exists which can be built upon.<br />
<br />
'''Required skills''': C++ and m-file scripting. Familiarity with new classdef syntax would be useful. May require some modification/adaptation of the Qucs sources. Familiarity with the Octave ODE solvers useful but not essential. Ability to compile Octave from the development sources.<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Richard Crozier<br />
<br />
'''Main Goals'''<br />
* Improve the functionality of the transient solver interface by implementing a robust synchronous simulation mode that integrates well with Octave ode solvers, particularly those from the odepkg package from OctaveForge. <br />
* Create interface to other analysis types (AC, DC, S-Parameter and Harmonic Balance)<br />
* Packaging the interface for Octave<br />
<br />
=== Color management functions in image package ===<br />
<br />
The goal is to implement these functions:<br />
<br />
iccread<br />
iccwrite<br />
makecform<br />
applycform<br />
<br />
These functions are useful for color management, in particular for converting data (especially images) between color spaces. ICC profiles are essentially used to store look-up tables or matrix transforms (or both) that define the conversions. For example, to convert an CMYK image to sRGB, you would load a "print" ICC profile that defines the conversion from CMYK to L*a*b* (the CIE color space that is supposed to match the human visual system), then load another profile that defines the conversion from L*a*b* to sRGB (there is a standard profile for this conversion (IEC 61966-2-1), which is why Matlab has a built-in conversion from sRGB to L*a*b*). To do the above conversions in Matlab, you would use the following code:<br />
<br />
<syntaxhighlight lang="octave"><br />
cmykImage = double(imread('cmyk-image-filename.tif'));<br />
iccProfile = iccread('icc-profile-filename.icc');<br />
labImage = applycform(cmykImage, makecform('clut', iccProfile, 'AToB3'));<br />
rgbImage = applycform(labImage, makecform('lab2srgb'));<br />
</syntaxhighlight><br />
<br />
The <code>'AToB3'</code> selects one of the color transforms (look-up tables) contained in the profile. This one is "Absolute Colorimetric." More details on ICC profiles may be obtained from [http://www.color.org/icc_specs2.xalter the ICC spec].<br />
<br />
Knowledge of ICC profiles (at least knowledge of their application) would be a prerequisite. Since [http://www.littlecms.com/ littlecms] implements all the necessary functions for reading, writing, and applying profiles, it would be primarily a matter of integrating this library into Octave (assuming that is the preferred implementation -- one could certainly read the ICC files directly, but why reinvent that particular wheel).<br />
<br />
'''Required skills''': C++ programming, some knowledge of ICC profiles desirable.<br />
<br />
'''Difficulty''': Easy.<br />
<br />
'''Possible Mentor''': Patrick Noffke <patrick.noffke@gmail.com><br />
<br />
=== High Precision Arithmetic Computation ===<br />
The Linear Algebra Fortran libraries used by Octave make use of of single (32 bits) and double (64 bits) precision floating point numbers. Many operations are stopped when matrices condition number goes below 1e-16: such matrices are considered as ill-conditionned. There are cases where this is not enough, for instance simulations implying chemical concentrations covering the range 10^4 up to 10^34. There are a number of ways to increase the numerical resolution, like f.i. make use of 128 bits quadruple precision numbers available in GFortran. A simpler option is to build an interface over Gnu MPL arbitrary precision library, which is used internally by gcc and should be available on any platform where gcc runs. Such approach has been made available for MatLab under the name mptoolbox and is licensed under a BSD license. The author kindly provided a copy of the latest version and agreed to have it ported under Octave and re-distributed under GPL v3.0<br />
<br />
The architecture consists of an Octave class interface implementing "mp" (multi-precision) objects. Arithmetic operations are forwarded to MPL using MEX files. This is totally transparent to the end user, except when displaying numbers. This implementation needs to be ported and tested under Octave. <br />
<br />
'''Required skills''': Octave classes and object programming. C for understanding the MEX glue code.<br />
<br />
'''Difficulty''': medium.<br />
<br />
'''Potential mentor''': Pascal Dupuis<br />
<br />
=== Mapping package ===<br />
The [[Mapping package]] has started but lacks many functions, see [[Mapping package#Missing functions]]. Source code for some of the calculations has been donated and could be ported, or at least used for testing. Choose this project if you'd like to learn more about mapping and GPS!<br />
<br />
'''Required skills''': m-file scripting<br />
<br />
'''Difficulty''': medium<br />
<br />
'''Potential mentor''': TBD<br />
<br />
= HG Procedures for students and mentors =<br />
<br />
[[Hg_instructions_for_mentors#Mercurial_Tips_for_SoC_students | This page]] describes the procedures students are expected to use to publicly display their progress in a public mercurial repo during their work.<br />
<br />
[[hg instructions for mentors | This page]] describes what mentors should do to review their work.<br />
<br />
[[Category:Summer of Code]]<br />
[[Category:Project Ideas]]</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=2005Build from source2012-10-19T08:28:05Z<p>Crobar: </p>
<hr />
<div>Building Octave can be as simple as downloading the source and running the following three commands in your GNU/Linux shell:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
[http://www.gnu.org/software/octave/doc/interpreter/Installation.html#Installation More detailed instructions]<br />
for building from source are included in the Octave manual.<br />
<br />
=Windows Build System=<br />
<br />
In addition to the instructions provided in the Octave manual, a basic toolkit for building Octave in windows using the MSVC compiler has been produced by Michael Goffioul. It consists of a set of scripts that can be used to compile Octave and its dependencies. <br />
<br />
A pre-compiled (with VS2010) version of everything has also been provided, so it is not necessary to recompile everything from scratch. The files can be found at:<br />
<br />
[http://dl.dropbox.com/u/45539519/octave-build2.zip]<br />
[http://dl.dropbox.com/u/45539519/VC10Libs.zip]<br />
<br />
Note that this is not a enterprise-level SDK.</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=2004Build from source2012-10-19T08:26:09Z<p>Crobar: Added info about ichael Goffioul's build environment.</p>
<hr />
<div>Building Octave can be as simple as downloading the source and running the following three commands in your GNU/Linux shell:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
[http://www.gnu.org/software/octave/doc/interpreter/Installation.html#Installation More detailed instructions]<br />
for building from source are included in the Octave manual.<br />
<br />
=Windows Build System=<br />
<br />
In addition to the instruction provided in the Octave manual, a basic toolkit for building Octave in windows using the MSVC compiler has been produced by Michael Goffioul. It consists of a set of scripts that can be used to compile Octave and its dependencies. <br />
<br />
A pre-compiled (with VS2010) version of everything has also been provided, so it is not necessary to recompile everything from scratch. The files can be found at:<br />
<br />
[http://dl.dropbox.com/u/45539519/octave-build2.zip]<br />
[http://dl.dropbox.com/u/45539519/VC10Libs.zip]<br />
<br />
Note that this is not a enterprise-level SDK.</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Talk:Build_from_source&diff=896Talk:Build from source2012-03-20T10:35:06Z<p>Crobar: /* duplication */</p>
<hr />
<div>==Manual Introduction==<br />
<br />
Below is some proposed text for the manual for collaborative editing:<br />
<br />
-----------------<br />
<br />
Building Octave is easiest on Unix-like systems, e.g. Debian, Ubuntu,<br />
etc. The procedure for building and installing Octave from its sources<br />
on a Unix-like system is described in the sections below. To build on<br />
other systems requires considerably more expertise, but is possible.<br />
Further information on this is available online, such as on the Octave<br />
wiki (http://www.octave.org/wiki/index.php?title=GNU_Octave_Wiki), but<br />
note that this information is not directly controlled by the Octave authors.<br />
<br />
Octave is a large and complex program which depends on many other<br />
packages and libraries. The first section below describes how to obtain<br />
and install these dependencies before attempting to build Octave itself.<br />
<br />
This second section describes the process of building Octave itself. On<br />
a Unix-like system building Octave can often be as simple as running a<br />
few commands from the terminal. The Octave build system is based on GNU<br />
make (http://www.gnu.org/software/make/). This is a commonly used system<br />
for compiling large and complex programs. It is often supplied as a<br />
standard package, so you are likely to already have it installed. Before<br />
running make to build Octave you must also first configure the build<br />
process on your system by running a shell script supplied with the<br />
source code. This configuration stage is also described in the second<br />
section.<br />
<br />
Note that this description applies only to Octave releases. If you wish<br />
to build the development source, you must obtain them from the Mercurial<br />
archive. Building the development sources requires additional steps as<br />
described in <Building the Development Sources>. Further information on<br />
building Octave can be found in the readme files supplied with the<br />
source code.</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=435Build from source2012-01-10T23:20:28Z<p>Crobar: /* Dependencies */ Began porting octave build docs to wiki</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
=Introduction=<br />
<br />
Building Octave can be as simple as downloading the source and running the following three commands in your Linux shell:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
However, Octave is a complex program with many dependencies. This page details each of the steps, some issues that may arise with each step and the dependencies that Octave either requires, or will use if available.<br />
<br />
=Dependencies=<br />
<br />
Octave is a fairly large program with many build dependencies. You may be able to find pre-packaged versions of the dependencies distributed as part of your system, or you may have to build some or all of them yourself.<br />
<br />
==Tips for Specific Systems==<br />
<br />
The names of pre-compiled packages vary by system and do not always match exactly the names listed above.<br />
<br />
You will usually need the development version of an external dependency so that you get the libraries and header files for building software, not just for running already compiled programs. These packages typically have names that end with the suffix <nowiki>-dev</nowiki> or <nowiki>-devel</nowiki>.<br />
<br />
On systems with <nowiki>apt-get</nowiki> (Debian, Ubuntu, etc.), you may be able to install most of the tools and external packages using a command similar to<br />
<br />
apt-get build-dep octave<br />
<br />
The specific package name may be <nowiki>octave3.2</nowiki> or <nowiki>octave3.4</nowiki>, making the command <br />
<br />
apt-get build-dep octave3.2<br />
<br />
for example). The set of required tools and external dependencies does not change frequently, so it is not important that the version match exactly, but you should use the most recent one available.<br />
<br />
On systems with <nowiki>yum</nowiki> (Fedora, Red Hat, etc.), you may be able to install most of the tools and external packages using a command similar to<br />
<br />
yum-builddep octave<br />
<br />
The <nowiki>yum-builddep</nowiki> utility is part of the <nowiki>yum-utils</nowiki> package.<br />
<br />
For either type of system, the package name may include a version number. The set of required tools and external dependencies does not change frequently, so it is not important that the version exactly match the version you are installing, but you should use the most recent one available.<br />
<br />
=== Build Tools ===<br />
<br />
The following tools are required:<br />
<br />
{| cellpadding="4" border="1" cellspacing="0"<br />
!Tool<br />
!Description<br />
|-<br />
|C++, C, and Fortran compilers<br />
|The Octave sources are primarily written in C++, but some portions are also written in C and Fortran. The Octave sources are intended to be portable. Recent versions of the GNU compiler collection (GCC) should work ([http://gcc.gnu.org]). If you use GCC, you should avoid mixing versions. For example, be sure that you are not using the obsolete @code{g77} Fortran compiler with modern versions of gcc and g++.<br />
|-<br />
|GNU Make<br />
|Tool for building software ([http://www.gnu.org/software/make]). Octave's build system requires GNU Make. Other versions of Make will not work. Fortunately, GNU Make is highly portable and easy to install.<br />
|-<br />
|AWK, sed, and other Unix utilities<br />
|Basic Unix system utilities are required for building Octave. All will be available with any modern Unix system and also on Windows with either Cygwin or MinGW and MSYS.<br />
|}<br />
<br />
Additionally, the following tools may be needed:<br />
<br />
{| cellpadding="4" border="1" cellspacing="0"<br />
!Tool<br />
!Description<br />
|-<br />
|Bison<br />
|Parser generator ([http://www.gnu.org/software/bison]). You will need Bison if you modify the oct-parse.yy source file or if you delete the files that are generated from it.<br />
|-<br />
|Flex<br />
|Lexer analyzer ([http://www.gnu.org/software/flex]). You will need Flex if you modify the lex.ll source file or if you delete the files that are generated from it.<br />
|-<br />
|Autoconf<br />
|Package for software configuration ([http://www.gnu.org/software/autoconf]). Autoconf is required if<br />
you modify Octave's configure.ac file or other files that it requires.<br />
|-<br />
|Automake<br />
|Package for Makefile generation ([http://www.gnu.org/software/automake]). Automake is required if you modify Octave's Makefile.am files or other files that they depend on.<br />
|-<br />
|Libtool<br />
|Package for building software libraries ([http://www.gnu.org/software/libtool]). Libtool is required by Automake.<br />
|}<br />
<br />
=== External Packages ===<br />
<br />
{| cellpadding="4" border="1" cellspacing="0"<br />
!Library<br />
!Status<br />
!Debian Package Name<br />
!Comments<br />
|- <br />
|A version of BLAS and LAPACK, e.g. Atlas<br />
|Required<br />
|libatlas-base-dev<br />
|Basic Linear Algebra Subroutine library ([http://www.netlib.org/blas]). Accelerated BLAS libraries such as ATLAS ([http://math-atlas.sourceforge.net]) are recommended for better performance.<br />
|- <br />
|arpack<br />
|Recommended<br />
|libarpack2-dev<br />
|Library for the solution of large-scale eigenvalue problems ([http://forge.scilab.org/index.php/p/arpack-ng]). ARPACK is required to provide the functions eigs and svds.<br />
|- <br />
|curl<br />
|Recommended<br />
|libcurl4-gnutls-dev <br />
|Library for transferring data with URL syntax ([http://curl.haxx.se]). cURL is required to provide the urlread and urlwrite functions and the ftp class.<br />
|- <br />
|fftw3<br />
|Recommended<br />
|fftw3-dev<br />
|Library for computing discrete Fourier transforms ([http://www.fftw.org]). FFTW3 is used to provide better performance for functions that compute discrete Fourier transforms (fft, ifft, fft2, etc.).<br />
|- <br />
|fltk<br />
|Recommended<br />
|libfltk1.1-dev<br />
|Portable GUI toolkit ([http://www.fltk.org]). FLTK is currently used to provide windows for Octave's OpenGL-based graphics functions.<br />
|- <br />
|fontconfig<br />
|Recommended<br />
|libfontconfig1-dev <br />
|Library for configuring and customizing font access ([http://www.freedesktop.org/wiki/Software/fontconfig]). Fontconfig is used to manage fonts for Octave's OpenGL-based graphics functions.<br />
|-<br />
|FreeType<br />
|Recommended<br />
|<br />
|Portable font engine ([http://www.freetype.org]). FreeType is used to perform font rendering for Octave's OpenGL-based graphics functions.<br />
|- <br />
|glpk<br />
|Recommended<br />
|libglpk-dev<br />
|GNU Linear Programming Kit ([http://www.gnu.org/software/glpk]). GPLK is required for the function glpk.<br />
|-<br />
|gnuplot<br />
|Recommended<br />
|<br />
|Interactive graphics program ([http://www.gnuplot.info]). gnuplot is currently the default graphics renderer for Octave.<br />
|-<br />
|GraphicsMagick++<br />
|Recommended<br />
|libgraphicsmagick++1-dev <br />
|Image processing library (@url{http://www.graphicsmagick.org}). GraphicsMagick++ is used to provide the imread and imwrite. functions.<br />
|-<br />
|hdf5<br />
|Recommended<br />
|libhdf5-mpich-dev<br />
|Library for manipulating portable data files ([http://www.hdfgroup.org/HDF5]). HDF5 is required for Octave's load and save commands to read and write HDF data files.<br />
|- <br />
|ncurses<br />
|Recommended<br />
|libncurses5-dev<br />
|<br />
|-<br />
|OpenGL<br />
|Recommended<br />
|<br />
|API for portable 2D and 3D graphics ([http://www.opengl.org]). An OpenGL implementation is required to provide Octave's OpenGL-based graphics functions. Octave's OpenGL-based graphics functions usually outperform the gnuplot-based graphics functions because plot data can be rendered directly instead of sending data and commands to gnuplot for interpretation and rendering.<br />
|-<br />
|PCRE<br />
|Required<br />
|libpcre3-dev<br />
|The Perl Compatible Regular Expression library ([http://www.pcre.org]).<br />
|-<br />
|Qhull<br />
|Recommended<br />
|libqhull-dev<br />
|Computational geometry library ([http://www.qhull.org]). Qhull is required to provide the functions convhull, convhulln, delaunay, delaunay3, delaunayn, voronoi, and voronoin.<br />
|- <br />
|qrupdate<br />
|Recommended<br />
|<br />
|QR factorization updating library ([http://sourceforge.net/projects/qrupdate]). QRUPDATE is used to provide improved performance for the functions qrdelete, qrinsert, qrshift, and qrupdate.<br />
|- <br />
|readline<br />
|Strongly <br> Reccomended<br />
|libreadline5-dev<br />
|If you wish to build Octave without GNU readline installed, you must use the --disable-readline option when running the configure script.<br />
|- <br />
|SuiteSparse<br />
|Recommended<br />
|libsuitesparse-dev<br />
|Sparse matrix factorization library ([http://www.cise.ufl.edu/research/sparse/SuiteSparse]). SuiteSparse is required to provide sparse matrix factorizations and solution of linear equations for sparse systems.<br />
|-<br />
|zlib<br />
|Recommended<br />
|zlib1g-dev<br />
|Data compression library ([http://zlib.net]). The zlib library is required for Octave's load and save commands to handle compressed data, including Matlab v5 MAT files. <br />
|}<br />
<br />
=Download=<br />
<br />
Released source tarballs are available at http://www.octave.org/download.html. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Before compiling you must first configure the build system by running the configure script.<br />
<br />
./configure<br />
<br />
The configure script will display information about missing packages or any other issues that arise during the configuration run.<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html Problems with FTGL building octave-3.1.51],[http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
After running configure simply run<br />
<br />
make<br />
<br />
Note that the compilation of Octave can take some time.<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to <br />
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [[RunInPlace]] shell script.<br />
<br />
=Install=<br />
<br />
Finally, to install Octave on your system run<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
*[[PaulKienzleIrixConf|SGI/IRIX]]<br />
*[[Octave for Mac|Mac OS X]]<br />
*[[Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Debian_Development_Sources|Debian]]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=432Build from source2012-01-10T10:59:11Z<p>Crobar: Added short introduction and a couple of sentences to the Build section</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
=Introduction=<br />
<br />
Building Octave can be as simple as downloading the source and running the following three commands in your Linux shell:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
However, Octave is a complex program with many dependencies. This page details each of the steps, some issues that may arise with each step and the dependencies that Octave either requires, or will use if available.<br />
<br />
=Dependencies=<br />
<br />
On Debian systems, many of the required build dependencies for all versions can be obtained through:<br />
<br />
<nowiki>apt-get build-dep octave3.2</nowiki><br />
<br />
Which obtains the build dependencies for Octave version 3.2. Some of the required libraries and tools are listed below.<br />
<br />
=== Tools ===<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
=== Libraries ===<br />
<br />
{| cellpadding="4" border="1" cellspacing="0"<br />
!Library<br />
!Debian Package Name<br />
!Comments<br />
|- <br />
|A version of BLAS and LAPACK, e.g. Atlas<br />
|libatlas-base-dev<br />
|<br />
|- <br />
|arpack<br />
|libarpack2-dev<br />
|New GPL-conformant version<br />
|- <br />
|curl<br />
|libcurl4-gnutls-dev <br />
|<br />
|- <br />
|fftw<br />
|fftw3-dev<br />
|<br />
|- <br />
|fltk<br />
|libfltk1.1-dev<br />
|<br />
|- <br />
|fontconfig<br />
|libfontconfig1-dev <br />
|<br />
|- <br />
|glpk<br />
|libglpk-dev<br />
|<br />
|-<br />
|GraphicsMagick<br />
|libgraphicsmagick++1-dev <br />
|<br />
|-<br />
|hdf5<br />
|libhdf5-mpich-dev<br />
|<br />
|- <br />
|ncurses<br />
|libncurses5-dev<br />
|<br />
|-<br />
|PCRE<br />
|libpcre3-dev<br />
|<br />
|-<br />
|qhull<br />
|libqhull-dev<br />
|<br />
|- <br />
|qrupdate<br />
|<br />
|<br />
|- <br />
|readline<br />
|libreadline5-dev<br />
|<br />
|- <br />
|SuiteSparse<br />
|libsuitesparse-dev<br />
|Without metis due to licensing issues: UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
|-<br />
|zlib<br />
|zlib1g-dev<br />
|<br />
|}<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
You may need to add the line: #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
=Download=<br />
<br />
Released source tarballs are available at http://www.octave.org/download.html. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Before compiling you must first configure the build system by running the configure script.<br />
<br />
./configure<br />
<br />
The configure script will display information about missing packages or any other issues that arise during the configuration run.<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html Problems with FTGL building octave-3.1.51],[http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
After running configure simply run<br />
<br />
make<br />
<br />
Note that the compilation of Octave can take some time.<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to <br />
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [[RunInPlace]] shell script.<br />
<br />
=Install=<br />
<br />
Finally, to install Octave on your system run<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
*[[PaulKienzleIrixConf|SGI/IRIX]]<br />
*[[Octave for Mac|Mac OS X]]<br />
*[[Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Debian_Development_Sources|Debian]]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=431Build from source2012-01-10T10:49:33Z<p>Crobar: /* Configure */ Added introductory sentences</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
=Dependencies=<br />
<br />
On Debian systems, many of the required build dependencies for all versions can be obtained through:<br />
<br />
<nowiki>apt-get build-dep octave3.2</nowiki><br />
<br />
Which obtains the build dependencies for Octave version 3.2. Some of the required libraries and tools are listed below.<br />
<br />
=== Tools ===<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
=== Libraries ===<br />
<br />
{| cellpadding="4" border="1" cellspacing="0"<br />
!Library<br />
!Debian Package Name<br />
!Comments<br />
|- <br />
|A version of BLAS and LAPACK, e.g. Atlas<br />
|libatlas-base-dev<br />
|<br />
|- <br />
|arpack<br />
|libarpack2-dev<br />
|New GPL-conformant version<br />
|- <br />
|curl<br />
|libcurl4-gnutls-dev <br />
|<br />
|- <br />
|fftw<br />
|fftw3-dev<br />
|<br />
|- <br />
|fltk<br />
|libfltk1.1-dev<br />
|<br />
|- <br />
|fontconfig<br />
|libfontconfig1-dev <br />
|<br />
|- <br />
|glpk<br />
|libglpk-dev<br />
|<br />
|-<br />
|GraphicsMagick<br />
|libgraphicsmagick++1-dev <br />
|<br />
|-<br />
|hdf5<br />
|libhdf5-mpich-dev<br />
|<br />
|- <br />
|ncurses<br />
|libncurses5-dev<br />
|<br />
|-<br />
|PCRE<br />
|libpcre3-dev<br />
|<br />
|-<br />
|qhull<br />
|libqhull-dev<br />
|<br />
|- <br />
|qrupdate<br />
|<br />
|<br />
|- <br />
|readline<br />
|libreadline5-dev<br />
|<br />
|- <br />
|SuiteSparse<br />
|libsuitesparse-dev<br />
|Without metis due to licensing issues: UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
|-<br />
|zlib<br />
|zlib1g-dev<br />
|<br />
|}<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
You may need to add the line: #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
=Download=<br />
<br />
Released source tarballs are available at http://www.octave.org/download.html. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Before compiling you must first configure the build system by running the configure script.<br />
<br />
./configure<br />
<br />
The configure script will display information about missing packages or any other issues that arise during the configuration run.<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html Problems with FTGL building octave-3.1.51],[http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to <br />
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [[RunInPlace]] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
*[[PaulKienzleIrixConf|SGI/IRIX]]<br />
*[[Octave for Mac|Mac OS X]]<br />
*[[Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Debian_Development_Sources|Debian]]<br />
<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=428Build from source2012-01-08T11:59:48Z<p>Crobar: Cosmetic changes</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
=Dependencies=<br />
<br />
On Debian systems, many of the required build dependencies for all versions can be obtained through:<br />
<br />
<nowiki>apt-get build-dep octave3.2</nowiki><br />
<br />
Which obtains the build dependencies for Octave version 3.2. Some of the required libraries and tools are listed below.<br />
<br />
=== Tools ===<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
=== Libraries ===<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
* fontconfig (libfontconfig1-dev in Debian)<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
You may need to add the line: #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
=Download=<br />
<br />
Released source tarballs are available at http://www.octave.org/download.html. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html Problems with FTGL building octave-3.1.51],[http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to <br />
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [[RunInPlace]] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
*[[PaulKienzleIrixConf|SGI/IRIX]]<br />
*[[Octave for Mac|Mac OS X]]<br />
*[[Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Debian_Development_Sources|Debian]]<br />
<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=427Build from source2012-01-08T11:52:42Z<p>Crobar: </p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Dependencies==<br />
<br />
On Debian systems, many of the required build dependencies for all versions can be obtained through:<br />
<br />
<nowiki>apt-get build-dep octave3.2</nowiki><br />
<br />
Which obtains the build dependencies for Octave version 3.2. Some of the required libraries and tools are listed below.<br />
<br />
=== Tools ===<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
=== Libraries ===<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
* fontconfig (libfontconfig1-dev in Debian)<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
You may need to add the line: #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at http://www.octave.org/download.html. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html Problems with FTGL building octave-3.1.51],[http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to <br />
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [[RunInPlace]] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
*[[PaulKienzleIrixConf|SGI/IRIX]]<br />
*[[Octave for Mac|Mac OS X]]<br />
*[[Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Debian_Development_Sources|Debian]]<br />
<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=426Build from source2012-01-08T11:48:50Z<p>Crobar: /* Libraries */ added command to obtain Octave 3.2 build dependencies</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Dependencies==<br />
=== Tools ===<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
On Debian systems, many of the required build dependencies for all versions can be obtained through:<br />
<br />
<nowiki>apt-get build-dep octave3.2</nowiki><br />
<br />
Which obtains the build dependencies for Octave version 3.2. Some of the required libraries are detailed below.<br />
<br />
=== Libraries ===<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
* fontconfig (libfontconfig1-dev in Debian)<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
You may need to add the line: #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at http://www.octave.org/download.html. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html Problems with FTGL building octave-3.1.51],[http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to <br />
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [[RunInPlace]] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
*[[PaulKienzleIrixConf|SGI/IRIX]]<br />
*[[Octave for Mac|Mac OS X]]<br />
*[[Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Debian_Development_Sources|Debian]]<br />
<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Talk:Build_from_source&diff=107Talk:Build from source2011-11-22T22:08:40Z<p>Crobar: </p>
<hr />
<div>==duplication==<br />
This page is a duplicate of [[Build From Source]] which has already been ported and updated slightly[[User:Crobar|Crobar]] 14:08, 22 November 2011 (PST)</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Talk:Build_from_source&diff=106Talk:Build from source2011-11-22T22:08:09Z<p>Crobar: Created page with "This page is a duplicate of Build From Source which has already been ported and updated slightly"</p>
<hr />
<div>This page is a duplicate of [[Build From Source]] which has already been ported and updated slightly</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=FAQ&diff=49FAQ2011-11-17T09:44:55Z<p>Crobar: /* Pre-compiled binary packages */ Corrected link to moved page</p>
<hr />
<div>This is a list of frequently asked questions (FAQ) for Octave users.<br />
<br />
We are always looking for new questions (with answers), better answers, or both. Feel free to edit this page with your changes. If you have general questions about Octave, or need help for something that is not covered by the Octave manual or the FAQ, please use the help@octave.org mailing list.<br />
<br />
This FAQ is intended to supplement, not replace, the Octave manual. Before posting a question to the help@octave.org mailing list, you should first check to see if the topic is covered in the manual.<br />
<br />
=General=<br />
<br />
==What is Octave?==<br />
<br />
Octave is a high-level interactive language, primarily intended for numerical computations that is mostly compatible with Matlab.1<br />
<br />
Octave can do arithmetic for real, complex or integer-valued scalars and matrices, solve sets of nonlinear algebraic equations, integrate functions over finite and infinite intervals, and integrate systems of ordinary differential and differential-algebraic equations.<br />
<br />
Octave uses the GNU readline library to handle reading and editing input. By default, the line editing commands are similar to the cursor movement commands used by GNU Emacs, and a vi-style line editing interface is also available. At the end of each session, the command history is saved, so that commands entered during previous sessions are not lost.<br />
<br />
The Octave distribution includes a 650+ page Texinfo manual. Access to the complete text of the manual is available via the doc command at the Octave prompt.<br />
<br />
==Who uses Octave?==<br />
<br />
Lots of people. It seems that universities use it for research and teaching, companies of all sizes, for development, individuals. This question comes often on Octave mailing lists, see [[WhoUsesOctave]] for a few answers<br />
<br />
==Who develops Octave?==<br />
<br />
Discussions about writing the software that would eventually become Octave started in about 1988 with James B. Rawlings and John W. Eaton at the University of Texas. John W. Eaton was the original author of Octave, starting full-time development in February 1992. He is still the primary maintainer. The community of users/developers has in addition contributed some code and fuels the discussion on the mailing lists help@octave.org (user forum), maintainers@octave.org (development issues), and octave-dev@lists.sourceforge.net (all things related to the Octave Forge repository of user-contributed functions).<br />
<br />
==Why '''GNU''' Octave?==<br />
<br />
The GNU Project was launched in 1984 to develop a complete Unix-like operating system which is free software: the GNU system.<br />
<br />
GNU is a recursive acronym for “GNU's Not Unix”; it is pronounced guh-noo, approximately like canoe.<br />
<br />
The Free Software Foundation (FSF) is the principal organizational sponsor of the GNU Project.<br />
<br />
Octave became GNU Octave in 1997 (beginning with version 2.0.6). This meant agreeing to consider Octave a part of the GNU Project and support the efforts of the FSF. A big part of this effort is to adhere to the [http://www.gnu.org/prep/standards/standards.html GNU coding standards] and to benefit from GNU's infrastructure (e.g. [http://hg.savannah.gnu.org/hgweb/octave/ code hosting] and [http://bugs.octave.org bug tracking]). Additionally, Octave receives [https://my.fsf.org/donate/working-together/octave sponsorship] from the FSF's Working Together fund. However, Octave is not and has never been developed by the FSF.<br />
<br />
For more information about the GNU project, see http://www.gnu.org.<br />
<br />
==What version should I use?==<br />
<br />
In general, you will find the latest version on http://www.octave.org/download.html. It is recommended to use the stable version of octave for general use, and the development version if you want the latest features and are willing to tolerate instability.<br />
<br />
A list of user-visible changes since the last release is available in the file NEWS. The file ChangeLog in the source distribution contains a more detailed record of changes made since the last release.<br />
<br />
==On what platforms does Octave run?==<br />
<br />
Octave runs on various Unices—at least Linux and Solaris, Mac OS X, Windows and anything you can compile it on. Binary distributions exist at least for Debian, SUSE, Fedora and RedHat Linuxes (Intel and AMD CPUs, at least), for Mac OS X and Windows' 98, 2000, XP, Vista, and 7.<br />
<br />
Two and three dimensional plotting is fully supported using gnuplot and an experimental OpenGL backend.<br />
<br />
The underlying numerical solvers are currently standard Fortran ones like LAPACK, LINPACK, ODEPACK, the BLAS, etc., packaged in a library of C++ classes. If possible, the Fortran subroutines are compiled with the system's Fortran compiler, and called directly from the C++ functions. If that's not possible, you can still compile Octave if you have the free Fortran to C translator f2c.<br />
<br />
Octave is also free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation, or at your option any later version.<br />
<br />
==How can I cite Octave?==<br />
<br />
Pointing to http://www.octave.org is good, because that gives people a direct way to find out more. If citation of a URL is not allowed by a publisher, or if you also want to point to a traditional reference, then you can cite the Octave manual:<br />
<br />
@BOOK{eaton:2008,<br />
author = "John W. Eaton, David Bateman, and Søren Hauberg",<br />
title = "GNU Octave Manual Version 3",<br />
publisher = "Network Theory Limited",<br />
year = "2008",<br />
isbn = "0-9546120-6-X"<br />
}<br />
<br />
=Licensing Issues=<br />
<br />
==If I write code using Octave do I have to release it under the GPL?==<br />
<br />
The answer depends on precisely how the code is written and how it works.<br />
<br />
Code written entirely in the scripting language of Octave (interpreted code in .m files) may be released under the terms of whatever license you choose.<br />
<br />
Code written using Octave's native plug-in interface (also known as a .oct file) necessarily links with Octave internals and is considered a derivative work of Octave and therefore must be released under terms that are compatible with the GPL.<br />
<br />
Code written using Octave's implementation of the Matlab MEX interface may be released under the terms of whatever license you choose, provided that the following conditions are met:<br />
<br />
# The plugin should not use any bindings that are specific to Octave. In other words, the MEX file must use the MEX interface only, and not also call on other Octave internals. It should be possible in principle to use the MEX file with other programs that implement the MEX interface (e.g., Matlab).<br />
# The MEX file should not be distributed together with Octave in such a way that they effectively create a single work. For example, you should not distribute the MEX file and Octave together in a single package such that Octave automatically loads and runs the MEX file when it starts up. There are other possible ways that you might effectively create a single work; this is just one example.<br />
<br />
A program that embeds the Octave interpreter (e.g., by calling the "octave_main" function), or that calls functions from Octave's libraries (e.g., liboctinterp, liboctave, or libcruft) is considered a derivative work of Octave and therefore must be released under terms that are compatible with the GPL.<br />
<br />
==Since the MEX interface allows plugins to be distributed under terms that are incompatible with the GPL, does this mean that you are encouraging people to to write non-free software for Octave?==<br />
<br />
No. The original reason for implementing the MEX interface for Octave was to allow Octave to run free software that uses MEX files (the particular goal was to run SundialsTB in Octave). The intent was to liberate that software from Matlab and increase the amount of free software available to Octave users, not to enable people to write proprietary code for Octave. For the good of the community, we strongly encourage users of Octave to release the code they write for Octave under terms that are compatible with the GPL.<br />
<br />
==I wrote a program that links with Octave libraries and I don't want to release it under the terms of the GPL. Will you change the license of the Octave libraries for me?==<br />
<br />
No. Instead of asking us to change the licensing terms for Octave, we recommend that you release your program under terms that are compatible with the GPL so that the free software community can benefit from your work the same as you have benefited from the work of all the people who have contributed to Octave.<br />
<br />
=What's new in version series 3.4.N and 3.5.N of Octave=<br />
<br />
The 3.4.N series has enough new features to justify a minor version number change. The full details are in the NEWS file, but in brief 3.4.N series brings:<br />
<br />
* ARPACK now distributed with Octave<br />
* Indexing optimisations<br />
* FTP object using libcurl<br />
* Better consistency with ismatrix, issquare, and issymetric<br />
* Function handles aware of overloaded functions<br />
* More efficient matrix division by making a single LAPACK call<br />
* Other optimisations in matrix operations<br />
* bsxfun optimised for basic arithmetic functions<br />
* Matlab-style ignoring of output arguments using <tt>~</tt><br />
* Many optimisations of the accumarray function<br />
* Sparse matrix indexing has been rewritten for speed<br />
* Configuration pseudo-variables like page_screen_output accept a "local" option argument to limit their scope to function scope<br />
* The pkg command now accepts a -forge option to pull packages directly from Octave-forge<br />
* Several dlmread improvements<br />
* Octave now uses gnulib for better cross-platform compatibility<br />
<br />
Here are some features that have been around since 3.2.N<br />
<br />
* integer types<br />
* fixed point arithmetic<br />
* sparse matrices<br />
* linear programming code based on GLPK<br />
* 64-bit compilation support<br />
* gzipped files and stream and consequently support of Matlab v7 files<br />
* better support for both msvc and mingw<br />
* a fully compatible MEX interface<br />
* many many other minor features and compatibility changes<br />
* an experimental OpenGL graphics toolkit to replace gnuplot<br />
* object orient programming<br />
* block comments<br />
* imwrite and imread (based on the GraphicsMagick library)<br />
* Lazy transpose <br/> Special treatment in the parser of things like "a' * b", where the transpose is never explicitly formed but a flag is rather passed to the underlying LAPACK code.<br />
* Single precision type<br />
* Improved array indexing <br/> The underlying code used for indexing of arrays has been completely rewritten and so the indexing of arrays is now significantly faster.<br />
<br />
Here are some older features that have been around since 2.1.N:<br />
<br />
* NDArrays<br />
* cells<br />
<br />
The 3.5.N series is the current development release and will become a 3.6.N release in the future. This series brings the following new features:<br />
<br />
* Perl compatible regular expressions<br />
* a profiler<br />
* broadcasting enabled for all built-in binary elementwise operators<br />
=What documentation exists for Octave?=<br />
<br />
Besides the current wiki, there are other important sources of documentation and help for Octave.<br />
<br />
==What documentation exists for Octave?==<br />
<br />
The Octave distribution includes a 650+ page manual that is also distributed under the terms of the GNU GPL. It is available on the web at http://www.octave.org/docs.html and you will also find there instructions on how to order a paper version.<br />
<br />
The complete text of the Octave manual is also available using the GNU Info system via the GNU Emacs, info, or xinfo programs, or by using the <tt>doc</tt> command to start the GNU info browser directly from the Octave prompt.<br />
<br />
If you have problems using this documentation, or find that some topic is not adequately explained, indexed, or cross-referenced, please report it on http://bugs.octave.org.<br />
<br />
==Getting additional help==<br />
<br />
If you can't find an answer to your question, the help@octave.org mailing list is available for questions related to using, installing, and porting Octave that are not adequately answered by the Octave manual or by this document.<br />
<br />
==User community==<br />
<br />
To subscribe to the list, go to http://www.octave.org/archive.html and follow the link to the subscription page for the list.<br />
<br />
Please do not send requests to be added or removed from the mailing list, or other administrative trivia to the list itself.<br />
<br />
An archive of old postings to the help-octave mailing list is maintained on http://www.octave.org/archive.html.<br />
<br />
You will also find some user advice and code spread over the web. Good starting points are the Octave Wiki http://wiki.octave.org and Octave-Forge http://octave.sourceforge.net<br />
<br />
We also have [http://www.octave.org/chat.html an IRC chat room].<br />
<br />
==I think I have found a bug in Octave.==<br />
<br />
“I think I have found a bug in Octave, but I'm not sure. How do I know, and who should I tell?”<br />
<br />
First, see the section [http://www.octave.org/bugs.html on bugs and bug reports in the Octave manual]. When you report a bug, make sure to describe the type of computer you are using, the version of the operating system it is running, and the version of Octave that you are using. Also provide enough code and configuration details of your operating system so that the Octave maintainers can duplicate your bug.<br />
<br />
=How can I obtain Octave?=<br />
<br />
==Source code==<br />
<br />
Source code is available on the Octave development site, where you are sure to get the latest version.<br />
<br />
* http://www.octave.org/download.html<br />
* ftp://ftp.octave.org/pub/octave/<br />
<br />
Since Octave is distributed under the terms of the GPL, you can get Octave from a friend who has a copy, or from the Octave website.<br />
<br />
==Pre-compiled binary packages==<br />
<br />
The Octave project does not distribute binary packages, but other projects do. For an up-to-date listing of packagers, see:<br />
<br />
* http://www.octave.org/download.html<br />
* [[Build From Source]]<br />
<br />
As of today, Octave binaries are available at least on Debian, Ubuntu, RedHat, Suse and Fedora GNU/Linuxen, Mac OS X, Windows' 98, 2000 and XP, Vista, and 7.<br />
<br />
==How do I get a copy of Octave for (some other platform)?==<br />
<br />
Octave currently runs on Unix-like systems, Mac OS X, and Windows. It should be possible to make Octave work on other systems as well. If you are interested in porting Octave to other systems, please contact [mailto:maintainers@octave.org the maintainers' mailing list].<br />
<br />
=Installation Issues and Problems= <br />
<br />
Octave 3.4 requires approximately 1.3 GB of disk storage to unpack and compile from source (considerably less if you don't compile with debugging symbols). Once installed, Octave requires approximately 355 MB of disk space (again, considerably less if you don't compile with debugging symbols, approximately 50 MB).<br />
<br />
==What else do I need?==<br />
<br />
To compile Octave, you will need a recent version of GNU Make. You will also need GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
'''You must have GNU Make to compile octave'''. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install.<br />
<br />
==Can I compile Octave with another C++ compiler?==<br />
<br />
Yes, but development is done primarily with GCC, so you may hit some incompatibilities. Octave is intended to be portable to any standard conforming compiler. If you have difficulties that you think are bugs, please report them to the http://bugs.octave.org bug tracker, or ask for help on the [mailto:help@octave.org mailing list].<br />
<br />
<br />
=Coding=<br />
<br />
==What features are unique to Octave?==<br />
<br />
Although most of the Octave language will be familiar to Matlab users, it has some unique features of its own.<br />
<br />
=== Functions defined on the command-line===<br />
Functions can be defined by entering code on the command line, a feature not supported by Matlab. For example, you may type:<br />
<br />
octave:1> function s = hello_string (to_who)<br />
> ## Say hello<br />
> if nargin<1, to_who = "World"; end<br />
> s = ["Hello ",\<br />
> to_who];<br />
> endfunction<br />
octave:2> hello_string ("Moon")<br />
ans = Hello Moon<br />
<br />
===Comments with #===<br />
<br />
The pound character, <tt>#</tt>, may be used to start comments, in addition to <tt>%</tt>. See the previous example. The major advantage of this is that as <tt>#</tt> is also a comment character for unix script files, any file that starts with a string like <tt>#! /usr/bin/octave -q</tt> will be treated as an octave script and be executed by octave.<br />
<br />
===Strings delimited by double quotes "===<br />
<br />
The double quote, <tt>"</tt>, may be used to delimit strings, in addition to the single quote <tt>'</tt>. See the previous example. Also, double-quoted strings include backslash interpretation (like C++, C, and Perl) while single quoted are uninterpreted (like Matlab and Perl).<br />
<br />
===Line continuation by backslash===<br />
<br />
Lines can be continued with a backslash, <tt>\</tt>, in addition to three points <tt>...</tt>. See the previous example.<br />
<br />
===Informative block closing===<br />
<br />
You may close function, for, while, if, ... blocks with endfunction, endfor, endwhile, ... keywords in addition to using end. As with Matlab, the end (or endfunction) keyword that marks the end of a function defined in a .m file is optional.<br />
<br />
===Coherent syntax===<br />
<br />
Indexing other things than variables is possible, as in:<br />
<br />
octave:1> [3 1 4 1 5 9](3)<br />
ans = 4<br />
octave:2> cos([0 pi pi/4 7])(3)<br />
ans = 0.70711<br />
<br />
In Matlab, it is for example necessary to assign the intermediate result <tt>cos([0 pi pi/4 7])</tt> to a variable before it can be indexed again.<br />
<br />
===Exclamation mark as not operator===<br />
<br />
The exclamation mark <tt>!</tt> (aka “Bang!”) is a negation operator, just like the tilde <tt>~</tt>:<br />
<br />
octave:1> if ! strcmp (program_name, "octave"),<br />
> "It's an error"<br />
> else<br />
> "It works!"<br />
> end<br />
ans = It works!<br />
Note however that Matlab uses the <tt>!</tt> operator for shell escapes, for which Octave requires using the system command.<br />
<br />
===Increment and decrement operators===<br />
<br />
If you like the <tt>++</tt>, <tt>+=</tt> etc operators, rejoice! Octave includes the C-like increment and decrement operators <tt>++</tt> and <tt>--</tt> in both their prefix and postfix forms, in addition to <tt>+=</tt>, <tt>-=</tt>, <tt>*=</tt>, <tt>/=</tt>, <tt>^=</tt>, <tt>.*=</tt>, <tt>./=</tt>, and <tt>.^=</tt>.<br />
<br />
For example, to pre-increment the variable x, you would write ++x. This would add one to x and then return the new value of x as the result of the expression. It is exactly the same as the expression x = x + 1.<br />
<br />
To post-increment a variable x, you would write x++. This adds one to the variable x, but returns the value that x had prior to incrementing it. For example, if x is equal to 2, the result of the expression x++ is 2, and the new value of x is 3.<br />
<br />
For matrix and vector arguments, the increment and decrement operators work on each element of the operand.<br />
<br />
===Unwind-protect===<br />
<br />
In addition to try-catch blocks, Octave supports an alternative form of exception handling modeled after the unwind-protect form of Lisp. The general form of an unwind_protect block looks like this:<br />
<br />
unwind_protect<br />
body<br />
unwind_protect_cleanup<br />
cleanup<br />
end_unwind_protect<br />
<br />
Where body and cleanup are both optional and may contain any Octave expressions or commands. The statements in cleanup are guaranteed to be executed regardless of how control exits body.<br />
<br />
The unwind_protect statement is often used to reliably restore the values of global variables that need to be temporarily changed.<br />
<br />
Matlab can be made to do something similar with their <tt>OnCleanUp</tt> function that was introduced in 2008a. Octave also has <tt>onCleanup</tt> since version 3.4.0.<br />
<br />
===Built-in ODE and DAE solvers===<br />
<br />
Octave includes LSODE and DASSL for solving systems of stiff ordinary differential and differential-algebraic equations. These functions are built in to the interpreter.<br />
<br />
==How does Octave solve linear systems?==<br />
<br />
In addition to consulting Octave's source for the precise details, you can read the Octave manual for a complete high-level description of the algorithm that Octave uses to decide how to solve a particular linear system, e.g. how the backslash operator <tt>A\x</tt> will be interpreted. Sections [http://www.gnu.org/software/octave/doc/interpreter/Techniques-Used-for-Linear-Algebra.html#Techniques-Used-for-Linear-Algebra Techniques Used for Linear Algebra] and [http://www.gnu.org/software/octave/doc/interpreter/Sparse-Linear-Algebra.html Linear Algebra on Sparse Matrices] from the manual describe this procedure.<br />
<br />
=How do I...?=<br />
<br />
==How do I erase a figure?== <br />
<br />
closeplot(); <br />
closefig(number)<br />
<br />
==How do I set the number of displayed decimals?==<br />
<br />
octave:1> format long<br />
octave:2> pi<br />
pi = 3.14159265358979<br />
octave:3> format short<br />
octave:4> pi<br />
pi = 3.1416<br />
<br />
==How do I vary the line thickness?==<br />
<br />
* There's plpot_octave, but the one in debian doesn't work for me.<br />
* Here's my octave hack for it--- http://gnufans.net/~deego/pub/octave/plot_width.m This one simply draws the line multiple times.<br />
* You can edit the .eps file manually or using sed and awk.<br />
* Export the graph as fig file (gset term fig thickness 2). This also allows for easy postediting with xfig and export to formats not supported by gnuplot.<br />
* The gplot command of octave does not support gnuplot's linewidth parameter Thus you must use the graw() function for sending this option directly to gnuplot, eg. <br />
graw('replot "" notitle with lines lw 4\n');<br />
*Search the [http://octave.1599824.n4.nabble.com/ octave archives] for more.<br />
<br />
==How do I call an octave function from C++?==<br />
<br />
*Here is an untested code snippet for calling rand([9000,1]), modified from a post by HerberFarnsworth? to help-octave on 2003-05-01:<br />
<br />
#include <octave/oct.h><br />
...<br />
ColumnVector NumRands(2);<br />
NumRands(0) = 9000;<br />
NumRands(1) = 1;<br />
octave_value_list f_arg, f_ret;<br />
f_arg(0) = octave_value(NumRands);<br />
f_ret = feval("rand",f_arg,1);<br />
Matrix unis(f_ret(0).matrix_value());<br />
<br />
==How do I create a full semilog/log grid==<br />
<br />
gset grid mxtics mytics<br />
gset grid lw 2, lw 0.1<br />
grid("on");<br />
<br />
One can use postscript enhancement for proper axis<br />
gset format x "10^{%%L}"<br />
or<br />
gset format y "10^{%%L}" <br />
<br />
==How do I change colour/line definition in gnuplot postscript?==<br />
Here is a awk script to get a rainbow colour map<br />
<br />
#!/bin/awk -f<br />
<br />
BEGIN {<br />
split("0 4 6 7 5 3 1 2 8", rainbow, " ");<br />
split("7 3 1 0 2 4 6 5 8", invraim, " ");<br />
}<br />
<br />
$1 ~ /\/LT[0-8]/ {<br />
n = substr($1, 4, 1);<br />
if (n == 0)<br />
lt = "{ PL [] 0.9 0.1 0.1 DL } def";<br />
else if (n == 1)<br />
lt = "{ PL [4 dl 2 dl] 0.1 .75 0.1 DL } def";<br />
else if (n == 2)<br />
lt = "{ PL [2 dl 3 dl] 0.1 0.1 0.9 DL } def";<br />
else if (n == 3)<br />
lt = "{ PL [1 dl 1.5 dl] 0.9 0 0.8 DL } def";<br />
else if (n == 4)<br />
lt = "{ PL [5 dl 2 dl 1 dl 2 dl] 0.1 0.8 0.8 DL } def";<br />
else if (n == 5)<br />
lt = "{ PL [4 dl 3 dl 1 dl 3 dl] 0.9 0.8 0.2 DL } def";<br />
else if (n == 6)<br />
lt = "{ PL [2 dl 2 dl 2 dl 4 dl] 0.5 0.3 0.1 DL } def";<br />
else if (n == 7)<br />
lt = "{ PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.4 0 DL } def";<br />
else if (n == 8)<br />
lt = "{ PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def";<br />
$0 = sprintf("/LT%d %s", rainbow[n+1], lt);<br />
##$0 = sprintf("/LT%x %s", invraim[n+1], lt);<br />
##$0 = sprintf("/LT%x %s", n, lt);<br />
}<br />
<br />
{ print; }<br />
<br />
==How do I tell if a file exists?==<br />
<br />
Look at functions like exist, file_in_path.. and the other functions that their descriptions point to.<br />
<br />
<br />
==How do I create a plot without a window popping up (ie, a plot to a file)?==<br />
<br />
figure(1, "visible", "off");<br />
plot(sin(1:100));<br />
print -deps "/tmp/sin.eps"<br />
<br />
One can set that behaviour as default:<br />
<br />
set(0, 'defaultfigurevisible', 'off');<br />
<br />
<br />
=Common problems=<br />
<br />
==How do I get sound output in Windows?== <br />
See http://www.octave.org/octave-lists/archive/help-octave.2003/msg01567.html for a start.<br />
<br />
==Why does Octave segfault when using "clear all;"?==<br />
<br />
This is a known problem if you have one of the following packages loaded:<br />
<br />
* ann<br />
* database<br />
* ftp <br />
<br />
See http://www.nabble.com/Segmentation-Fault---Clear-all-td21998563.html for a discussion<br />
<br />
==Octave takes a long time to find symbols.==<br />
<br />
Octave uses the genpath function to recursively add directories to the list of directories searched for function files. Check the list of directories with the path command. If the path list is very long check your use of the genpath function.<br />
<br />
==When plotting Octave occasionally gives me errors like <tt>gnuplot> 9 0.735604 line 26317: invalid command</tt>.==<br />
There is a known bug in gnuplot 4.2 that can cause an off by one error while piping data to gnuplot. It has been fixed in gnuplot 4.4.<br />
<br />
If you have obtained your copy of Octave from a distribution please file a bug report requesting that the fix reported in the above bug report be included.<br />
<br />
==I cannot install a package. Octave complains about a missing mkoctfile.==<br />
<br />
Most distributions split Octave into several packages. The script mkoctfile is then part of a separate package:<br />
<br />
* Debian/Ubuntu<br/><br />
<tt>aptitude install octave-headers</tt><br />
<br />
* Fedora<br/><br />
<tt>yum install octave-devel</tt><br />
<br />
=Porting programs from Matlab to Octave=<br />
<br />
People often ask<br />
<br />
<blockquote><br />
I wrote some code for Matlab, and I want to get it running under Octave. Is there anything I should watch out for?<br />
</blockquote><br />
<br />
or alternatively<br />
<br />
<blockquote><br />
I wrote some code in Octave, and want to share it with Matlab users. Is there anything I should watch out for?<br />
</blockquote><br />
<br />
which is not quite the same thing. There are still a number of differences between Octave and Matlab, however in general differences between the two are considered as bugs. Octave might consider that the bug is in Matlab and do nothing about it, but generally functionality is almost identical. If you find a difference between Octave behavior and Matlab, then you should send a description of this difference (with code illustrating the difference, if possible) to http://bugs.octave.org.<br />
<br />
Furthermore, Octave adds a few syntactical extensions to Matlab that might cause some issues when exchanging files between Matlab and Octave users. As both Octave and Matlab are under constant development the information in this section is subject to change at anytime.<br />
<br />
You should also look at the page http://octave.sourceforge.net/packages.html and http://octave.sourceforge.net/doc/ that has a function reference that is up to date. You can use this function reference to see the number of octave function that are available and their Matlab compatibility.<br />
<br />
==How is Octave different from Matlab?==<br />
<br />
The major differences between Octave 3.4.N and Matlab R2010b are:<br />
<br />
===Nested Functions===<br />
Octave has limited support for nested functions. That is<br />
<br />
function y = foo (x)<br />
y = bar(x)<br />
function y = bar (x)<br />
y = ...;<br />
end<br />
end<br />
<br />
is equivalent to<br />
<br />
function y = foo (x)<br />
y = bar(x)<br />
end<br />
function y = bar (x)<br />
y = ...;<br />
end<br />
<br />
The main difference with Matlab is a matter of scope. While nested functions have access to the parent function's scope in Matlab, no such thing is available in Octave, due to how Octave essentially “un-nests” nested functions.<br />
<br />
The authors of Octave consider the nested function scoping rules of Matlab to be more problems than they are worth as they introduce difficult to find bugs as inadvertently modifying a variable in a nested function that is also used in the parent is particularly easy.<br />
<br />
===Differences in core syntax===<br />
<br />
There a few core Matlab syntaxes that are not accepted by Octave, these being<br />
<br />
* Some limitations on the use of function handles. The major difference is related to nested function scoping rules (as above) and their use with function handles.<br />
<br />
* Some limitations of variable argument lists on the LHS of an expression, though the most common types are accepted.<br />
<br />
* Matlab classdef object oriented programming is not yet supported, though work is underway and when development more on to Octave 3.5 this will be included in the development tree.<br />
<br />
===Differences in core functions===<br />
<br />
A large number of the Matlab core functions (ie those that are in the core and not a toolbox) are implemented, and certainly all of the commonly used ones. There are a few functions that aren't implemented, usually to do with specific missing Octave functionality (GUI, DLL, Java, ActiveX, DDE, web, and serial functions). Some of the core functions have limitations that aren't in the Matlab version. For example the sprandn function can not force a particular condition number for the matrix like Matlab can.<br />
<br />
===Just-In-Time compiler===<br />
<br />
Matlab includes a "Just-In-Time" compiler. This compiler allows the acceleration of for-loops in Matlab to almost native performance with certain restrictions. The JIT must know the return type of all functions called in the loops and so you can't include user functions in the loop of JIT optimized loops. Octave doesn't have a JIT and so to some might seem slower than Matlab. For this reason you must vectorize your code as much as possible. The MathWorks themselves have a good document discussing vectorization at http://www.mathworks.com/support/tech-notes/1100/1109.html.<br />
<br />
===Compiler===<br />
<br />
On a related point, there is no Octave compiler, and so you can't convert your Octave code into a binary for additional speed or distribution. There have been several aborted attempts at creating an Octave compiler. Should the JIT compiler above ever be implemented, an Octave compiler should be more feasible.<br />
<br />
===Graphic Handles===<br />
<br />
Up to Octave 2.9.9 there was no support for graphic handles in Octave itself. In the 3.2.N versions of Octave and beyond the support for graphics handles is converging towards full compatibility. The patch function is currently limited to 2-D patches, due to an underlying limitation in gnuplot, but the experimental OpenGL backend is starting to see an implementation of 3-D patches.<br />
===GUI===<br />
<br />
There are no Matlab compatible GUI functions yet. This might be an issue if you intend to exchange Octave code with Matlab users. There are a number of bindings from Octave to Tcl/Tk, VTK and Zenity included in the Octave Forge project (http://octave.sourceforge.net) for example that can be used for a GUI, but these are not Matlab compatible. Work on a Matlab compatible GUI is in an alpha stage in the QtHandles project, which may form part of a future release of Octave.<br />
<br />
===Simulink===<br />
<br />
Octave itself includes no Simulink support. Typically the simulink models lag research and are less flexible, so shouldn't really be used in a research environment. However, some Matlab users that try to use Octave complain about this lack.<br />
<br />
===MEX-Files===<br />
<br />
Octave includes an API to the Matlab MEX interface. However, as MEX is an API to the internals of Matlab and the internals of Octave differ from Matlab, there is necessarily a manipulation of the data to convert from a MEX interface to the Octave equivalent. This is notable for all complex matrices, where Matlab stores complex arrays as real and imaginary parts, whereas Octave respects the C99/C++ standards of co-locating the real/imag parts in memory. Also due to the way Matlab allows access to the arrays passed through a pointer, the MEX interface might require copies of arrays (even non complex ones).<br />
<br />
===Block comments===<br />
<br />
Block comments denoted by <tt>#{</tt> and <tt>#}</tt> markers (or <tt>%{</tt> and <tt>%}</tt>) are supported by Octave with some limitations. The major limitation is that block comments are not supported within [] or {}.<br />
<br />
===Mat-File format===<br />
<br />
There are some differences in the mat v5 file format accepted by Octave. Matlab recently introduced the "-V7.3" save option which is an HDF5 format which is particularly useful for 64-bit platforms where the standard Matlab format can not correctly save variables. Octave accepts HDF5 files, but is not yet compatible with the "-v7.3" versions produced by Matlab.<br />
<br />
Although Octave can load inline function handles saved by Matlab, it can not yet save them.<br />
<br />
Finally, Some multi-byte Unicode characters aren't yet treated in mat-files.<br />
<br />
===Profiler===<br />
<br />
Current Octave releases don't have a profiler, but there is one in the 3.5 development version, thanks to Daniel Kraft's 2011 Google Summer of Code project. It should be released with 3.6.<br />
<br />
===Toolboxes===<br />
<br />
Octave is a community project and so the toolboxes that exist are donated by those interested in them through the Octave Forge website (http://octave.sourceforge.net). These might be lacking in certain functionality relative to the Matlab toolboxes, and might not exactly duplicate the Matlab functionality or interface.<br />
<br />
===Short-circuit <tt>&</tt> and <tt>|</tt> operators===<br />
<br />
The <tt>&</tt> and <tt>|</tt> operators in Matlab short-circuit when included in an if statement and not otherwise. In Octave only the <tt>&&</tt> and <tt>||</tt> short circuit. Note that this means that<br />
<br />
if (a | b)<br />
...<br />
end<br />
<br />
and<br />
<br />
t = a | b;<br />
if t<br />
...<br />
end<br />
<br />
have different semantics in Matlab. This is really a Matlab bug, but there is too much code out there that relies on this behaviour to change it. Prefer the <tt>||</tt> and <tt>&&</tt> operators in <tt>if</tt> statements if possible. If you need to use code written for Matlab that depends on this buggy behaviour, you can enable it since Octave 3.4.0 with the following command:<br />
<br />
do_braindead_shortcircuit_evaluation(1)<br />
<br />
Note that the difference with Matlab is also significant when either argument is a function with side effects or if the first argument is a scalar and the second argument is an empty matrix. For example, note the difference between<br />
<br />
t = 1 | []; ## results in [], so...<br />
if (t) 1, end ## in if ([]), this is false.<br />
<br />
and<br />
<br />
if (1 | []) 1, end ## short circuits so condition is true.<br />
<br />
Another case that is documented in the Matlab manuals is that<br />
<br />
t = [1, 1] | [1, 2, 3]; ## error<br />
if ([1, 1] | [1, 2, 3]) 1, end ## OK<br />
<br />
Also Matlab requires the operands of <tt>&&</tt> and <tt>||</tt> to be scalar values but Octave does not (it just applies the rule that for an operand to be considered true, every element of the object must be nonzero or logically true).<br />
<br />
Finally, note the inconsistence of thinking of the condition of an <tt>if</tt> statement as being equivalent to <tt>all(X(:))</tt> when <tt>X</tt> is a matrix. This is true for all cases EXCEPT empty matrices:<br />
<br />
if ([0, 1]) == if (all ([0, 1])) ==> i.e., condition is false.<br />
if ([1, 1]) == if (all ([1, 1])) ==> i.e., condition is true.<br />
<br />
However,<br />
<br />
if ([])<br />
<br />
is not the same as<br />
<br />
if (all ([]))<br />
<br />
because, despite the name, the <tt>all</tt> is really returning true if none of the elements of the matrix are zero, and since there are no elements, well, none of them are zero. This is an example of [http://en.wikipedia.org/wiki/Vacuous_truth vacuous truth]. But, somewhere along the line, someone decided that <tt>if ([])</tt> should be false. Mathworks probably thought it just looks wrong to have <tt>[]</tt> be true in this context even if you can use logical gymnastics to convince yourself that "all" the elements of an empty matrix are nonzero. Octave however duplicates this behavior for <tt>if</tt> statements containing empty matrices.<br />
<br />
===Solvers for singular, under- and over-determined matrices===<br />
<br />
Matlab's solvers as used by the operators mldivide (\) and mrdivide (/), use a different approach than Octave's in the case of singular, under-, or over-determined matrices. In the case of a singular matrix, Matlab returns the result given by the LU decomposition, even though the underlying solver has flagged the result as erroneous. Octave has made the choice of falling back to a minimum norm solution of matrices that have been flagged as singular which arguably is a better result for these cases.<br />
<br />
In the case of under- or over-determined matrices, Octave continues to use a minimum norm solution, whereas Matlab uses an approach that is equivalent to<br />
<br />
function x = mldivide (A, b)<br />
[Q, R, E] = qr(A);<br />
x = [A \ b, E(:, 1:m) * (R(:, 1:m) \ (Q' * b))]<br />
end<br />
<br />
While this approach is certainly faster and uses less memory than Octave's minimum norm approach, this approach seems to be inferior in other ways.<br />
<br />
A numerical question arises: how big can the null space component become, relative to the minimum-norm solution? Can it be nicely bounded, or can it be arbitrarily big? Consider this example:<br />
<br />
m = 10;<br />
n = 10000;<br />
A = ones(m, n) + 1e-6 * randn(m,n);<br />
b = ones(m, 1) + 1e-6 * randn(m,1);<br />
norm(A \ b)<br />
<br />
while Octave's minimum-norm values are around 3e-2, Matlab's results are 50-times larger. For another issue, try this code:<br />
<br />
m = 5;<br />
n = 100;<br />
j = floor(m * rand(1, n)) + 1;<br />
b = ones(m, 1);<br />
A = zeros(m, n);<br />
A(sub2ind(size(A),j,1:n)) = 1;<br />
x = A \ b;<br />
[dummy,p] = sort(rand(1,n));<br />
y = A(:,p)\b;<br />
norm(x(p)-y)<br />
<br />
It shows that unlike in Octave, mldivide in Matlab is not invariant with respect to column permutations. If there are multiple columns of the same norm, permuting columns of the matrix gets you different result than permuting the solution vector. This will surprise many users.<br />
<br />
Since the mldivide (\) and mrdivide (/) operators are often part of a more complex expression, where there is no room to react to warnings or flags, it should prefer intelligence (robustness) to speed, and so the Octave developers are firmly of the opinion that Octave's approach for singular, under- and over-determined matrices is a better choice than Matlab's.<br />
<br />
===Octave extensions===<br />
<br />
The extensions in Octave over Matlab syntax are very useful, but might cause issues when sharing with Matlab users. A list of the major extensions that should be avoided to be compatible with Matlab are<br />
Comments in octave can be marked with <tt>#</tt>. This allows POSIX systems to have the first line as <tt>#! octave -q</tt> and mark the script itself executable. Matlab doesn't have this feature due to the absence of comments starting with <tt>#</tt>".<br />
<br />
Code blocks like if, for, while, etc can be terminated with block specific terminations like endif. Matlab doesn't have this and all blocks must be terminated with end.<br />
<br />
Octave has a lisp-like <tt>unwind_protect</tt> block that allows blocks of code that terminate in an error to ensure that the variables that are touched are restored. You can do something similar with try/catch combined with <tt>rethrow (lasterror ())</tt> in Matlab, however rethrow and lasterror are only available in Octave 2.9.10 and later. Matlab 2008a also introduced <tt>OnCleanUp</tt> that is similar to <tt>unwind_protect</tt>, except that the object created by this function has to be explicitly cleared in order for the cleanup code to run.<br />
<br />
Note that using try/catch combined with <tt>rethrow (lasterror ())</tt> can not guarantee that global variables will be correctly reset, as it won't catch user interrupts with Ctrl-C. For example<br />
<br />
global a<br />
a = 1;<br />
try<br />
_a = a;<br />
a = 2<br />
while true<br />
end<br />
catch<br />
fprintf ('caught interrupt\n');<br />
a = _a;<br />
rethrow (lasterror());<br />
end<br />
<br />
compared to<br />
<br />
global a<br />
a = 1;<br />
unwind_protect<br />
_a = a;<br />
a = 2<br />
while true<br />
end<br />
unwind_protect_cleanup<br />
fprintf ('caught interrupt\n');<br />
a = _a;<br />
end<br />
<br />
Typing Ctrl-C in the first case returns the user directly to the prompt, and the variable ''a'' is not reset to the saved value. In the second case the variable ''a'' is reset correctly. Therefore Matlab gives no safe way of temporarily changing global variables.<br />
<br />
Indexing can be applied to all objects in Octave and not just variables. Therefore <tt>sin(x)(1:10);</tt> for example is perfectly valid in Octave but not Matlab. To do the same in Matlab you must do <tt>y = sin(x); y = y([1:10]);</tt><br />
<br />
Octave has the operators <tt>++</tt>, <tt>–</tt>, <tt>-=</tt>, <tt>+=</tt>, <tt>*=</tt>, etc. As Matlab doesn't, if you are sharing code these should be avoided.<br />
<br />
Character strings in Octave can be denoted with double or single quotes. There is a subtle difference between the two in that escaped characters like <tt>\n</tt> (newline), <tt>\t</tt> (tab), etc are interpreted in double quoted strings but not single quoted strings. This difference is important on Windows platforms where the <tt>\</tt> character is used in path names, and so single quoted strings should be used in paths. Matlab doesn't have double quoted strings and so they should be avoided if the code will be transferred to a Matlab user.</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=47Build from source2011-11-17T09:41:33Z<p>Crobar: moved Compile From Source to Build From Source: Better title, and same as original</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=25Build from source2011-11-16T10:22:47Z<p>Crobar: /* Troubleshooting */ Made subsection of Build</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
==Troubleshooting== <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=24Build from source2011-11-16T10:21:29Z<p>Crobar: /* Troubleshooting */ Made subsection of Configure</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
==Troubleshooting==<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
=Troubleshooting= <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=23Build from source2011-11-16T10:20:29Z<p>Crobar: /* System Specific Instructions */ Corrected link descriptions</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
=Troubleshooting=<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
=Troubleshooting= <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=22Build from source2011-11-16T10:19:04Z<p>Crobar: /* Install */ Removed horizontal line</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
=Troubleshooting=<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
=Troubleshooting= <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX PaulKienzleIrixConf]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X OctaveForMac]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian DebianDevelopmentSources]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=21Build from source2011-11-16T10:17:35Z<p>Crobar: /* System Specific Instructions */ Removed horizontal line</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
=Troubleshooting=<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
=Troubleshooting= <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
----<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX PaulKienzleIrixConf]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X OctaveForMac]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian DebianDevelopmentSources]<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=GNU_Octave_Wiki&diff=20GNU Octave Wiki2011-11-16T10:05:01Z<p>Crobar: Added link to FAQ on first page</p>
<hr />
<div>[http://www.octave.org GNU Octave] is a high-level interpreted language, primarily intended for numerical computations. It provides capabilities for the numerical solution of linear and nonlinear problems, and for performing other numerical experiments. It also provides extensive graphics capabilities for data visualization and manipulation. Octave is normally used through its interactive command line interface, but it can also be used to write non-interactive programs. The Octave language is quite similar to Matlab so that most programs are easily portable.<br />
<br />
This wiki is intended to supplement the [http://www.gnu.org/software/octave/doc/interpreter Octave documentation].<br />
<br />
The [[FAQ]] is a good place to start in this wiki.</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=FAQ&diff=19FAQ2011-11-16T09:56:13Z<p>Crobar: /* Pre-compiled binary packages */ CHanged link to old wiki page to ported version in this wiki</p>
<hr />
<div>This is a list of frequently asked questions (FAQ) for Octave users.<br />
<br />
We are always looking for new questions (with answers), better answers, or both. Feel free to edit this page with your changes. If you have general questions about Octave, or need help for something that is not covered by the Octave manual or the FAQ, please use the help@octave.org mailing list.<br />
<br />
This FAQ is intended to supplement, not replace, the Octave manual. Before posting a question to the help@octave.org mailing list, you should first check to see if the topic is covered in the manual.<br />
<br />
=General=<br />
<br />
==What is Octave?==<br />
<br />
Octave is a high-level interactive language, primarily intended for numerical computations that is mostly compatible with Matlab.1<br />
<br />
Octave can do arithmetic for real, complex or integer-valued scalars and matrices, solve sets of nonlinear algebraic equations, integrate functions over finite and infinite intervals, and integrate systems of ordinary differential and differential-algebraic equations.<br />
<br />
Octave uses the GNU readline library to handle reading and editing input. By default, the line editing commands are similar to the cursor movement commands used by GNU Emacs, and a vi-style line editing interface is also available. At the end of each session, the command history is saved, so that commands entered during previous sessions are not lost.<br />
<br />
The Octave distribution includes a 650+ page Texinfo manual. Access to the complete text of the manual is available via the doc command at the Octave prompt.<br />
<br />
==Who uses Octave?==<br />
<br />
Lots of people. It seems that universities use it for research and teaching, companies of all sizes, for development, individuals. This question comes often on Octave mailing lists, see [[WhoUsesOctave]] for a few answers<br />
<br />
==Who develops Octave?==<br />
<br />
Discussions about writing the software that would eventually become Octave started in about 1988 with James B. Rawlings and John W. Eaton at the University of Texas. John W. Eaton was the original author of Octave, starting full-time development in February 1992. He is still the primary maintainer. The community of users/developers has in addition contributed some code and fuels the discussion on the mailing lists help@octave.org (user forum), maintainers@octave.org (development issues), and octave-dev@lists.sourceforge.net (all things related to the Octave Forge repository of user-contributed functions).<br />
<br />
==Why '''GNU''' Octave?==<br />
<br />
The GNU Project was launched in 1984 to develop a complete Unix-like operating system which is free software: the GNU system.<br />
<br />
GNU is a recursive acronym for “GNU's Not Unix”; it is pronounced guh-noo, approximately like canoe.<br />
<br />
The Free Software Foundation (FSF) is the principal organizational sponsor of the GNU Project.<br />
<br />
Octave became GNU Octave in 1997 (beginning with version 2.0.6). This meant agreeing to consider Octave a part of the GNU Project and support the efforts of the FSF. However, Octave is not and has never been developed by the FSF.<br />
<br />
For more information about the GNU project, see http://www.gnu.org.<br />
<br />
==What version should I use?==<br />
<br />
In general, you will find the latest version on http://www.octave.org/download.html. It is recommended to use the “stable” version of octave for general use, and the “development” version if you want the latest features.<br />
<br />
A list of user-visible changes since the last release is available in the file NEWS. The file ChangeLog in the source distribution contains<br />
a more detailed record of changes made since the last release.<br />
<br />
==On what platforms does Octave run?==<br />
<br />
Octave runs on various Unices—at least Linux and Solaris, Mac OS X, Windows and anything you can compile it on. Binary distributions exist at least for Debian, Suse, Fedora and RedHat Linuxes (Intel and AMD CPUs, at least), for Mac OS X and Windows' 98, 2000, XP, Vista, and 7.<br />
<br />
Two and three dimensional plotting is fully supported using gnuplot and an experimental OpenGL backend.<br />
<br />
The underlying numerical solvers are currently standard Fortran ones like LAPACK, LINPACK, ODEPACK, the BLAS, etc., packaged in a library of C++ classes. If possible, the Fortran subroutines are compiled with the system's Fortran compiler, and called directly from the C++ functions. If that's not possible, you can still compile Octave if you have the free Fortran to C translator f2c.<br />
<br />
Octave is also free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation, or at your option any later version.<br />
<br />
==How can I cite Octave?==<br />
<br />
Pointing to http://www.octave.org is good, because that gives people a direct way to find out more. If citation of a URL is not allowed by a publisher, or if you also want to point to a traditional reference, then you can cite the Octave manual:<br />
<br />
@BOOK{eaton:2008,<br />
author = "John W. Eaton, David Bateman, and Søren Hauberg",<br />
title = "GNU Octave Manual Version 3",<br />
publisher = "Network Theory Limited",<br />
year = "2008",<br />
isbn = "0-9546120-6-X"<br />
}<br />
<br />
=Licensing Issues=<br />
<br />
==If I write code using Octave do I have to release it under the GPL?==<br />
<br />
The answer depends on precisely how the code is written and how it works.<br />
<br />
Code written entirely in the scripting language of Octave (interpreted code in .m files) may be released under the terms of whatever license you choose.<br />
<br />
Code written using Octave's native plug-in interface (also known as a .oct file) necessarily links with Octave internals and is considered a derivative work of Octave and therefore must be released under terms that are compatible with the GPL.<br />
<br />
Code written using Octave's implementation of the Matlab MEX interface may be released under the terms of whatever license you choose, provided that the following conditions are met:<br />
<br />
# The plugin should not use any bindings that are specific to Octave. In other words, the MEX file must use the MEX interface only, and not also call on other Octave internals. It should be possible in principle to use the MEX file with other programs that implement the MEX interface (e.g., Matlab).<br />
# The MEX file should not be distributed together with Octave in such a way that they effectively create a single work. For example, you should not distribute the MEX file and Octave together in a single package such that Octave automatically loads and runs the MEX file when it starts up. There are other possible ways that you might effectively create a single work; this is just one example.<br />
<br />
A program that embeds the Octave interpreter (e.g., by calling the "octave_main" function), or that calls functions from Octave's libraries (e.g., liboctinterp, liboctave, or libcruft) is considered a derivative work of Octave and therefore must be released under terms that are compatible with the GPL.<br />
<br />
==Since the MEX interface allows plugins to be distributed under terms that are incompatible with the GPL, does this mean that you are encouraging people to to write non-free software for Octave?==<br />
<br />
No. The original reason for implementing the MEX interface for Octave was to allow Octave to run free software that uses MEX files (the particular goal was to run SundialsTB in Octave). The intent was to liberate that software from Matlab and increase the amount of free software available to Octave users, not to enable people to write proprietary code for Octave. For the good of the community, we strongly encourage users of Octave to release the code they write for Octave under terms that are compatible with the GPL.<br />
<br />
==I wrote a program that links with Octave libraries and I don't want to release it under the terms of the GPL. Will you change the license of the Octave libraries for me?==<br />
<br />
No. Instead of asking us to change the licensing terms for Octave, we recommend that you release your program under terms that are compatible with the GPL so that the free software community can benefit from your work the same as you have benefited from the work of all the people who have contributed to Octave.<br />
<br />
=What's new in version series 3.4.N and 3.5.N of Octave=<br />
<br />
The 3.4.N series has enough new features to justify a minor version number change. The full details are in the NEWS file, but in brief 3.4.N series brings:<br />
<br />
* ARPACK now distributed with Octave<br />
* Indexing optimisations<br />
* FTP object using libcurl<br />
* Better consistency with ismatrix, issquare, and issymetric<br />
* Function handles aware of overloaded functions<br />
* More efficient matrix division by making a single LAPACK call<br />
* Other optimisations in matrix operations<br />
* bsxfun optimised for basic arithmetic functions<br />
* Matlab-style ignoring of output arguments using <tt>~</tt><br />
* Many optimisations of the accumarray function<br />
* Sparse matrix indexing has been rewritten for speed<br />
* Configuration pseudo-variables like page_screen_output accept a "local" option argument to limit their scope to function scope<br />
* The pkg command now accepts a -forge option to pull packages directly from Octave-forge<br />
* Several dlmread improvements<br />
* Octave now uses gnulib for better cross-platform compatibility<br />
<br />
Here are some features that have been around since 3.2.N<br />
<br />
* integer types<br />
* fixed point arithmetic<br />
* sparse matrices<br />
* linear programming code based on GLPK<br />
* 64-bit compilation support<br />
* gzipped files and stream and consequently support of Matlab v7 files<br />
* better support for both msvc and mingw<br />
* a fully compatible MEX interface<br />
* many many other minor features and compatibility changes<br />
* an experimental OpenGL graphics toolkit to replace gnuplot<br />
* object orient programming<br />
* block comments<br />
* imwrite and imread (based on the GraphicsMagick library)<br />
* Lazy transpose <br/> Special treatment in the parser of things like "a' * b", where the transpose is never explicitly formed but a flag is rather passed to the underlying LAPACK code.<br />
* Single precision type<br />
* Improved array indexing <br/> The underlying code used for indexing of arrays has been completely rewritten and so the indexing of arrays is now significantly faster.<br />
<br />
Here are some older features that have been around since 2.1.N:<br />
<br />
* NDArrays<br />
* cells<br />
<br />
The 3.5.N series is the current development release and will become a 3.6.N release in the future. This series brings the following new features:<br />
<br />
* Perl compatible regular expressions<br />
* a profiler<br />
* broadcasting enabled for all built-in binary elementwise operators<br />
<br />
=Coding=<br />
<br />
==What features are unique to Octave?==<br />
<br />
Although most of the Octave language will be familiar to Matlab users, it has some unique features of its own.<br />
<br />
=== Functions defined on the command-line===<br />
Functions can be defined by entering code on the command line, a feature not supported by Matlab. For example, you may type:<br />
<br />
octave:1> function s = hello_string (to_who)<br />
> ## Say hello<br />
> if nargin<1, to_who = "World"; end<br />
> s = ["Hello ",\<br />
> to_who];<br />
> endfunction<br />
octave:2> hello_string ("Moon")<br />
ans = Hello Moon<br />
<br />
===Comments with #===<br />
<br />
The pound character, <tt>#</tt>, may be used to start comments, in addition to <tt>%</tt>. See the previous example. The major advantage of this is that as <tt>#</tt> is also a comment character for unix script files, any file that starts with a string like <tt>#! /usr/bin/octave -q</tt> will be treated as an octave script and be executed by octave.<br />
<br />
===Strings delimited by double quotes "===<br />
<br />
The double quote, <tt>"</tt>, may be used to delimit strings, in addition to the single quote <tt>'</tt>. See the previous example. Also, double-quoted strings include backslash interpretation (like C++, C, and Perl) while single quoted are uninterpreted (like Matlab and Perl).<br />
<br />
===Line continuation by backslash===<br />
<br />
Lines can be continued with a backslash, <tt>\</tt>, in addition to three points <tt>...</tt>. See the previous example.<br />
<br />
===Informative block closing===<br />
<br />
You may close function, for, while, if, ... blocks with endfunction, endfor, endwhile, ... keywords in addition to using end. As with Matlab, the end (or endfunction) keyword that marks the end of a function defined in a .m file is optional.<br />
<br />
===Coherent syntax===<br />
<br />
Indexing other things than variables is possible, as in:<br />
<br />
octave:1> [3 1 4 1 5 9](3)<br />
ans = 4<br />
octave:2> cos([0 pi pi/4 7])(3)<br />
ans = 0.70711<br />
<br />
In Matlab, it is for example necessary to assign the intermediate result <tt>cos([0 pi pi/4 7])</tt> to a variable before it can be indexed again.<br />
<br />
===Exclamation mark as not operator===<br />
<br />
The exclamation mark <tt>!</tt> (aka “Bang!”) is a negation operator, just like the tilde <tt>~</tt>:<br />
<br />
octave:1> if ! strcmp (program_name, "octave"),<br />
> "It's an error"<br />
> else<br />
> "It works!"<br />
> end<br />
ans = It works!<br />
Note however that Matlab uses the <tt>!</tt> operator for shell escapes, for which Octave requires using the system command.<br />
<br />
===Increment and decrement operators===<br />
<br />
If you like the <tt>++</tt>, <tt>+=</tt> etc operators, rejoice! Octave includes the C-like increment and decrement operators <tt>++</tt> and <tt>--</tt> in both their prefix and postfix forms, in addition to <tt>+=</tt>, <tt>-=</tt>, <tt>*=</tt>, <tt>/=</tt>, <tt>^=</tt>, <tt>.*=</tt>, <tt>./=</tt>, and <tt>.^=</tt>.<br />
<br />
For example, to pre-increment the variable x, you would write ++x. This would add one to x and then return the new value of x as the result of the expression. It is exactly the same as the expression x = x + 1.<br />
<br />
To post-increment a variable x, you would write x++. This adds one to the variable x, but returns the value that x had prior to incrementing it. For example, if x is equal to 2, the result of the expression x++ is 2, and the new value of x is 3.<br />
<br />
For matrix and vector arguments, the increment and decrement operators work on each element of the operand.<br />
<br />
===Unwind-protect===<br />
<br />
Octave supports a limited form of exception handling modeled after the unwind-protect form of Lisp. The general form of an unwind_protect block looks like this:<br />
<br />
unwind_protect<br />
body<br />
unwind_protect_cleanup<br />
cleanup<br />
end_unwind_protect<br />
<br />
Where body and cleanup are both optional and may contain any Octave expressions or commands. The statements in cleanup are guaranteed to be executed regardless of how control exits body.<br />
<br />
The unwind_protect statement is often used to reliably restore the values of global variables that need to be temporarily changed.<br />
<br />
Matlab can be made to do something similar with their <tt>OnCleanUp</tt> function that was introduced in 2008a. Octave also has <tt>onCleanup</tt> since version 3.4.0.<br />
<br />
===Built-in ODE and DAE solvers===<br />
<br />
Octave includes LSODE and DASSL for solving systems of stiff ordinary differential and differential-algebraic equations. These functions are built in to the interpreter.<br />
<br />
=What documentation exists for Octave?=<br />
<br />
Besides the current wiki, there are other important sources of documentation and help for Octave.<br />
<br />
==What documentation exists for Octave?==<br />
<br />
The Octave distribution includes a 650+ page manual that is also distributed under the terms of the GNU GPL. It is available on the web at http://www.octave.org/docs.html and you will also find there instructions on how to order a paper version.<br />
<br />
The complete text of the Octave manual is also available using the GNU Info system via the GNU Emacs, info, or xinfo programs, or by using the <tt>doc</tt> command to start the GNU info browser directly from the Octave prompt.<br />
<br />
If you have problems using this documentation, or find that some topic is not adequately explained, indexed, or cross-referenced, please report it on http://bugs.octave.org.<br />
<br />
==Getting additional help==<br />
<br />
If you can't find an answer to your question, the help@octave.org mailing list is available for questions related to using, installing, and porting Octave that are not adequately answered by the Octave manual or by this document.<br />
<br />
==User community==<br />
<br />
To subscribe to the list, go to http://www.octave.org/archive.html and follow the link to the subscription page for the list.<br />
<br />
Please do not send requests to be added or removed from the mailing list, or other administrative trivia to the list itself.<br />
<br />
An archive of old postings to the help-octave mailing list is maintained on http://www.octave.org/archive.html.<br />
<br />
You will also find some user advice and code spread over the web. Good starting points are the Octave Wiki http://wiki.octave.org and Octave-Forge http://octave.sourceforge.net<br />
<br />
We also have [http://www.octave.org/chat.html an IRC chat room].<br />
<br />
==I think I have found a bug in Octave.==<br />
<br />
“I think I have found a bug in Octave, but I'm not sure. How do I know, and who should I tell?”<br />
<br />
First, see the section [http://www.octave.org/bugs.html on bugs and bug reports in the Octave manual]. When you report a bug, make sure to describe the type of computer you are using, the version of the operating system it is running, and the version of Octave that you are using. Also provide enough code and configuration details of your operating system so that the Octave maintainers can duplicate your bug.<br />
<br />
=How can I obtain Octave?=<br />
<br />
==Source code==<br />
<br />
Source code is available on the Octave development site, where you are sure to get the latest version.<br />
<br />
* http://www.octave.org/download.html<br />
* ftp://ftp.octave.org/pub/octave/<br />
<br />
Since Octave is distributed under the terms of the GPL, you can get Octave from a friend who has a copy, or from the Octave website.<br />
<br />
==Pre-compiled binary packages==<br />
<br />
The Octave project does not distribute binary packages, but other projects do. For an up-to-date listing of packagers, see:<br />
<br />
* http://www.octave.org/download.html<br />
* [[Compile From Source]]<br />
<br />
As of today, Octave binaries are available at least on Debian, Ubuntu, RedHat, Suse and Fedora GNU/Linuxen, Mac OS X, Windows' 98, 2000 and XP, Vista, and 7.<br />
<br />
==How do I get a copy of Octave for (some other platform)?==<br />
<br />
Octave currently runs on Unix-like systems, Mac OS X, and Windows. It should be possible to make Octave work on other systems as well. If you are interested in porting Octave to other systems, please contact [mailto:maintainers@octave.org the maintainers' mailing list].<br />
<br />
=Installation Issues and Problems= <br />
<br />
Octave 3.4 requires approximately 1.3 GB of disk storage to unpack and compile from source (considerably less if you don't compile with debugging symbols). Once installed, Octave requires approximately 355 MB of disk space (again, considerably less if you don't compile with debugging symbols, approximately 50 MB).<br />
<br />
==What else do I need?==<br />
<br />
To compile Octave, you will need a recent version of GNU Make. You will also need GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
'''You must have GNU Make to compile octave'''. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install.<br />
<br />
==Can I compile Octave with another C++ compiler?==<br />
<br />
Yes, but development is done primarily with GCC, so you may hit some incompatibilities. Octave is intended to be portable to any standard conforming compiler. If you have difficulties that you think are bugs, please report them to the http://bugs.octave.org bug tracker, or ask for help on the [mailto:help@octave.org mailing list].<br />
<br />
==How does Octave solve linear systems?==<br />
<br />
In addition to consulting Octave's source for the precise details, the Octave manual contains a complete high-level description of the algorithm that Octave uses to decide how to solve a particular linear system, e.g. how the backslash operator A\x will be interpreted. Sections “Techniques Used for Linear Algebra” and “Linear Algebra on Sparse Matrices” from the manual describe this procedure.<br />
<br />
=How do I...?=<br />
<br />
==How do I erase a figure?== <br />
<br />
closeplot(); <br />
closefig(number)<br />
<br />
==How do I set the number of displayed decimals?==<br />
<br />
octave:1> format long<br />
octave:2> pi<br />
pi = 3.14159265358979<br />
octave:3> format short<br />
octave:4> pi<br />
pi = 3.1416<br />
<br />
==How do I vary the line thickness?==<br />
<br />
* There's plpot_octave, but the one in debian doesn't work for me.<br />
* Here's my octave hack for it--- http://gnufans.net/~deego/pub/octave/plot_width.m This one simply draws the line multiple times.<br />
* You can edit the .eps file manually or using sed and awk.<br />
* Export the graph as fig file (gset term fig thickness 2). This also allows for easy postediting with xfig and export to formats not supported by gnuplot.<br />
* The gplot command of octave does not support gnuplot's linewidth parameter Thus you must use the graw() function for sending this option directly to gnuplot, eg. <br />
graw('replot "" notitle with lines lw 4\n');<br />
*Search the [http://octave.1599824.n4.nabble.com/ octave archives] for more.<br />
<br />
==How do I call an octave function from C++?==<br />
<br />
*Here is an untested code snippet for calling rand([9000,1]), modified from a post by HerberFarnsworth? to help-octave on 2003-05-01:<br />
<br />
#include <octave/oct.h><br />
...<br />
ColumnVector NumRands(2);<br />
NumRands(0) = 9000;<br />
NumRands(1) = 1;<br />
octave_value_list f_arg, f_ret;<br />
f_arg(0) = octave_value(NumRands);<br />
f_ret = feval("rand",f_arg,1);<br />
Matrix unis(f_ret(0).matrix_value());<br />
<br />
==How do I create a full semilog/log grid==<br />
<br />
gset grid mxtics mytics<br />
gset grid lw 2, lw 0.1<br />
grid("on");<br />
<br />
One can use postscript enhancement for proper axis<br />
gset format x "10^{%%L}"<br />
or<br />
gset format y "10^{%%L}" <br />
<br />
==How do I change colour/line definition in gnuplot postscript?==<br />
Here is a awk script to get a rainbow colour map<br />
<br />
#!/bin/awk -f<br />
<br />
BEGIN {<br />
split("0 4 6 7 5 3 1 2 8", rainbow, " ");<br />
split("7 3 1 0 2 4 6 5 8", invraim, " ");<br />
}<br />
<br />
$1 ~ /\/LT[0-8]/ {<br />
n = substr($1, 4, 1);<br />
if (n == 0)<br />
lt = "{ PL [] 0.9 0.1 0.1 DL } def";<br />
else if (n == 1)<br />
lt = "{ PL [4 dl 2 dl] 0.1 .75 0.1 DL } def";<br />
else if (n == 2)<br />
lt = "{ PL [2 dl 3 dl] 0.1 0.1 0.9 DL } def";<br />
else if (n == 3)<br />
lt = "{ PL [1 dl 1.5 dl] 0.9 0 0.8 DL } def";<br />
else if (n == 4)<br />
lt = "{ PL [5 dl 2 dl 1 dl 2 dl] 0.1 0.8 0.8 DL } def";<br />
else if (n == 5)<br />
lt = "{ PL [4 dl 3 dl 1 dl 3 dl] 0.9 0.8 0.2 DL } def";<br />
else if (n == 6)<br />
lt = "{ PL [2 dl 2 dl 2 dl 4 dl] 0.5 0.3 0.1 DL } def";<br />
else if (n == 7)<br />
lt = "{ PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.4 0 DL } def";<br />
else if (n == 8)<br />
lt = "{ PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def";<br />
$0 = sprintf("/LT%d %s", rainbow[n+1], lt);<br />
##$0 = sprintf("/LT%x %s", invraim[n+1], lt);<br />
##$0 = sprintf("/LT%x %s", n, lt);<br />
}<br />
<br />
{ print; }<br />
<br />
==How do I tell if a file exists?==<br />
<br />
Look at functions like exist, file_in_path.. and the other functions that their descriptions point to.<br />
<br />
<br />
==How do I create a plot without a window popping up (ie, a plot to a file)?==<br />
<br />
figure(1, "visible", "off");<br />
plot(sin(1:100));<br />
print -deps "/tmp/sin.eps"<br />
<br />
One can set that behaviour as default:<br />
<br />
set(0, 'defaultfigurevisible', 'off');<br />
<br />
<br />
=Common problems=<br />
<br />
==How do I get sound output in Windows?== <br />
See http://www.octave.org/octave-lists/archive/help-octave.2003/msg01567.html for a start.<br />
<br />
==Why does Octave segfault when using "clear all;"?==<br />
<br />
This is a known problem if you have one of the following packages loaded:<br />
<br />
* ann<br />
* database<br />
* ftp <br />
<br />
See http://www.nabble.com/Segmentation-Fault---Clear-all-td21998563.html for a discussion<br />
<br />
==Octave takes a long time to find symbols.==<br />
<br />
Octave uses the genpath function to recursively add directories to the list of directories searched for function files. Check the list of directories with the path command. If the path list is very long check your use of the genpath function.<br />
<br />
==When plotting Octave occasionally gives me errors like <tt>gnuplot> 9 0.735604 line 26317: invalid command</tt>.==<br />
There is a known bug in gnuplot 4.2 that can cause an off by one error while piping data to gnuplot. It has been fixed in gnuplot 4.4.<br />
<br />
If you have obtained your copy of Octave from a distribution please file a bug report requesting that the fix reported in the above bug report be included.<br />
<br />
==I cannot install a package. Octave complains about a missing mkoctfile.==<br />
<br />
Most distributions split Octave into several packages. The script mkoctfile is then part of a separate package:<br />
<br />
* Debian/Ubuntu<br/><br />
<tt>aptitude install octave-headers</tt><br />
<br />
* Fedora<br/><br />
<tt>yum install octave-devel</tt><br />
<br />
=Porting programs from Matlab to Octave=<br />
<br />
People often ask<br />
<br />
<blockquote><br />
I wrote some code for Matlab, and I want to get it running under Octave. Is there anything I should watch out for?<br />
</blockquote><br />
<br />
or alternatively<br />
<br />
<blockquote><br />
I wrote some code in Octave, and want to share it with Matlab users. Is there anything I should watch out for?<br />
</blockquote><br />
<br />
which is not quite the same thing. There are still a number of differences between Octave and Matlab, however in general differences between the two are considered as bugs. Octave might consider that the bug is in Matlab and do nothing about it, but generally functionality is almost identical. If you find a difference between Octave behavior and Matlab, then you should send a description of this difference (with code illustrating the difference, if possible) to http://bugs.octave.org.<br />
<br />
Furthermore, Octave adds a few syntactical extensions to Matlab that might cause some issues when exchanging files between Matlab and Octave users. As both Octave and Matlab are under constant development the information in this section is subject to change at anytime.<br />
<br />
You should also look at the page http://octave.sourceforge.net/packages.html and http://octave.sourceforge.net/doc/ that has a function reference that is up to date. You can use this function reference to see the number of octave function that are available and their Matlab compatibility.<br />
<br />
The major differences between Octave 3.4.N and Matlab R2010b are:<br />
<br />
==Nested Functions==<br />
Octave has limited support for nested functions. That is<br />
<br />
function y = foo (x)<br />
y = bar(x)<br />
function y = bar (x)<br />
y = ...;<br />
end<br />
end<br />
<br />
is equivalent to<br />
<br />
function y = foo (x)<br />
y = bar(x)<br />
end<br />
function y = bar (x)<br />
y = ...;<br />
end<br />
<br />
The main difference with Matlab is a matter of scope. While nested functions have access to the parent function's scope in Matlab, no such thing is available in Octave, due to how Octave essentially “un-nests” nested functions.<br />
<br />
The authors of Octave consider the nested function scoping rules of Matlab to be more problems than they are worth as they introduce difficult to find bugs as inadvertently modifying a variable in a nested function that is also used in the parent is particularly easy.<br />
<br />
==Differences in core syntax==<br />
<br />
There a few core Matlab syntaxes that are not accepted by Octave, these being<br />
<br />
* Some limitations on the use of function handles. The major difference is related to nested function scoping rules (as above) and their use with function handles.<br />
<br />
* Some limitations of variable argument lists on the LHS of an expression, though the most common types are accepted.<br />
<br />
* Matlab classdef object oriented programming is not yet supported, though work is underway and when development more on to Octave 3.5 this will be included in the development tree.<br />
<br />
==Differences in core functions==<br />
<br />
A large number of the Matlab core functions (ie those that are in the core and not a toolbox) are implemented, and certainly all of the commonly used ones. There are a few functions that aren't implemented, usually to do with specific missing Octave functionality (GUI, DLL, Java, ActiveX, DDE, web, and serial functions). Some of the core functions have limitations that aren't in the Matlab version. For example the sprandn function can not force a particular condition number for the matrix like Matlab can.<br />
<br />
==Just-In-Time compiler==<br />
<br />
Matlab includes a "Just-In-Time" compiler. This compiler allows the acceleration of for-loops in Matlab to almost native performance with certain restrictions. The JIT must know the return type of all functions called in the loops and so you can't include user functions in the loop of JIT optimized loops. Octave doesn't have a JIT and so to some might seem slower than Matlab. For this reason you must vectorize your code as much as possible. The MathWorks themselves have a good document discussing vectorization at http://www.mathworks.com/support/tech-notes/1100/1109.html.<br />
<br />
==Compiler==<br />
<br />
On a related point, there is no Octave compiler, and so you can't convert your Octave code into a binary for additional speed or distribution. There have been several aborted attempts at creating an Octave compiler. Should the JIT compiler above ever be implemented, an Octave compiler should be more feasible.<br />
==Graphic Handles==<br />
<br />
Up to Octave 2.9.9 there was no support for graphic handles in Octave itself. In the 3.2.N versions of Octave and beyond the support for graphics handles is converging towards full compatibility. The patch function is currently limited to 2-D patches, due to an underlying limitation in gnuplot, but the experimental OpenGL backend is starting to see an implementation of 3-D patches.<br />
==GUI==<br />
<br />
There are no Matlab compatible GUI functions. There are a number of bindings from Octave to Tcl/Tk, VTK and Zenity included in the Octave Forge project (http://octave.sourceforge.net) for example that can be used for a GUI, but these are not Matlab compatible. Work on a Matlab compatible GUI is in an alpha stage in the QtHandles project. This might be an issue if you intend to exchange Octave code with Matlab users.<br />
<br />
==Simulink==<br />
<br />
Octave itself includes no Simulink support. Typically the simulink models lag research and are less flexible, so shouldn't really be used in a research environment. However, some Matlab users that try to use Octave complain about this lack. There is a similar package to simulink for the Octave and R projects available at http://www.scicraft.org/<br />
<br />
==Mex-Files==<br />
<br />
Octave includes an API to the Matlab MEX interface. However, as MEX is an API to the internals of Matlab and the internals of Octave differ from Matlab, there is necessarily a manipulation of the data to convert from a MEX interface to the Octave equivalent. This is notable for all complex matrices, where Matlab stores complex arrays as real and imaginary parts, whereas Octave respects the C99/C++ standards of co-locating the real/imag parts in memory. Also due to the way Matlab allows access to the arrays passed through a pointer, the MEX interface might require copies of arrays (even non complex ones).<br />
==Block comments==<br />
<br />
Block comments denoted by "%{" and "%}" markers are supported by Octave with some limitations. The major limitation is that block comments are not supported within [] or {}.<br />
<br />
==Mat-File format==<br />
<br />
There are some differences in the mat v5 file format accepted by Octave. Matlab recently introduced the "-V7.3" save option which is an HDF5 format which is particularly useful for 64-bit platforms where the standard Matlab format can not correctly save variables. Octave accepts HDF5 files, but is not yet compatible with the "-v7.3" versions produced by Matlab.<br />
<br />
Although Octave can load inline function handles saved by Matlab, it can not yet save them.<br />
<br />
Finally, Some multi-byte Unicode characters aren't yet treated in mat-files.<br />
<br />
==Profiler==<br />
<br />
Octave doesn't have a profiler, but there is one in the 3.5 development version, thanks to Daniel Kraft's 2011 Google Summer of Code project. It should be released with 3.6.<br />
<br />
==Toolboxes==<br />
<br />
Octave is a community project and so the toolboxes that exist are donated by those interested in them through the Octave Forge website (http://octave.sourceforge.net). These might be lacking in certain functionality relative to the Matlab toolboxes, and might not exactly duplicate the Matlab functionality or interface.<br />
<br />
==Short-circuit & and | operators==<br />
<br />
The & and | operators in Matlab short-circuit when included in an if statement and not otherwise. In Octave only the && and || short circuit. Note that this means that<br />
<br />
if (a | b)<br />
...<br />
end<br />
<br />
and<br />
<br />
t = a | b;<br />
if t<br />
...<br />
end<br />
<br />
are different in Matlab. This is really a Matlab bug, but there is too much code out there that relies on this behaviour to change it. Prefer the || and && operators in if statements if possible. If you need to use code written for Matlab that depends on this buggy behaviour, you can enable it since Octave 3.4.0 with the following command:<br />
<br />
do_braindead_shortcircuit_evaluation(1)<br />
<br />
Note that the difference with Matlab is also significant when either argument is a function with side effects or if the first argument is a scalar and the second argument is an empty matrix. For example, note the difference between<br />
<br />
t = 1 | []; ## results in [], so...<br />
if (t) 1, end ## in if ([]), this is false.<br />
<br />
and<br />
<br />
if (1 | []) 1, end ## short circuits so condition is<br />
<br />
true.<br />
Another case that is documented in the Matlab manuals is that<br />
<br />
t = [1, 1] | [1, 2, 3]; ## error<br />
if ([1, 1] | [1, 2, 3]) 1, end ## OK<br />
<br />
Also Matlab requires the operands of && and || to be scalar values but Octave does not (it just applies the rule that for an operand to be considered true, every element of the object must be nonzero or logically true).<br />
<br />
Finally, note the inconsistence of thinking of the condition of an if statement as being equivalent to all(X(:)) when X is a matrix. This is true for all cases EXCEPT empty matrices:<br />
<br />
if ([0, 1]) == if (all ([0, 1])) ==> i.e., condition is false.<br />
if ([1, 1]) == if (all ([1, 1])) ==> i.e., condition is true.<br />
<br />
However,<br />
<br />
if ([]) != if (all ([]))<br />
<br />
because samp ([]) == 1 because, despite the name, it is really returning true if none of the elements of the matrix are zero, and since there are no elements, well, none of them are zero. This is an example of vacuous truth. But, somewhere along the line, someone decided that if ([]) should be false. Mathworks probably thought it just looks wrong to have [] be true in this context even if you can use logical gymnastics to convince yourself that "all" the elements of a matrix that doesn't actually have any elements are nonzero. Octave however duplicates this behavior for if statements containing empty matrices.<br />
<br />
==Solvers for singular, under- and over-determined matrices==<br />
<br />
Matlab's solvers as used by the operators mldivide (\) and mrdivide (/), use a different approach than Octave's in the case of singular, under-, or over-determined matrices. In the case of a singular matrix, Matlab returns the result given by the LU decomposition, even though the underlying solver has flagged the result as erroneous. Octave has made the choice of falling back to a minimum norm solution of matrices that have been flagged as singular which arguably is a better result for these cases.<br />
<br />
In the case of under- or over-determined matrices, Octave continues to use a minimum norm solution, whereas Matlab uses an approach that is equivalent to<br />
<br />
function x = mldivide (A, b)<br />
[Q, R, E] = qr(A);<br />
x = [A \ b, E(:, 1:m) * (R(:, 1:m) \ (Q' * b))]<br />
end<br />
<br />
While this approach is certainly faster and uses less memory than Octave's minimum norm approach, this approach seems to be inferior in other ways.<br />
<br />
A numerical question arises: how big can the null space component become, relative to the minimum-norm solution? Can it be nicely bounded, or can it be arbitrarily big? Consider this example:<br />
<br />
m = 10;<br />
n = 10000;<br />
A = ones(m, n) + 1e-6 * randn(m,n);<br />
b = ones(m, 1) + 1e-6 * randn(m,1);<br />
norm(A \ b)<br />
<br />
while Octave's minimum-norm values are around 3e-2, Matlab's results are 50-times larger. For another issue, try this code:<br />
<br />
m = 5;<br />
n = 100;<br />
j = floor(m * rand(1, n)) + 1;<br />
b = ones(m, 1);<br />
A = zeros(m, n);<br />
A(sub2ind(size(A),j,1:n)) = 1;<br />
x = A \ b;<br />
[dummy,p] = sort(rand(1,n));<br />
y = A(:,p)\b;<br />
norm(x(p)-y)<br />
<br />
It shows that unlike in Octave, mldivide in Matlab is not invariant with respect to column permutations. If there are multiple columns of the same norm, permuting columns of the matrix gets you different result than permuting the solution vector. This will surprise many users.<br />
<br />
Since the mldivide (\) and mrdivide (/) operators are often part of a more complex expression, where there is no room to react to warnings or flags, it should prefer intelligence (robustness) to speed, and so the Octave developers are firmly of the opinion that Octave's approach for singular, under- and over-determined matrices is a better choice that Matlab's<br />
<br />
==Octave extensions==<br />
<br />
The extensions in Octave over Matlab syntax are very useful, but might cause issues when sharing with Matlab users. A list of the major extensions that should be avoided to be compatible with Matlab are<br />
Comments in octave can be marked with <tt>#</tt>. This allows POSIX systems to have the first line as <tt>#! octave -q</tt> and mark the script itself executable. Matlab doesn't have this feature due to the absence of comments starting with <tt>#</tt>".<br />
<br />
Code blocks like if, for, while, etc can be terminated with block specific terminations like endif. Matlab doesn't have this and all blocks must be terminated with end.<br />
<br />
Octave has a lisp like unwind_protect block that allows blocks of code that terminate in an error to ensure that the variables that are touched are restored. You can do something similar with try/catch combined with <tt>rethrow (lasterror ())</tt> in Matlab, however rethrow and lasterror are only available in Octave 2.9.10 and later. Matlab 2008a also introduced OnCleanUp that is similar to unwind_protect, except that the object created by this function has to be explicitly cleared in order for the cleanup code to run.<br />
<br />
Note that using try/catch combined with <tt>rethrow (lasterror ())</tt> can not guarantee that global variables will be correctly reset, as it won't catch user interrupts with Ctrl-C. For example<br />
<br />
global a<br />
a = 1;<br />
try<br />
_a = a;<br />
a = 2<br />
while true<br />
end<br />
catch<br />
fprintf ('caught interrupt\n');<br />
a = _a;<br />
rethrow (lasterror());<br />
end<br />
<br />
compared to<br />
<br />
global a<br />
a = 1;<br />
unwind_protect<br />
_a = a;<br />
a = 2<br />
while true<br />
end<br />
unwind_protect_cleanup<br />
fprintf ('caught interrupt\n');<br />
a = _a;<br />
end<br />
<br />
Typing Ctrl-C in the first case returns the user directly to the prompt, and the variable "a" is not reset to the saved value. In the second case the variable "a" is reset correctly. Therefore Matlab gives no safe way of temporarily changing global variables.<br />
<br />
Indexing can be applied to all objects in Octave and not just variable. Therefore sin(x)(1:10); for example is perfectly valid in Octave but not Matlab. To do the same in Matlab you must do y = sin(x); y = y([1:10]);<br />
<br />
Octave has the operators "++", "–", "-=", "+=", "*=", etc. As Matlab doesn't, if you are sharing code these should be avoided.<br />
Character strings in Octave can be denoted with double or single quotes. There is a subtle difference between the two in that escaped characters like \n (newline), \t (tab), etc are interpreted in double quoted strings but not single quoted strings. This difference is important on Windows platforms where the "\" character is used in path names, and so single quoted strings should be used in paths. Matlab doesn't have double quoted strings and so they should be avoided if the code will be transferred to a Matlab user.</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=Build_from_source&diff=18Build from source2011-11-16T09:51:06Z<p>Crobar: Ported http://wiki.octave.org/wiki.pl?BuildFromSource from old wiki - page needs a lot of work</p>
<hr />
<div>Compiling from source is probably the most effective way of installing Octave on your system. To do this you will require compilers for the following languages:<br />
<br />
* C<br />
* C++ (ISO)<br />
* Fortran<br />
<br />
The best supported compilers for the job are the [http://gcc.gnu.org/ GNU Compiler Collection]. You will require at least GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
To compile Octave, you will also need a recent version of GNU Make. You must have GNU Make to compile octave. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install. <br />
<br />
==Required or Useful Tools==<br />
<br />
* autoconf<br />
* automake<br />
* GNU sed<br />
* GNU awk<br />
* GNU make<br />
* nm<br />
* flex<br />
* bison<br />
* less<br />
* gperf (if building from scratch)<br />
* perl (also if building from scratch) or python<br />
* gnuplot<br />
* texinfo<br />
* ghostscript<br />
* a TeX? distribution (if building the documentation)<br />
<br />
==Required or Useful Libraries==<br />
<br />
* readline<br />
* ncurses<br />
* zlib<br />
* A version of BLAS and LAPACK, e.g. Atlas<br />
* fftw<br />
* glpk<br />
* SuiteSparse? (without metis due to licensing issues): UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE<br />
* arpack (new GPL-conformant version)<br />
* qrupdate<br />
* hdf5<br />
* pcre<br />
* curl<br />
* qhull<br />
* fltk<br />
* libmagick++<br />
<br />
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with<br />
<br />
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \<br />
libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \<br />
libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev<br />
<br />
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net<br />
I also had to add a line #include "GL/glu.h" in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki><br />
<br />
==Download==<br />
<br />
Released source tarballs are available at [http://www.octave.org/download.html]. You will normally want to use one of those.<br />
<br />
The download page also contains instructions to download the development sources. If you are using the development sources, be sure to type the following command before configuring:<br />
<br />
./autogen.sh<br />
<br />
This builds the configure scripts that Octave uses. This requires a number of tools which are not needed if you download an octave release, such as recent versions of autoconf/automake, and tools such as bison, flex, gperf, perl, and maybe others.<br />
<br />
=Configure=<br />
<br />
Octave has many configure options. For a complete list, see<br />
<br />
./configure --help<br />
<br />
By default octave compiles as a static binary which cannot be extended with separately compiled C, C++, or Fortran functions such as those provided with OctaveForge (you might get an error like "ld: fatal: relocations remain against allocatable but non-writable sections" when compiling OctaveForge). For that you will need to configure octave with<br />
<br />
./configure --enable-shared --disable-static<br />
<br />
The <nowiki>--disable-static</nowiki> option is not necessary, but it will make your compile faster.<br />
<br />
If you are building a personal version, you will want to install it into your home directory, or perhaps a subdirectory. Add the following to your configure line:<br />
<br />
--prefix=$HOME/octave<br />
<br />
Be sure the $HOME/octave/bin is on your path, or symlink the binaries therein to $HOME/bin.<br />
<br />
=Troubleshooting=<br />
<br />
1. If you just type ./configure, you may get this error:<br />
<br />
configure: WARNING: in order to build octave, you must have a compatible<br />
configure: WARNING: Fortran compiler or f2c installed and in your path.<br />
configure: error: See the file INSTALL for more information.<br />
<br />
This means that you don't have a fortran compiler on your system. You can either install a fortran compiler or re-install gcc with its optional build-in fortran compiler g77. To do this you must download the g77 components of gcc before you build gcc. Alternatively there are various f2c programs you could install which convert fortran to C.<br />
<br />
2. If you get this warning:<br />
<br />
configure: WARNING: "FTGL headers not found. Native renderer will not have on-screen text"<br />
configure: WARNING:<br />
configure: WARNING: I didn't find the necessary libraries to compile native<br />
configure: WARNING: graphics. It isn't necessary to have native graphics<br />
configure: WARNING: but you will have to use gnuplot or you won't be able<br />
configure: WARNING: to use any of Octave's plotting commands<br />
<br />
It may help to call configure with CPPFLAGS=-I/usr/include/freetype2, please see [http://www-old.cae.wisc.edu/pipermail/help-octave/2008-August/010610.html [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-September/008620.html Problems with FTGL building octave-3.1.51],[Building ftgl backend with current tip]. Note that from [http://hg.savannah.gnu.org/hgweb/octave/rev/37afdd1d1bf8 changeset 8269] onward, this workaround should no longer be needed, please see [http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009154.html No FTGL, says configure script?]<br />
<br />
=Build=<br />
<br />
make<br />
<br />
=Troubleshooting= <br />
<br />
Another possible error occurs at the 'make' stage:<br />
<br />
/usr/include/c++/3.3.1/bits/basic_string.h:228: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'<br />
collect2: ld returned 1 exit status<br />
make[2]: *** [octave] Error 1<br />
<br />
This has something to do with the gcc configuration. Try compiling the following program using g++:<br />
<br />
#include <string><br />
#include <iostream><br />
using namespace std;<br />
int main (void)<br />
{<br />
basic_string <char>a = "thing one";<br />
string b = "thing two";<br />
cout << a.c_str() << endl;<br />
return (a == b);<br />
}<br />
<br />
If it fails, then your compiler needs to be set-up differently (how?). On my machine I can compile that test program but still get the error making Octave -- how do we solve this? It has something to do with the shared C++ library versions, check for /usr/lib/libstdc++.so.6 and make sure the right version of that library is being used by gcc -- especially if you had to reinstall gcc to build the fortran support. If it still doesn't work, consider installing from the RPMs instead of compiling from source.<br />
<br />
=Test=<br />
<br />
To run all tests, change to the octave directory and type<br />
<br />
make check<br />
<br />
This requires dejagnu.<br />
<br />
To run a specific set of tests, change to the directory test/octave.test/<part> and type<br />
<br />
runtest <part>.exp<br />
<br />
To run your own tests use the [http://wiki.octave.org/wiki.pl? RunInPlace] shell script.<br />
<br />
=Install=<br />
<br />
make install<br />
<br />
----<br />
<br />
=System Specific Instructions=<br />
<br />
[http://wiki.octave.org/wiki.pl?PaulKienzleIrixConf SGI/IRIX PaulKienzleIrixConf]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForMac Mac OS X OctaveForMac]<br />
<br />
[http://wiki.octave.org/wiki.pl?OctaveForGNULinux#DebianDevelopmentSources Debian DebianDevelopmentSources]<br />
<br />
----<br />
<br />
=Distributed building=<br />
<br />
==Requirements==<br />
<br />
distcc<br />
ccache<br />
<br />
Install distcc on all machines taking part in the compilation. List them in <nowiki>~/.distcc/hosts</nowiki>:<br />
<br />
localhost<br />
pc1.mynet.org<br />
pc2.mynet.org<br />
<br />
The first machines listed are given higher priority -- place 'localhost' as you see fit.<br />
<br />
Set the environment variables CCACHE_PREFIX, CXX and CC:<br />
<br />
export CCACHE_PREFIX="distcc"<br />
export CXX="ccache g++"<br />
export CC="ccache gcc"<br />
./configure <options><br />
<br />
Compile using the <nowiki>-j<simultaneous-jobs></nowiki> flag, two jobs per CPU available, i.e. for 5 machines<br />
<br />
make -j10</div>Crobarhttps://wiki.octave.org/wiki/index.php?title=FAQ&diff=17FAQ2011-11-16T09:10:54Z<p>Crobar: /* Installation Issues and Problems */</p>
<hr />
<div>This is a list of frequently asked questions (FAQ) for Octave users.<br />
<br />
We are always looking for new questions (with answers), better answers, or both. Feel free to edit this page with your changes. If you have general questions about Octave, or need help for something that is not covered by the Octave manual or the FAQ, please use the help@octave.org mailing list.<br />
<br />
This FAQ is intended to supplement, not replace, the Octave manual. Before posting a question to the help@octave.org mailing list, you should first check to see if the topic is covered in the manual.<br />
<br />
=General=<br />
<br />
==What is Octave?==<br />
<br />
Octave is a high-level interactive language, primarily intended for numerical computations that is mostly compatible with Matlab.1<br />
<br />
Octave can do arithmetic for real, complex or integer-valued scalars and matrices, solve sets of nonlinear algebraic equations, integrate functions over finite and infinite intervals, and integrate systems of ordinary differential and differential-algebraic equations.<br />
<br />
Octave uses the GNU readline library to handle reading and editing input. By default, the line editing commands are similar to the cursor movement commands used by GNU Emacs, and a vi-style line editing interface is also available. At the end of each session, the command history is saved, so that commands entered during previous sessions are not lost.<br />
<br />
The Octave distribution includes a 650+ page Texinfo manual. Access to the complete text of the manual is available via the doc command at the Octave prompt.<br />
<br />
==Who uses Octave?==<br />
<br />
Lots of people. It seems that universities use it for research and teaching, companies of all sizes, for development, individuals. This question comes often on Octave mailing lists, see [[WhoUsesOctave]] for a few answers<br />
<br />
==Who develops Octave?==<br />
<br />
Discussions about writing the software that would eventually become Octave started in about 1988 with James B. Rawlings and John W. Eaton at the University of Texas. John W. Eaton was the original author of Octave, starting full-time development in February 1992. He is still the primary maintainer. The community of users/developers has in addition contributed some code and fuels the discussion on the mailing lists help@octave.org (user forum), maintainers@octave.org (development issues), and octave-dev@lists.sourceforge.net (all things related to the Octave Forge repository of user-contributed functions).<br />
<br />
==Why '''GNU''' Octave?==<br />
<br />
The GNU Project was launched in 1984 to develop a complete Unix-like operating system which is free software: the GNU system.<br />
<br />
GNU is a recursive acronym for “GNU's Not Unix”; it is pronounced guh-noo, approximately like canoe.<br />
<br />
The Free Software Foundation (FSF) is the principal organizational sponsor of the GNU Project.<br />
<br />
Octave became GNU Octave in 1997 (beginning with version 2.0.6). This meant agreeing to consider Octave a part of the GNU Project and support the efforts of the FSF. However, Octave is not and has never been developed by the FSF.<br />
<br />
For more information about the GNU project, see http://www.gnu.org.<br />
<br />
==What version should I use?==<br />
<br />
In general, you will find the latest version on http://www.octave.org/download.html. It is recommended to use the “stable” version of octave for general use, and the “development” version if you want the latest features.<br />
<br />
A list of user-visible changes since the last release is available in the file NEWS. The file ChangeLog in the source distribution contains<br />
a more detailed record of changes made since the last release.<br />
<br />
==On what platforms does Octave run?==<br />
<br />
Octave runs on various Unices—at least Linux and Solaris, Mac OS X, Windows and anything you can compile it on. Binary distributions exist at least for Debian, Suse, Fedora and RedHat Linuxes (Intel and AMD CPUs, at least), for Mac OS X and Windows' 98, 2000, XP, Vista, and 7.<br />
<br />
Two and three dimensional plotting is fully supported using gnuplot and an experimental OpenGL backend.<br />
<br />
The underlying numerical solvers are currently standard Fortran ones like LAPACK, LINPACK, ODEPACK, the BLAS, etc., packaged in a library of C++ classes. If possible, the Fortran subroutines are compiled with the system's Fortran compiler, and called directly from the C++ functions. If that's not possible, you can still compile Octave if you have the free Fortran to C translator f2c.<br />
<br />
Octave is also free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation, or at your option any later version.<br />
<br />
==How can I cite Octave?==<br />
<br />
Pointing to http://www.octave.org is good, because that gives people a direct way to find out more. If citation of a URL is not allowed by a publisher, or if you also want to point to a traditional reference, then you can cite the Octave manual:<br />
<br />
@BOOK{eaton:2008,<br />
author = "John W. Eaton, David Bateman, and Søren Hauberg",<br />
title = "GNU Octave Manual Version 3",<br />
publisher = "Network Theory Limited",<br />
year = "2008",<br />
isbn = "0-9546120-6-X"<br />
}<br />
<br />
=Licensing Issues=<br />
<br />
==If I write code using Octave do I have to release it under the GPL?==<br />
<br />
The answer depends on precisely how the code is written and how it works.<br />
<br />
Code written entirely in the scripting language of Octave (interpreted code in .m files) may be released under the terms of whatever license you choose.<br />
<br />
Code written using Octave's native plug-in interface (also known as a .oct file) necessarily links with Octave internals and is considered a derivative work of Octave and therefore must be released under terms that are compatible with the GPL.<br />
<br />
Code written using Octave's implementation of the Matlab MEX interface may be released under the terms of whatever license you choose, provided that the following conditions are met:<br />
<br />
# The plugin should not use any bindings that are specific to Octave. In other words, the MEX file must use the MEX interface only, and not also call on other Octave internals. It should be possible in principle to use the MEX file with other programs that implement the MEX interface (e.g., Matlab).<br />
# The MEX file should not be distributed together with Octave in such a way that they effectively create a single work. For example, you should not distribute the MEX file and Octave together in a single package such that Octave automatically loads and runs the MEX file when it starts up. There are other possible ways that you might effectively create a single work; this is just one example.<br />
<br />
A program that embeds the Octave interpreter (e.g., by calling the "octave_main" function), or that calls functions from Octave's libraries (e.g., liboctinterp, liboctave, or libcruft) is considered a derivative work of Octave and therefore must be released under terms that are compatible with the GPL.<br />
<br />
==Since the MEX interface allows plugins to be distributed under terms that are incompatible with the GPL, does this mean that you are encouraging people to to write non-free software for Octave?==<br />
<br />
No. The original reason for implementing the MEX interface for Octave was to allow Octave to run free software that uses MEX files (the particular goal was to run SundialsTB in Octave). The intent was to liberate that software from Matlab and increase the amount of free software available to Octave users, not to enable people to write proprietary code for Octave. For the good of the community, we strongly encourage users of Octave to release the code they write for Octave under terms that are compatible with the GPL.<br />
<br />
==I wrote a program that links with Octave libraries and I don't want to release it under the terms of the GPL. Will you change the license of the Octave libraries for me?==<br />
<br />
No. Instead of asking us to change the licensing terms for Octave, we recommend that you release your program under terms that are compatible with the GPL so that the free software community can benefit from your work the same as you have benefited from the work of all the people who have contributed to Octave.<br />
<br />
=What's new in version series 3.4.N and 3.5.N of Octave=<br />
<br />
The 3.4.N series has enough new features to justify a minor version number change. The full details are in the NEWS file, but in brief 3.4.N series brings:<br />
<br />
* ARPACK now distributed with Octave<br />
* Indexing optimisations<br />
* FTP object using libcurl<br />
* Better consistency with ismatrix, issquare, and issymetric<br />
* Function handles aware of overloaded functions<br />
* More efficient matrix division by making a single LAPACK call<br />
* Other optimisations in matrix operations<br />
* bsxfun optimised for basic arithmetic functions<br />
* Matlab-style ignoring of output arguments using <tt>~</tt><br />
* Many optimisations of the accumarray function<br />
* Sparse matrix indexing has been rewritten for speed<br />
* Configuration pseudo-variables like page_screen_output accept a "local" option argument to limit their scope to function scope<br />
* The pkg command now accepts a -forge option to pull packages directly from Octave-forge<br />
* Several dlmread improvements<br />
* Octave now uses gnulib for better cross-platform compatibility<br />
<br />
Here are some features that have been around since 3.2.N<br />
<br />
* integer types<br />
* fixed point arithmetic<br />
* sparse matrices<br />
* linear programming code based on GLPK<br />
* 64-bit compilation support<br />
* gzipped files and stream and consequently support of Matlab v7 files<br />
* better support for both msvc and mingw<br />
* a fully compatible MEX interface<br />
* many many other minor features and compatibility changes<br />
* an experimental OpenGL graphics toolkit to replace gnuplot<br />
* object orient programming<br />
* block comments<br />
* imwrite and imread (based on the GraphicsMagick library)<br />
* Lazy transpose <br/> Special treatment in the parser of things like "a' * b", where the transpose is never explicitly formed but a flag is rather passed to the underlying LAPACK code.<br />
* Single precision type<br />
* Improved array indexing <br/> The underlying code used for indexing of arrays has been completely rewritten and so the indexing of arrays is now significantly faster.<br />
<br />
Here are some older features that have been around since 2.1.N:<br />
<br />
* NDArrays<br />
* cells<br />
<br />
The 3.5.N series is the current development release and will become a 3.6.N release in the future. This series brings the following new features:<br />
<br />
* Perl compatible regular expressions<br />
* a profiler<br />
* broadcasting enabled for all built-in binary elementwise operators<br />
<br />
=Coding=<br />
<br />
==What features are unique to Octave?==<br />
<br />
Although most of the Octave language will be familiar to Matlab users, it has some unique features of its own.<br />
<br />
=== Functions defined on the command-line===<br />
Functions can be defined by entering code on the command line, a feature not supported by Matlab. For example, you may type:<br />
<br />
octave:1> function s = hello_string (to_who)<br />
> ## Say hello<br />
> if nargin<1, to_who = "World"; end<br />
> s = ["Hello ",\<br />
> to_who];<br />
> endfunction<br />
octave:2> hello_string ("Moon")<br />
ans = Hello Moon<br />
<br />
===Comments with #===<br />
<br />
The pound character, <tt>#</tt>, may be used to start comments, in addition to <tt>%</tt>. See the previous example. The major advantage of this is that as <tt>#</tt> is also a comment character for unix script files, any file that starts with a string like <tt>#! /usr/bin/octave -q</tt> will be treated as an octave script and be executed by octave.<br />
<br />
===Strings delimited by double quotes "===<br />
<br />
The double quote, <tt>"</tt>, may be used to delimit strings, in addition to the single quote <tt>'</tt>. See the previous example. Also, double-quoted strings include backslash interpretation (like C++, C, and Perl) while single quoted are uninterpreted (like Matlab and Perl).<br />
<br />
===Line continuation by backslash===<br />
<br />
Lines can be continued with a backslash, <tt>\</tt>, in addition to three points <tt>...</tt>. See the previous example.<br />
<br />
===Informative block closing===<br />
<br />
You may close function, for, while, if, ... blocks with endfunction, endfor, endwhile, ... keywords in addition to using end. As with Matlab, the end (or endfunction) keyword that marks the end of a function defined in a .m file is optional.<br />
<br />
===Coherent syntax===<br />
<br />
Indexing other things than variables is possible, as in:<br />
<br />
octave:1> [3 1 4 1 5 9](3)<br />
ans = 4<br />
octave:2> cos([0 pi pi/4 7])(3)<br />
ans = 0.70711<br />
<br />
In Matlab, it is for example necessary to assign the intermediate result <tt>cos([0 pi pi/4 7])</tt> to a variable before it can be indexed again.<br />
<br />
===Exclamation mark as not operator===<br />
<br />
The exclamation mark <tt>!</tt> (aka “Bang!”) is a negation operator, just like the tilde <tt>~</tt>:<br />
<br />
octave:1> if ! strcmp (program_name, "octave"),<br />
> "It's an error"<br />
> else<br />
> "It works!"<br />
> end<br />
ans = It works!<br />
Note however that Matlab uses the <tt>!</tt> operator for shell escapes, for which Octave requires using the system command.<br />
<br />
===Increment and decrement operators===<br />
<br />
If you like the <tt>++</tt>, <tt>+=</tt> etc operators, rejoice! Octave includes the C-like increment and decrement operators <tt>++</tt> and <tt>--</tt> in both their prefix and postfix forms, in addition to <tt>+=</tt>, <tt>-=</tt>, <tt>*=</tt>, <tt>/=</tt>, <tt>^=</tt>, <tt>.*=</tt>, <tt>./=</tt>, and <tt>.^=</tt>.<br />
<br />
For example, to pre-increment the variable x, you would write ++x. This would add one to x and then return the new value of x as the result of the expression. It is exactly the same as the expression x = x + 1.<br />
<br />
To post-increment a variable x, you would write x++. This adds one to the variable x, but returns the value that x had prior to incrementing it. For example, if x is equal to 2, the result of the expression x++ is 2, and the new value of x is 3.<br />
<br />
For matrix and vector arguments, the increment and decrement operators work on each element of the operand.<br />
<br />
===Unwind-protect===<br />
<br />
Octave supports a limited form of exception handling modeled after the unwind-protect form of Lisp. The general form of an unwind_protect block looks like this:<br />
<br />
unwind_protect<br />
body<br />
unwind_protect_cleanup<br />
cleanup<br />
end_unwind_protect<br />
<br />
Where body and cleanup are both optional and may contain any Octave expressions or commands. The statements in cleanup are guaranteed to be executed regardless of how control exits body.<br />
<br />
The unwind_protect statement is often used to reliably restore the values of global variables that need to be temporarily changed.<br />
<br />
Matlab can be made to do something similar with their <tt>OnCleanUp</tt> function that was introduced in 2008a. Octave also has <tt>onCleanup</tt> since version 3.4.0.<br />
<br />
===Built-in ODE and DAE solvers===<br />
<br />
Octave includes LSODE and DASSL for solving systems of stiff ordinary differential and differential-algebraic equations. These functions are built in to the interpreter.<br />
<br />
=What documentation exists for Octave?=<br />
<br />
Besides the current wiki, there are other important sources of documentation and help for Octave.<br />
<br />
==What documentation exists for Octave?==<br />
<br />
The Octave distribution includes a 650+ page manual that is also distributed under the terms of the GNU GPL. It is available on the web at http://www.octave.org/docs.html and you will also find there instructions on how to order a paper version.<br />
<br />
The complete text of the Octave manual is also available using the GNU Info system via the GNU Emacs, info, or xinfo programs, or by using the <tt>doc</tt> command to start the GNU info browser directly from the Octave prompt.<br />
<br />
If you have problems using this documentation, or find that some topic is not adequately explained, indexed, or cross-referenced, please report it on http://bugs.octave.org.<br />
<br />
==Getting additional help==<br />
<br />
If you can't find an answer to your question, the help@octave.org mailing list is available for questions related to using, installing, and porting Octave that are not adequately answered by the Octave manual or by this document.<br />
<br />
==User community==<br />
<br />
To subscribe to the list, go to http://www.octave.org/archive.html and follow the link to the subscription page for the list.<br />
<br />
Please do not send requests to be added or removed from the mailing list, or other administrative trivia to the list itself.<br />
<br />
An archive of old postings to the help-octave mailing list is maintained on http://www.octave.org/archive.html.<br />
<br />
You will also find some user advice and code spread over the web. Good starting points are the Octave Wiki http://wiki.octave.org and Octave-Forge http://octave.sourceforge.net<br />
<br />
We also have [http://www.octave.org/chat.html an IRC chat room].<br />
<br />
==I think I have found a bug in Octave.==<br />
<br />
“I think I have found a bug in Octave, but I'm not sure. How do I know, and who should I tell?”<br />
<br />
First, see the section [http://www.octave.org/bugs.html on bugs and bug reports in the Octave manual]. When you report a bug, make sure to describe the type of computer you are using, the version of the operating system it is running, and the version of Octave that you are using. Also provide enough code and configuration details of your operating system so that the Octave maintainers can duplicate your bug.<br />
<br />
=How can I obtain Octave?=<br />
<br />
==Source code==<br />
<br />
Source code is available on the Octave development site, where you are sure to get the latest version.<br />
<br />
* http://www.octave.org/download.html<br />
* ftp://ftp.octave.org/pub/octave/<br />
<br />
Since Octave is distributed under the terms of the GPL, you can get Octave from a friend who has a copy, or from the Octave website.<br />
<br />
==Pre-compiled binary packages==<br />
<br />
The Octave project does not distribute binary packages, but other projects do. For an up-to-date listing of packagers, see:<br />
<br />
* http://www.octave.org/download.html<br />
* http://wiki.octave.org/wiki.pl?CategoryInstall<br />
<br />
As of today, Octave binaries are available at least on Debian, Ubuntu, RedHat, Suse and Fedora GNU/Linuxen, Mac OS X, Windows' 98, 2000 and XP, Vista, and 7.<br />
<br />
==How do I get a copy of Octave for (some other platform)?==<br />
<br />
Octave currently runs on Unix-like systems, Mac OS X, and Windows. It should be possible to make Octave work on other systems as well. If you are interested in porting Octave to other systems, please contact [mailto:maintainers@octave.org the maintainers' mailing list].<br />
<br />
=Installation Issues and Problems= <br />
<br />
Octave 3.4 requires approximately 1.3 GB of disk storage to unpack and compile from source (considerably less if you don't compile with debugging symbols). Once installed, Octave requires approximately 355 MB of disk space (again, considerably less if you don't compile with debugging symbols, approximately 50 MB).<br />
<br />
==What else do I need?==<br />
<br />
To compile Octave, you will need a recent version of GNU Make. You will also need GCC 4.3 or later, although GCC 4.4 or later is recommended.<br />
<br />
'''You must have GNU Make to compile octave'''. Octave's Makefiles use features of GNU Make that are not present in other versions of make. GNU Make is very portable and easy to install.<br />
<br />
==Can I compile Octave with another C++ compiler?==<br />
<br />
Yes, but development is done primarily with GCC, so you may hit some incompatibilities. Octave is intended to be portable to any standard conforming compiler. If you have difficulties that you think are bugs, please report them to the http://bugs.octave.org bug tracker, or ask for help on the [mailto:help@octave.org mailing list].<br />
<br />
==How does Octave solve linear systems?==<br />
<br />
In addition to consulting Octave's source for the precise details, the Octave manual contains a complete high-level description of the algorithm that Octave uses to decide how to solve a particular linear system, e.g. how the backslash operator A\x will be interpreted. Sections “Techniques Used for Linear Algebra” and “Linear Algebra on Sparse Matrices” from the manual describe this procedure.<br />
<br />
=How do I...?=<br />
<br />
==How do I erase a figure?== <br />
<br />
closeplot(); <br />
closefig(number)<br />
<br />
==How do I set the number of displayed decimals?==<br />
<br />
octave:1> format long<br />
octave:2> pi<br />
pi = 3.14159265358979<br />
octave:3> format short<br />
octave:4> pi<br />
pi = 3.1416<br />
<br />
==How do I vary the line thickness?==<br />
<br />
* There's plpot_octave, but the one in debian doesn't work for me.<br />
* Here's my octave hack for it--- http://gnufans.net/~deego/pub/octave/plot_width.m This one simply draws the line multiple times.<br />
* You can edit the .eps file manually or using sed and awk.<br />
* Export the graph as fig file (gset term fig thickness 2). This also allows for easy postediting with xfig and export to formats not supported by gnuplot.<br />
* The gplot command of octave does not support gnuplot's linewidth parameter Thus you must use the graw() function for sending this option directly to gnuplot, eg. <br />
graw('replot "" notitle with lines lw 4\n');<br />
*Search the [http://octave.1599824.n4.nabble.com/ octave archives] for more.<br />
<br />
==How do I call an octave function from C++?==<br />
<br />
*Here is an untested code snippet for calling rand([9000,1]), modified from a post by HerberFarnsworth? to help-octave on 2003-05-01:<br />
<br />
#include <octave/oct.h><br />
...<br />
ColumnVector NumRands(2);<br />
NumRands(0) = 9000;<br />
NumRands(1) = 1;<br />
octave_value_list f_arg, f_ret;<br />
f_arg(0) = octave_value(NumRands);<br />
f_ret = feval("rand",f_arg,1);<br />
Matrix unis(f_ret(0).matrix_value());<br />
<br />
==How do I create a full semilog/log grid==<br />
<br />
gset grid mxtics mytics<br />
gset grid lw 2, lw 0.1<br />
grid("on");<br />
<br />
One can use postscript enhancement for proper axis<br />
gset format x "10^{%%L}"<br />
or<br />
gset format y "10^{%%L}" <br />
<br />
==How do I change colour/line definition in gnuplot postscript?==<br />
Here is a awk script to get a rainbow colour map<br />
<br />
#!/bin/awk -f<br />
<br />
BEGIN {<br />
split("0 4 6 7 5 3 1 2 8", rainbow, " ");<br />
split("7 3 1 0 2 4 6 5 8", invraim, " ");<br />
}<br />
<br />
$1 ~ /\/LT[0-8]/ {<br />
n = substr($1, 4, 1);<br />
if (n == 0)<br />
lt = "{ PL [] 0.9 0.1 0.1 DL } def";<br />
else if (n == 1)<br />
lt = "{ PL [4 dl 2 dl] 0.1 .75 0.1 DL } def";<br />
else if (n == 2)<br />
lt = "{ PL [2 dl 3 dl] 0.1 0.1 0.9 DL } def";<br />
else if (n == 3)<br />
lt = "{ PL [1 dl 1.5 dl] 0.9 0 0.8 DL } def";<br />
else if (n == 4)<br />
lt = "{ PL [5 dl 2 dl 1 dl 2 dl] 0.1 0.8 0.8 DL } def";<br />
else if (n == 5)<br />
lt = "{ PL [4 dl 3 dl 1 dl 3 dl] 0.9 0.8 0.2 DL } def";<br />
else if (n == 6)<br />
lt = "{ PL [2 dl 2 dl 2 dl 4 dl] 0.5 0.3 0.1 DL } def";<br />
else if (n == 7)<br />
lt = "{ PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.4 0 DL } def";<br />
else if (n == 8)<br />
lt = "{ PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def";<br />
$0 = sprintf("/LT%d %s", rainbow[n+1], lt);<br />
##$0 = sprintf("/LT%x %s", invraim[n+1], lt);<br />
##$0 = sprintf("/LT%x %s", n, lt);<br />
}<br />
<br />
{ print; }<br />
<br />
==How do I tell if a file exists?==<br />
<br />
Look at functions like exist, file_in_path.. and the other functions that their descriptions point to.<br />
<br />
<br />
==How do I create a plot without a window popping up (ie, a plot to a file)?==<br />
<br />
figure(1, "visible", "off");<br />
plot(sin(1:100));<br />
print -deps "/tmp/sin.eps"<br />
<br />
One can set that behaviour as default:<br />
<br />
set(0, 'defaultfigurevisible', 'off');<br />
<br />
<br />
=Common problems=<br />
<br />
==How do I get sound output in Windows?== <br />
See http://www.octave.org/octave-lists/archive/help-octave.2003/msg01567.html for a start.<br />
<br />
==Why does Octave segfault when using "clear all;"?==<br />
<br />
This is a known problem if you have one of the following packages loaded:<br />
<br />
* ann<br />
* database<br />
* ftp <br />
<br />
See http://www.nabble.com/Segmentation-Fault---Clear-all-td21998563.html for a discussion<br />
<br />
==Octave takes a long time to find symbols.==<br />
<br />
Octave uses the genpath function to recursively add directories to the list of directories searched for function files. Check the list of directories with the path command. If the path list is very long check your use of the genpath function.<br />
<br />
==When plotting Octave occasionally gives me errors like <tt>gnuplot> 9 0.735604 line 26317: invalid command</tt>.==<br />
There is a known bug in gnuplot 4.2 that can cause an off by one error while piping data to gnuplot. It has been fixed in gnuplot 4.4.<br />
<br />
If you have obtained your copy of Octave from a distribution please file a bug report requesting that the fix reported in the above bug report be included.<br />
<br />
==I cannot install a package. Octave complains about a missing mkoctfile.==<br />
<br />
Most distributions split Octave into several packages. The script mkoctfile is then part of a separate package:<br />
<br />
* Debian/Ubuntu<br/><br />
<tt>aptitude install octave-headers</tt><br />
<br />
* Fedora<br/><br />
<tt>yum install octave-devel</tt><br />
<br />
=Porting programs from Matlab to Octave=<br />
<br />
People often ask<br />
<br />
<blockquote><br />
I wrote some code for Matlab, and I want to get it running under Octave. Is there anything I should watch out for?<br />
</blockquote><br />
<br />
or alternatively<br />
<br />
<blockquote><br />
I wrote some code in Octave, and want to share it with Matlab users. Is there anything I should watch out for?<br />
</blockquote><br />
<br />
which is not quite the same thing. There are still a number of differences between Octave and Matlab, however in general differences between the two are considered as bugs. Octave might consider that the bug is in Matlab and do nothing about it, but generally functionality is almost identical. If you find a difference between Octave behavior and Matlab, then you should send a description of this difference (with code illustrating the difference, if possible) to http://bugs.octave.org.<br />
<br />
Furthermore, Octave adds a few syntactical extensions to Matlab that might cause some issues when exchanging files between Matlab and Octave users. As both Octave and Matlab are under constant development the information in this section is subject to change at anytime.<br />
<br />
You should also look at the page http://octave.sourceforge.net/packages.html and http://octave.sourceforge.net/doc/ that has a function reference that is up to date. You can use this function reference to see the number of octave function that are available and their Matlab compatibility.<br />
<br />
The major differences between Octave 3.4.N and Matlab R2010b are:<br />
<br />
==Nested Functions==<br />
Octave has limited support for nested functions. That is<br />
<br />
function y = foo (x)<br />
y = bar(x)<br />
function y = bar (x)<br />
y = ...;<br />
end<br />
end<br />
<br />
is equivalent to<br />
<br />
function y = foo (x)<br />
y = bar(x)<br />
end<br />
function y = bar (x)<br />
y = ...;<br />
end<br />
<br />
The main difference with Matlab is a matter of scope. While nested functions have access to the parent function's scope in Matlab, no such thing is available in Octave, due to how Octave essentially “un-nests” nested functions.<br />
<br />
The authors of Octave consider the nested function scoping rules of Matlab to be more problems than they are worth as they introduce difficult to find bugs as inadvertently modifying a variable in a nested function that is also used in the parent is particularly easy.<br />
<br />
==Differences in core syntax==<br />
<br />
There a few core Matlab syntaxes that are not accepted by Octave, these being<br />
<br />
* Some limitations on the use of function handles. The major difference is related to nested function scoping rules (as above) and their use with function handles.<br />
<br />
* Some limitations of variable argument lists on the LHS of an expression, though the most common types are accepted.<br />
<br />
* Matlab classdef object oriented programming is not yet supported, though work is underway and when development more on to Octave 3.5 this will be included in the development tree.<br />
<br />
==Differences in core functions==<br />
<br />
A large number of the Matlab core functions (ie those that are in the core and not a toolbox) are implemented, and certainly all of the commonly used ones. There are a few functions that aren't implemented, usually to do with specific missing Octave functionality (GUI, DLL, Java, ActiveX, DDE, web, and serial functions). Some of the core functions have limitations that aren't in the Matlab version. For example the sprandn function can not force a particular condition number for the matrix like Matlab can.<br />
<br />
==Just-In-Time compiler==<br />
<br />
Matlab includes a "Just-In-Time" compiler. This compiler allows the acceleration of for-loops in Matlab to almost native performance with certain restrictions. The JIT must know the return type of all functions called in the loops and so you can't include user functions in the loop of JIT optimized loops. Octave doesn't have a JIT and so to some might seem slower than Matlab. For this reason you must vectorize your code as much as possible. The MathWorks themselves have a good document discussing vectorization at http://www.mathworks.com/support/tech-notes/1100/1109.html.<br />
<br />
==Compiler==<br />
<br />
On a related point, there is no Octave compiler, and so you can't convert your Octave code into a binary for additional speed or distribution. There have been several aborted attempts at creating an Octave compiler. Should the JIT compiler above ever be implemented, an Octave compiler should be more feasible.<br />
==Graphic Handles==<br />
<br />
Up to Octave 2.9.9 there was no support for graphic handles in Octave itself. In the 3.2.N versions of Octave and beyond the support for graphics handles is converging towards full compatibility. The patch function is currently limited to 2-D patches, due to an underlying limitation in gnuplot, but the experimental OpenGL backend is starting to see an implementation of 3-D patches.<br />
==GUI==<br />
<br />
There are no Matlab compatible GUI functions. There are a number of bindings from Octave to Tcl/Tk, VTK and Zenity included in the Octave Forge project (http://octave.sourceforge.net) for example that can be used for a GUI, but these are not Matlab compatible. Work on a Matlab compatible GUI is in an alpha stage in the QtHandles project. This might be an issue if you intend to exchange Octave code with Matlab users.<br />
<br />
==Simulink==<br />
<br />
Octave itself includes no Simulink support. Typically the simulink models lag research and are less flexible, so shouldn't really be used in a research environment. However, some Matlab users that try to use Octave complain about this lack. There is a similar package to simulink for the Octave and R projects available at http://www.scicraft.org/<br />
<br />
==Mex-Files==<br />
<br />
Octave includes an API to the Matlab MEX interface. However, as MEX is an API to the internals of Matlab and the internals of Octave differ from Matlab, there is necessarily a manipulation of the data to convert from a MEX interface to the Octave equivalent. This is notable for all complex matrices, where Matlab stores complex arrays as real and imaginary parts, whereas Octave respects the C99/C++ standards of co-locating the real/imag parts in memory. Also due to the way Matlab allows access to the arrays passed through a pointer, the MEX interface might require copies of arrays (even non complex ones).<br />
==Block comments==<br />
<br />
Block comments denoted by "%{" and "%}" markers are supported by Octave with some limitations. The major limitation is that block comments are not supported within [] or {}.<br />
<br />
==Mat-File format==<br />
<br />
There are some differences in the mat v5 file format accepted by Octave. Matlab recently introduced the "-V7.3" save option which is an HDF5 format which is particularly useful for 64-bit platforms where the standard Matlab format can not correctly save variables. Octave accepts HDF5 files, but is not yet compatible with the "-v7.3" versions produced by Matlab.<br />
<br />
Although Octave can load inline function handles saved by Matlab, it can not yet save them.<br />
<br />
Finally, Some multi-byte Unicode characters aren't yet treated in mat-files.<br />
<br />
==Profiler==<br />
<br />
Octave doesn't have a profiler, but there is one in the 3.5 development version, thanks to Daniel Kraft's 2011 Google Summer of Code project. It should be released with 3.6.<br />
<br />
==Toolboxes==<br />
<br />
Octave is a community project and so the toolboxes that exist are donated by those interested in them through the Octave Forge website (http://octave.sourceforge.net). These might be lacking in certain functionality relative to the Matlab toolboxes, and might not exactly duplicate the Matlab functionality or interface.<br />
<br />
==Short-circuit & and | operators==<br />
<br />
The & and | operators in Matlab short-circuit when included in an if statement and not otherwise. In Octave only the && and || short circuit. Note that this means that<br />
<br />
if (a | b)<br />
...<br />
end<br />
<br />
and<br />
<br />
t = a | b;<br />
if t<br />
...<br />
end<br />
<br />
are different in Matlab. This is really a Matlab bug, but there is too much code out there that relies on this behaviour to change it. Prefer the || and && operators in if statements if possible. If you need to use code written for Matlab that depends on this buggy behaviour, you can enable it since Octave 3.4.0 with the following command:<br />
<br />
do_braindead_shortcircuit_evaluation(1)<br />
<br />
Note that the difference with Matlab is also significant when either argument is a function with side effects or if the first argument is a scalar and the second argument is an empty matrix. For example, note the difference between<br />
<br />
t = 1 | []; ## results in [], so...<br />
if (t) 1, end ## in if ([]), this is false.<br />
<br />
and<br />
<br />
if (1 | []) 1, end ## short circuits so condition is<br />
<br />
true.<br />
Another case that is documented in the Matlab manuals is that<br />
<br />
t = [1, 1] | [1, 2, 3]; ## error<br />
if ([1, 1] | [1, 2, 3]) 1, end ## OK<br />
<br />
Also Matlab requires the operands of && and || to be scalar values but Octave does not (it just applies the rule that for an operand to be considered true, every element of the object must be nonzero or logically true).<br />
<br />
Finally, note the inconsistence of thinking of the condition of an if statement as being equivalent to all(X(:)) when X is a matrix. This is true for all cases EXCEPT empty matrices:<br />
<br />
if ([0, 1]) == if (all ([0, 1])) ==> i.e., condition is false.<br />
if ([1, 1]) == if (all ([1, 1])) ==> i.e., condition is true.<br />
<br />
However,<br />
<br />
if ([]) != if (all ([]))<br />
<br />
because samp ([]) == 1 because, despite the name, it is really returning true if none of the elements of the matrix are zero, and since there are no elements, well, none of them are zero. This is an example of vacuous truth. But, somewhere along the line, someone decided that if ([]) should be false. Mathworks probably thought it just looks wrong to have [] be true in this context even if you can use logical gymnastics to convince yourself that "all" the elements of a matrix that doesn't actually have any elements are nonzero. Octave however duplicates this behavior for if statements containing empty matrices.<br />
<br />
==Solvers for singular, under- and over-determined matrices==<br />
<br />
Matlab's solvers as used by the operators mldivide (\) and mrdivide (/), use a different approach than Octave's in the case of singular, under-, or over-determined matrices. In the case of a singular matrix, Matlab returns the result given by the LU decomposition, even though the underlying solver has flagged the result as erroneous. Octave has made the choice of falling back to a minimum norm solution of matrices that have been flagged as singular which arguably is a better result for these cases.<br />
<br />
In the case of under- or over-determined matrices, Octave continues to use a minimum norm solution, whereas Matlab uses an approach that is equivalent to<br />
<br />
function x = mldivide (A, b)<br />
[Q, R, E] = qr(A);<br />
x = [A \ b, E(:, 1:m) * (R(:, 1:m) \ (Q' * b))]<br />
end<br />
<br />
While this approach is certainly faster and uses less memory than Octave's minimum norm approach, this approach seems to be inferior in other ways.<br />
<br />
A numerical question arises: how big can the null space component become, relative to the minimum-norm solution? Can it be nicely bounded, or can it be arbitrarily big? Consider this example:<br />
<br />
m = 10;<br />
n = 10000;<br />
A = ones(m, n) + 1e-6 * randn(m,n);<br />
b = ones(m, 1) + 1e-6 * randn(m,1);<br />
norm(A \ b)<br />
<br />
while Octave's minimum-norm values are around 3e-2, Matlab's results are 50-times larger. For another issue, try this code:<br />
<br />
m = 5;<br />
n = 100;<br />
j = floor(m * rand(1, n)) + 1;<br />
b = ones(m, 1);<br />
A = zeros(m, n);<br />
A(sub2ind(size(A),j,1:n)) = 1;<br />
x = A \ b;<br />
[dummy,p] = sort(rand(1,n));<br />
y = A(:,p)\b;<br />
norm(x(p)-y)<br />
<br />
It shows that unlike in Octave, mldivide in Matlab is not invariant with respect to column permutations. If there are multiple columns of the same norm, permuting columns of the matrix gets you different result than permuting the solution vector. This will surprise many users.<br />
<br />
Since the mldivide (\) and mrdivide (/) operators are often part of a more complex expression, where there is no room to react to warnings or flags, it should prefer intelligence (robustness) to speed, and so the Octave developers are firmly of the opinion that Octave's approach for singular, under- and over-determined matrices is a better choice that Matlab's<br />
<br />
==Octave extensions==<br />
<br />
The extensions in Octave over Matlab syntax are very useful, but might cause issues when sharing with Matlab users. A list of the major extensions that should be avoided to be compatible with Matlab are<br />
Comments in octave can be marked with <tt>#</tt>. This allows POSIX systems to have the first line as <tt>#! octave -q</tt> and mark the script itself executable. Matlab doesn't have this feature due to the absence of comments starting with <tt>#</tt>".<br />
<br />
Code blocks like if, for, while, etc can be terminated with block specific terminations like endif. Matlab doesn't have this and all blocks must be terminated with end.<br />
<br />
Octave has a lisp like unwind_protect block that allows blocks of code that terminate in an error to ensure that the variables that are touched are restored. You can do something similar with try/catch combined with <tt>rethrow (lasterror ())</tt> in Matlab, however rethrow and lasterror are only available in Octave 2.9.10 and later. Matlab 2008a also introduced OnCleanUp that is similar to unwind_protect, except that the object created by this function has to be explicitly cleared in order for the cleanup code to run.<br />
<br />
Note that using try/catch combined with <tt>rethrow (lasterror ())</tt> can not guarantee that global variables will be correctly reset, as it won't catch user interrupts with Ctrl-C. For example<br />
<br />
global a<br />
a = 1;<br />
try<br />
_a = a;<br />
a = 2<br />
while true<br />
end<br />
catch<br />
fprintf ('caught interrupt\n');<br />
a = _a;<br />
rethrow (lasterror());<br />
end<br />
<br />
compared to<br />
<br />
global a<br />
a = 1;<br />
unwind_protect<br />
_a = a;<br />
a = 2<br />
while true<br />
end<br />
unwind_protect_cleanup<br />
fprintf ('caught interrupt\n');<br />
a = _a;<br />
end<br />
<br />
Typing Ctrl-C in the first case returns the user directly to the prompt, and the variable "a" is not reset to the saved value. In the second case the variable "a" is reset correctly. Therefore Matlab gives no safe way of temporarily changing global variables.<br />
<br />
Indexing can be applied to all objects in Octave and not just variable. Therefore sin(x)(1:10); for example is perfectly valid in Octave but not Matlab. To do the same in Matlab you must do y = sin(x); y = y([1:10]);<br />
<br />
Octave has the operators "++", "–", "-=", "+=", "*=", etc. As Matlab doesn't, if you are sharing code these should be avoided.<br />
Character strings in Octave can be denoted with double or single quotes. There is a subtle difference between the two in that escaped characters like \n (newline), \t (tab), etc are interpreted in double quoted strings but not single quoted strings. This difference is important on Windows platforms where the "\" character is used in path names, and so single quoted strings should be used in paths. Matlab doesn't have double quoted strings and so they should be avoided if the code will be transferred to a Matlab user.</div>Crobar