Menu

#37 Nested functions error whith install.m from SBMLToolbox-4.1.0

SBMLToolbox-4.0.1
closed
nobody
None
5
2016-06-04
2015-10-14
No

Hi,

I'm really no expert, so hopefully I'm reporting a real issue and not something obvious I did wrong for some reason. But I couldn't find where to get some help, so... Here it is:

I just installed Octave. I'm using Linux Mint 17.2 'Raphaela', Cinnamon 32-bit, so I installed it using the software manager. That should be Octave version 3.8.1-1ubuntu1, together with: liboctave2, libgraphicsmagick3, libfltk-gl1.3, libxml-sax-perl, libintl-perl, libxml-libxml-perl, libxml-namespacesupport-perl, libglpk36, libxml-sax-base-perl, libgraphicsmagick++3, octave-common, libqrupdate1, libtext-unidecode-perl, libcxsparse3.1.2, libgl2ps0, libfltk1.3, libqscintilla2-11, libqscintilla2-l10n, libqhull6, texinfo

From what I could see — I just ran a few commands from the first tutorial I found — Octave is running just fine.

Then trying to install SBMLtoolbox got me the following error message:

~ $ octave /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m
GNU Octave, version 3.8.1
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

parse error near line 73 of file /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m

nested functions not implemented in this context

function [matlab_octave, bit64] = check_system()
^

parse error near line 126 of file /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m

nested functions not implemented in this context

function [location, writeAccess, in_installer] = check_location(matlab_octave, ...
^

error: source: error sourcing file '/home/afaure/SBMLToolbox-4.1.0/toolbox/install.m'

"Nested functions" seems to be something simple enough that there should be a workaround, but it's rather annoying for a newbie like me and I would appreciate some help to get the script to work.

Best regards,

Adrien Fauré.

Discussion

  • Sarah Keating

    Sarah Keating - 2015-10-19

    Hi Adrien

    Thanks for your interest in SBMLToolbox and I am sorry you are having a problem.

    It is certainly a real issue - although not one I have encountered before and unfortunately I cannot replicate it. It seems nested functions can be a bit of an issue with octave.

    Looking at the install.m file I suggest you try adding the line:

    endfunction

    at around line 65.

    This should stop it thinking the functions are nested.

    Let me know if this works.

    Thanks

    Sarah

    Note: To use the SBML import/export capabilities you will need to install libsbml and build the octave binding for your system.

     
  • Adrien Fauré

    Adrien Fauré - 2015-10-20

    Thanks Sarah for your help. I added the endfunction line, and it got me a new error:

     ~ $ octave /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m
    
    parse error near line 126 of file /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m
    
      nested functions not implemented in this context
    
    >>> function [location, writeAccess, in_installer] = check_location(matlab_octave, ...
               ^
    
    parse error near line 266 of file /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m
    
      inconsistent function endings -- if one function is explicitly ended, so must all the others
    
    error: parse error while reading file /home/afaure/SBMLToolbox-4.1.0/toolbox/install.m
    error: source: error sourcing file '/home/afaure/SBMLToolbox-4.1.0/toolbox/install.m'
    

    So I "explicitely ended" all functions with an "endfunction" at line 112 (there are only comments between that line and line 126 where the next funciton starts) and line 266 (last line in the file) and I got... nothing. No error, which is cool, but no "Installation sucessful" either, and as far as I can tell, it seems nothing happened.

    Do you think it could have something to do with the libSBML? I do think I installed it, but I had to build from source, and I'm not sure I did it right...

     
  • Sarah Keating

    Sarah Keating - 2015-10-21

    Hi Adrien

    You did correctly identify all the possible endfunctions and it should have run.

    The presence of the libsbml bindings will be checked but it should not affect whether or not SBMLToolbox gets installed.

    At this stage all that the install script is doing is adding the appropriate directories to the octave path. You could run the lines:

    ToolboxPath = genpath(pwd);
    addpath(ToolboxPath);
    s = savepath;

    from the same directory and it will do everything the install script would do..

    You can then test the libsbml-binding yourself using

    m = TranslateSBML('filename')

    where 'filename' is the sbml file. If you get a structure for m then everything is working and you are good to go.

    Let me know if you need more help.

    Sarah

     
  • Sarah Keating

    Sarah Keating - 2016-06-04
    • status: open --> closed
     

Log in to post a comment.