[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: start Octave from Matlab
From: |
Ben Abbott |
Subject: |
Re: start Octave from Matlab |
Date: |
Tue, 13 May 2014 07:16:07 -0400 |
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