Octave crashes on matrix multiplication of dimension 52 by 52 - octave

magic(5) * magic(5) // works
magic(52) * magic(52) // fails
panic: Illegal instruction -- stopping myself...
attempting to save variables to 'octave-core'...
save to 'octave-core' complete
I am on Ubuntu 13.04, 32 bit, linux kernel 3.8.0-31-generic
I tried uninstalling atlas as mentioned here but could not find libatlas3gf-base so removed fgfs-atlas instead but that did not work.

Install the following packages first
libblas3gf
libblas-doc
libblas-dev
liblapack3gf
liblapack-doc
liblapack-dev
And if that does not work, search for 'blas linear' in your software package manager and install all except for Java,python,perl etc.
Ref: http://ubuntuforums.org/showthread.php?t=1505249

Related

Problem with initialization bim's ready example in Octave

On assignment, they gave me a step-by-step example from this article http://wiki.octave.org/Bim_package.
The example was typed manually, without copy-paste.I already install this packages- fpl, bim,msh, image.
Octave example:
pkg load bim
pkg load msh
pkg load fpl
[mesh]=msh2m_gmsh("fuime","scale",1,"clscale",.1); – Error
[mesh]=bim2c_mesh_properties(mesh);
pdemesh(mesh.p,mesh.e,mesh.t);
view(2)
xu=mesh.p(1,:).';
yu=mesh.p(2,:).';
nelems=columns(mesh.t);
nnodes=columns(mesh.p);
epsilon=.1;
phi=xu+yu;
AdvDiff=bim2a_advaction_diffusion(mesh,epsilon,1,1,phi);
Mass=bim2a_reaction(mesh,1,1);
b=bim2a_rhs(mesh,f,g);
A=AdvDiff+Mass;
GammaD=bim2c_unknowns_on_side(mesh,[1 2]);
GammaN=bim2c_unknowns_on_side(mesh,[3 4]);
GammaN=setdiff(GammaN,GammaD);
jn=zeros(length(GammaN),1);
ud=3*xu;
Omega=setdiff(1:nnodes,union(GammaD,GammaN));
Add=A(GammaD,GammaD);
Adn=A(GammaD,GammaN);
Adi=A(GammaD,Omega);
And=A(GammaN,GammaD);
Ann=A(GammaN,GammaN);
Ani=A(GammaN,Omega);
Aid=A(Omega,GammaD);
Ain=A(Omega,GammaN);
Aii=A(Omega,Omega);
bd=b(GammaD);
bn=b(GammaN);
bi=b(Omega);
temp=[Ann Ani;Ain Aii]\[jn+bn-And*ud(GammaD); bi-Aid*ud(GammaD)];
u=ud;
u(GammaN)=temp(1:numel(GammaN));
u(Omega)=temp(length(GammaN)+1:end);
jd=[Add Adi Adn]*u([GammaD;Omega;GammaN])-bd;
[gx,gy]=bim2c_pde_gradient(mesh,u);
[jxglob,jyglob]=bim2c_global_flux(mesh,u,epsilon*ones(nelems,1),ones(nnodes,1),ones(nnodes,1),phi);
fpl_vtk_write_field("vtkdata",mesh,{u,"Solution"},{[gx:gy]',"Gradient"},1);
pdesurf(mesh.p,mesh.t,u);
In this - [mesh]=msh2m_gmsh("fuime","scale",1,"clscale",.1);Error
Generating mesh...
error: 'tmpnam' undefined near line 78, column 78
error: called from
msh2m_gmsh at line 78 column 12
>>
WHAT HAVE I TAKEN TO FIX THE ERROR
I decided that the problem is in uninstalled packages.
According to the answer I was given in this thread Error,when installing a new package in Octave.
I started to install the package mesh, but here another error came out.
error: get_forge_pkg: package not found: "mesh". Maybe you meant "lssa?"
error: called from
get_forge_pkg at line 90 column 5
get_forge_download at line 32 column 14
pkg at line 500 column 31
But the mesh package not found.The package msh already installed.
How I can fixed my problem?

Octave Psychtoolbox crashing when the screen is called to be displayed

I am still new in Octave with some experience in Python and I was requested to do a test in a stimulus application in order to find if there are errors in the code (not developed by me) and try to fix them and run the application. The issue in the code is at the time to open the screen as follows the implementation (these ones where I commented (%) are what already did before, and these ones below the comments are my correction) the code is large with 825 lines:
%% Get subject name from the user
prompt = {'Enter Subject Number:','Enter Subject Name:','Enter Todays Date:','Left or Right:'};
dlgtitle = 'Information Input';
%dims = [1 50];
dims = [1 50;1 50;1 50;1 50];
opts = 'on';
answer = inputdlg(prompt,dlgtitle,dims);
%waitfor(answer);
waitfor(dims);
%% TO Excel
% Get the name of the file that the user wants to save.
%startingFolder = userpath;
startingFolder = 'C:\Users\Vtr\Downloads\Final-task-981203\Final-task-981203\Task-981203';
defaultFileName = fullfile(startingFolder, '*.xlsx');
[baseFileName, folder] = uiputfile(defaultFileName, 'Specify a filename ');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
% Combine the folder and base file name into the full file name.
fullFileName = fullfile(folder, baseFileName);
%% LOAD text initial setting
%% Create 1st screen : (Loading and Wait)text screen
% Open an on screen window - purple screen
[window, windowRect] = PsychImaging('OpenWindow', screenNumber, [0.5 0.5 1]);
% Set up alpha-blending for smooth (anti-aliased) lines
Screen('BlendFunction', window, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
After that, in the first part is created a form to insert subject nº, subject name, today's date and left or right, and after that to specify a filename. Made these two parts it appears a purple screen with the mouse's cursor rotating non-stop and if I try to click with the mouse an error alert box "octave-gui.exe has stopped working" appears on. I already tried to run this code on my Virtualbox-VM (Ubuntu 16.04 LTS), firstly, it notifies that my screen is being tested and calibrated and after, it appears another error screen on the terminal:
PTB-INFO: OS support status: Linux 4.15.0-55-generic Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
PTB-WARNING: FAILED to enable synchronization to vertical retrace!
PTB-WARNING: FAILED to enable synchronization to vertical retrace (System ignored setting [Req 1 != Actual 0])!
PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
PTB-INFO: You need to run Matlab or Octave with root-privileges, or run the script PsychLinuxConfiguration once for this to work.
PTB-INFO: See /usr/share/doc/psychtoolbox-3-common/README.Debian to make this work.
PTB-WARNING: Couldn't even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.
WARNING: VBL Calibration run No. 1 failed. Retrying...
PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
PTB-INFO: You need to run Matlab or Octave with root-privileges, or run the script PsychLinuxConfiguration once for this to work.
PTB-INFO: See /usr/share/doc/psychtoolbox-3-common/README.Debian to make this work.
PTB-WARNING: Couldn't even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.
WARNING: VBL Calibration run No. 2 failed. Retrying...
WARNING: Will enable VBL busy wait-workaround before trying final VBL Calibration run No. 3.
WARNING: This will hopefully work-around graphics driver bugs of the GPU sync-to-retrace mechanism. Cross your fingers!
PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
PTB-INFO: You need to run Matlab or Octave with root-privileges, or run the script PsychLinuxConfiguration once for this to work.
PTB-INFO: See /usr/share/doc/psychtoolbox-3-common/README.Debian to make this work.
PTB-WARNING: Couldn't even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.
PTB-INFO: OpenGL-Renderer is VMware, Inc. :: SVGA3D; build: RELEASE; LLVM; :: 2.1 Mesa 18.0.5
PTB-INFO: VBL startline = 664 , VBL Endline = -1
PTB-INFO: Beamposition queries unsupported or defective on this system. Using basic timestamping as fallback.
PTB-INFO: Timestamps returned by Screen('Flip') will be therefore less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 0.000000 ms [inf Hz]. (0 valid samples taken, stddev=10000000.000000 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.667222 ms [59.998001 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
WARNING: Couldn't compute a reliable estimate of monitor refresh interval! The trouble with VBL syncing?!?
WARNING: Mismatch between measured monitor refresh interval and interval reported by the operating system.
This indicates massive problems with VBL sync.
----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! -----
One or more internal checks (see Warnings above) indicate that synchronization
of Psychtoolbox to the vertical retrace (VBL) is not working on your setup.
This will seriously impair proper stimulus presentation and stimulus presentation timing!
Please read 'help SyncTrouble' for information about how to solve or work-around the problem.
You can force Psychtoolbox to continue, despite the severe problems, by adding the command
Screen('Preference', 'SkipSyncTests', 1); at the top of your script, if you really know what you are doing.
error: Screen: See error message printed above.
error: Called from
PsychImaging at line 2240 column 26
Naderi_test_task_v_main_1203_v_2 at line 110 column 20
I would like to know if the issue is in my computer configurations that don't support Psychtoolbox resources or any configuration that I need to change.

How to load a user specified file in Octave

I have a very short script that I'm running in Octave and I want to read a user specified text file. It works on my 64-bit laptop, but not on my 32-bit one. The Octave version is 3.2.2.
plotinfra.m
filename=uiputfile
data=load(filename);
plot(data(:,1),data(:,2));
On my other laptop, this brings up a filesystem menu where I can choose the specific file to load. On this laptop, I see this error message instead:
error: uiputfile undefined near line 1 column 19 error: called from: error: plotinfra.m at line 1, column 17
If I hardcode filename with a path it works. I also tried using uigetfile and that did not work either.
Version 3.2.2 of Octave was released in 2009. When I enter edit uiputfile in Octave, at the top of the file I see the line:
## Copyright (C) 2010-2019 Kai Habel
Thus, it seems that this function was created after your release of Octave. This is the reason you get a "uiputfile undefined" error message.
You will have to upgrade your version of Octave to use this function.
I'm using Ubuntu 18.04 64Bit Linux Octave 4.2.2 see if this works for you. It will store the filename in the variable file_name and the path location in the variable path_dir
% create your dataset (exampledata)
x = (-1:0.1:1);
y = sin(x);
data = zeros(length(x),2);
data(:,1) = x;
data(:,2) = y;
% save data to file (your textfile)
save('-ascii','data2.txt','data');
%load textfile
%data2 = load('data2.txt'); %hard coded
[file_name,path_dir] = uigetfile('*.txt'); %pops up uibox choose data2.txt
data2 = load(strcat(path_dir,file_name)); %loads the file and the data
%plot data
plot(data2(:,1),data2(:,2));

GNU Octave Vertical Dimensions Mismatch

I've been getting the following error in GNU Octave:
error: vertical dimensions mismatch (1x2 vs 1x3) error: called from
ProjectPart1 at line 31 column 4
based on this code (in a for/end loop after zeta(:,1)):
zeta(:,1)=[sum(beta)/lambda,P0];
N=[-lambda,sum(beta);lambda/gen,(rho-sum(beta))/gen];
zeta(:,i)=zeta(:,i-1)+N*zeta(:,i-1)*dt;
I ran this a month-ish ago and I remember it working, any idea why it's not working now?
Edit:
Here's the whole thing. I've tried switching things around, restarting the program, and restarting my computer. Is uninstalling and reinstalling worth it (since one commenter said it worked fine for them)?
lam=[0.0128,0.0318,0.119,0.3181,1.4027,3.9286];
beta=[0.000258,0.00152,0.001391,0.00307,0.001102,0.000258];
P0=1e-6;
a=8*sum(beta);
lambda=((beta(1)*lam(1))+(beta(2)*lam(2))+(beta(3)*lam(3))+(beta(4)*lam(4))+(beta(5)*lam(5))+(beta(6)*lam(6)))/sum(beta);
hold off;
box on;
gen=2.6E-5;
dt=.001;
secint=.125/dt;
t(1)=0;
zeta(:,1)=[sum(beta)/lambda,P0];
rho(1)=0
for i=2:secint
N=[-lambda,sum(beta);lambda/gen,(rho-sum(beta))/gen];
zeta(:,i)=zeta(:,i-1)+N*zeta(:,i-1)*dt;
t(i)=t(i-1)+dt;
rho(i)=a*t(i);
end
The vertical dimensions error is specifically pointing to this line:
N=[-lambda,sum(beta);lambda/gen,(rho-sum(beta))/gen];

Problem with conflict between mysql and math.h

The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library.
I have been over this for two days and I still can't figure it out.
Has this ever happened to anyone?
This is the output from the compiler
C:\mingw\bin\mingw32-make.exe all
'Building file: ../src/interfaz/ventanaconf.cpp'
'Invoking: GCC C++ Compiler'
C:\mingw\bin\mingw32-g++.exe -mms-bitfields -I"c:\dev-cpp\gtkmm\include\gtkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gtkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\glibmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\glibmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\gdkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gdkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\pangomm-1.4"
-I"c:\dev-cpp\gtkmm\include\atkmm-1.6" -I"c:\dev-cpp\gtkmm\include\sigc++-2.0"
-I"c:\dev-cpp\gtkmm\lib\sigc++-2.0\include" -I"c:\dev-cpp\gtkmm\include\cairomm-1.0"
-I"c:\gtk\include\gtk-2.0"
-I"c:\gtk\include\glib-2.0"
-I"c:\gtk\lib\glib-2.0\include"
-I"c:\gtk\lib\gtk-2.0\include"
-I"c:\gtk\include\pango-1.0"
-I"c:\gtk\include\cairo"
-I"c:\gtk\include\freetype2"
-I"c:\gtk\include"
-I"c:\gtk\include\atk-1.0"
-I"c:\Archivos de programa\MySQL\MySQL Server 5.0\include"
-O0 -g3 -w -c -fmessage-length=0 -MMD -MP -MF"src/interfaz/ventanaconf.d"
-MT"src/interfaz/ventanaconf.d"
-o"src/interfaz/ventanaconf.o" "../src/interfaz/ventanaconf.cpp"
In file included from c:/Archivos de programa/MySQL/MySQL Server 5.0/include/my_global.h:73,
from ../src/interfaz/../gestiondb/gestordb.h:6,
from ../src/interfaz/../gestiondb/operacionesdb.h:5,
from ../src/interfaz/ventanamodulos.h:20,
from ../src/interfaz/ventanaconf.h:27,
from ../src/interfaz/ventanaconf.cpp:1:
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h: **In function `double rint(double)':
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h:228: error: redefinition of `double rint(double)'
C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:620: **error: `double rint(double)' previously defined here**
C:\mingw\bin\mingw32-make.exe: *** [src/interfaz/ventanaconf.o] Error 1**
Thanks in advance!!!
This thread in the mysql support area seems to indicate that they've taken the definition of rint() out of their config_win.h file as of April this year (even though the patch was proposed in 2006). Are you using a version of the MySQL source newer than that?
The problem was about an included library, which linux simply ignores, but windows want out. There is no problem letting it out in linux neither...
Somedays i feel SOOOOOOOOOOOOOOOOOOOOOOO STUPID:..
In line 228 of c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h you should find a declaration/definition of function named "rint". In line 620 of C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h you should find another definition of a function with the same name (which probably even does the same).
To solve the problem you will have to delete/outcomment/undefine one of these definitions.
Be prepared to get a similar problem when linking, if you also link two libraries with the same function.