help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: start Octave from Matlab


From: Timo
Subject: Re: start Octave from Matlab
Date: Tue, 13 May 2014 14:23:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/13/2014 01:16 PM, Ben Abbott wrote:
> On May 13, 2014, at 3:54 AM, Timo <address@hidden> wrote:
>
>> Hi all,
>>
>> I need to run a Octave script from a function running in Matlab. This
>> can be done with the Matlab "system" function by calling:
>> system('octave --eval "MYSCRIPTNAME"')
>>
>> I get some errors of following type:
>> octave:
>> /usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/libstdc++.so.6:
>> version `GLIBCXX_3.4.15' not found (required by
>> /usr/lib/x86_64-linux-gnu/liboctinterp.so.1)
>> octave:
>> /usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/libstdc++.so.6:
>> version `GLIBCXX_3.4.15' not found (required by
>> /usr/lib/x86_64-linux-gnu/liboctave.so.1)
>> octave:
>> /usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/libgfortran.so.3:
>> version `GFORTRAN_1.4' not found (required by
>> /usr/lib/x86_64-linux-gnu/libcruft.so.1)
>> octave:
>> /usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/libgfortran.so.3:
>> version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3)
>> octave:
>> /usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/libgfortran.so.3:
>> version `GFORTRAN_1.4' not found (required by /usr/lib/libblas.so.3)
>>
>> Does anyone have an idea what the error could be or have a different
>> idea how to do this? Are there system paths wrong or missing or
>> something similar?
>>
>> Thanks
>> T
> This is unrelated to Octave.
>
> Matlab setups the shell environment differently than your system's default.  
> On Mac OSX I'm able to run apps via the system() command by prefixing the 
> string below to the command.
>
> pre = 
> 'PATH=/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
>  ; DYLD_LIBRARY_PATH=""; DYLD_FRAMEWORK_PATH=""; 
> DYLD_FALLBACK_LIBRARY_PATH=""';
> [status, output] = system (sprintf ('%s %s', pre, cmd));
>
> In your case, cmd would be ...
>
> cmd = 'octave --eval "MYSCRIPTNAME"'
>
> On Linux, I don't think you have the DYLD* stuff, but you may have other 
> environment variables which need to be set properly.  You can deduce what 
> needs to be done by comparing the environment variable assignments from your 
> standard shell and those returned by the system() command.
>
> Ben
>
>
Hi Ben,

thanks for the fast reply. I have tried your solution as follows but do
not have success:
    cmd = 'octave';
    pre = ['$PATH=',getenv('PATH'),';'];
    [status, output] = system (sprintf ('%s %s', pre, cmd))

>From the error I understand (same as previously), it seems octave is
trying to use some libraries from the Matlab folder
"/usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/".
This folder is not in the path environment of Matlab, which I guess does
anyway not have anything to do with the path environment that the system
command uses.
 
However, by doing as indicated above, my path environment is set up the
same way as if I start octave from the terminal.

I still do not understand what happens really. If you have further tips,
I would be happy!
Thanks
Timo







reply via email to

[Prev in Thread] Current Thread [Next in Thread]