Fixing GNU Octave without science repo in openSUSE - octave

I am a user of openSUSE 13.2. While updating the openSUSE, the system stopped working properly (for example, unable to open firefox, or software management in yast2. Snapper does not work to fix that). So I used DVD openSUSE 13.2 to upgrade (update) and it managed to fix it. However, some applications such as GNU Octave is not working. I am able to open it and run it but it gives me errors with compiling example code. Errors such as missing libraries etc. I do not want to jump to openSUSE 15 with so much hassle with it. I just want to fix Octave for now. However, science repository for openSUSE 13.2 is no longer active. I have GNU Octave v. 3.8 and if possible I would like to update octave to latest version with all the octave packages available. How I do it without science repository available for openSUSE 13.2. Is it okay to use repo of other openSUSE version say SLE?
Below is a sample code:
x = -10:0.1:10;
c=pi
d=exp(0)
f1 = sin(x);
f2 = c.^(1/4)* x.*exp((-1/2)*x.^2);
plot(x,f1,'-r',x,f2,'-b')
title ("psi(x) at n=0 and n=1 for x = -10:0.1:10");
xlabel ("x");
ylabel ("psi(x)");
text (0.6, 1.2, "psi at n=0");
text (-0.6, -0.8, "psi at n=1");
legend ('psi-0(x)','psi-1(x)');
and the GNU Octave output is
error: /usr/lib64/octave/3.8.2/oct/x86_64-suse-linux-gnu/PKG_ADD: /usr/lib64/octave/3.8.2/oct/x86_64-suse-linux-gnu/__init_fltk__.oct: failed to load: /usr/lib64/octave/3.8.2/oct/x86_64-suse-linux-gnu/__init_fltk__.oct: undefined symbol: _ZN9Fl_Window6cursorE9Fl_Cursor
error: called from:
error: /usr/lib64/octave/3.8.2/oct/x86_64-suse-linux-gnu/PKG_ADD at line 6, column 1
GNU Octave, version 3.8.2
Copyright (C) 2014 John W. Eaton and others.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.
Octave was configured for "x86_64-suse-linux-gnu".
For information about changes from previous versions, type 'news'.
warning: function /home/adam/OctaveExamples/waitbar.m shadows a core library function
warning: function /home/adam/OctaveExamples/plot3.m shadows a core library function
plot1
c = 3.1416
d = 1
error: default graphics toolkit 'fltk' is not available!
error: base_graphics_toolkit::initialize: invalid graphics toolkit
error: called from:
error: /usr/share/octave/3.8.2/m/plot/util/figure.m at line 94, column 9
error: /usr/share/octave/3.8.2/m/plot/util/gcf.m at line 63, column 9
error: /usr/share/octave/3.8.2/m/plot/util/newplot.m at line 113, column 8
error: /usr/share/octave/3.8.2/m/plot/draw/plot.m at line 219, column 9
error: /home/adam/OctaveExamples/plot1.m at line 6, column 1
the code was working before the openSUSE mulfunctioned. After the fix, octave seems to be broken.

Related

interface between the Quandl financial database and Octave

I'm using Octave 4.2.1 and trying to import financial data into Octave. Following these instructions from Quandl site:
https://github.com/tradingjunkie/OctaveQuandlInterface
addpath('/path/to/OctaveQuandlInterface') --Ok
and I start by defining an Octave structure
Quandl.auth = token;--NOK
I got this message: "error: 'token' undefined near line 1 column 15"
Some help please.
Regards
Matt

Calling Java from Octave with double arguments loses precision

I'm running into a strange issue calling a Java library from Octave. I'm using the JSON library from http://www.json.org/java/. Here's an example Java class:
import org.json.JSONObject;
public class Test {
public static void main(String[] args) throws Exception {
JSONObject obj = new JSONObject();
obj.put("primitive", 3.1415926);
obj.put("wrapped", new java.lang.Double(3.1415926));
System.out.println(obj.toString());
}
}
and the corresponding code in Octave (I'm using 3.8.1):
function test()
javaaddpath('json.jar')
obj = javaObject('org.json.JSONObject');
obj.put('primitive', 3.1415926);
obj.put('wrapped', javaObject('java.lang.Double', 3.1415926));
disp(obj.toString());
end
When I compile and run the Java code, I of course get
{"wrapped":3.1415926,"primitive":3.1415926}
With Octave, on my OS X laptop, I get the same thing.
$ octave --eval test
warning: function ./test.m shadows a core library function
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 "x86_64-apple-darwin14.0.0".
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'.
{"primitive":3.1415926,"wrapped":3.1415926}
But on my Ubuntu 12.04 VM, with Octave installed from ppa:octave/stable, I get:
$ octave --eval test
warning: function ./test.m shadows a core library function
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'.
{"wrapped":3,"primitive":3.1415926}
Somehow the java.lang.Double object turns into an integer, or at least the fractional part gets stripped off. What is going on here?

Is Octave's pipe function supported on Windows7?

I am trying to use multicore-0.2.15 toolbox with Octave v3.6.4 on Windows7 64bit
( http://octave.sourceforge.net/multicore/ )
but even the demo script doesn't seem to work, it's not possible to create a pipe and I received an error message. So if I try to evaluate the following command in Octave
[read_fd, write_fd, err, msg] = pipe ()
I receive the following output:
read_fd = -1
write_fd = -1
err = -1
msg = pipe: not supported on this system
The fork function doesn't work either.
Does anyone have an idea what the problem might be?
Zoltan
The error message pipe: not supported on this system says it all. There is no support for pipe() in your system (Windows 7). You can:
Not use the multicore which you will notice is unmaintained (see the unmaintained section at the bottom of the package list). You could instead use the parallel package.
Try another build of Octave. Maybe the MinGW builds will work with pipes.
Try another version of Octave. Version 3.8.1 has already been released and if it is a problem on the side of Octave instead of Windows, maybe it has been fixed.
Change operating system (pipe() works fine in Debian)

PIE disabled. Absolute addressing not allowed in code signed PIE

I'm working with Xcode 4.5 with a deployment target of iOS 5.1
I'm getting the following warning when I compile my app in relation to two specific methods which have significantly increased in size.
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in -[mfile method]. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
And subsequently the app is throwing an exception at launch with the following error:
dyld: vm_protect(0x00001000, 0x0078C000, false, 0x07) failed, result=2 for segment __TEXT in /var/mobile/Applications/8E764612-87ED-4A99-9C59-E56C934DA997/appname.app/appname
dyld dyld_fatal_error:
0x2feb20c4: trap
0x2feb20c8: nop
When I comment out the methods in question, the app runs fine.
Any suggestions?
Here is a response from the Unity forums:
In xcode 4.6 build settings change "Dont create position independent executables" from NO to Yes, thats it.
Credits go to amit-chai

Why does cuCtxCreate return old context?

i have installed:
CUDA sdk 4.2 64,
CUDA toolkit 4.2 64,
CUDA devdriver 4.2 64,
I checked every nvcuda.dll in \windows - all of them, are 4.2 version, but when i create a context with driver api and check it verison with cuCtxGetApiVersion - it shows me "3010"
I do not really care about that version, but when i try to use runtime api with that context(need to mix them) - it shows me error 49(cudaErrorIncompatibleDriverContext)
any ideas, what is going on and how to make it work together?
seems it is not some issue with windows - running the same project under linux results in the same 3010 API version.
I solved the problem - i was exporting "cuCtxCreate" function directly during execution(it is other language - no cuda.h). After looking in original cuda.h i found that it defines other name for that functrion, basing on some sort of smartass defines.
And that new function "cuCtxCreate_v2" creates a good context.
/facepalm