Octave - error: 'fwt' undefined after installing the required package - octave

I have installed the ltfat package as referenced, here, as I want to use the fwt function.
I downloaded the package from, here, and then ran the following command in the Octave command-line window:
pkg install -forge ltfat
I'm however having the following error:
error: 'fwt' undefined
How can I solve this issue?
Thanks.

You need to load the package before using its functions. i.e.
pkg load ltfat
This is mentioned in the documentation of both Octave and ltfat package.

Related

How to set up a windows cython environment from scratch?

I have been searching on the internet for hours to find out how to make cython work with no success.
I am on windows , i use python3 with Anaconda and i also have Codeblocks using the mingw GCC compiler.
I would like to be able to run even the most basic code (like 'helloworld') with cython because untill now i've only encountered errors i don't understand. They may come from an unstable developping environment so this is why i ask this question.
The main errors happen when translating the .pyx code to .c and even when i achieve that there are even more errors on the .c generated.
here is my 'helloworld.pyx' :
print('Hello Wolrd')
here is my setup.py :
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules=cythonize('helloworld.pyx'))
when i run python3 setup.py i get ModuleNotFoundError: No module named 'Cython'
when i run cython helloworld.pyx , I get a file helloworld.c
but when i run it in Codeblocks i get the error Python.h : no such file or directory
so i temporary fixed it by puting the absolute path in the include command but i still get errors.
i also tried using python setup.py build_ext --inplace but i get
running build_ext
building 'helloworld' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Julien\anaconda3\include -IC:\Users\Julien\anaconda3\include -c helloworld.c -o build\temp.win-amd64-3.7\Release\helloworld.o
In file included from C:\Users\Julien\anaconda3\include/Python.h:87:0,
from helloworld.c:4:
C:\Users\Julien\anaconda3\include/pytime.h:123:59: warning: 'struct timeval' declared inside parameter list
C:\Users\Julien\anaconda3\include/pytime.h:123:59: warning: its scope is only this definition or declaration, which is probably not what you want
C:\Users\Julien\anaconda3\include/pytime.h:131:5: warning: 'struct timeval' declared inside parameter list
C:\Users\Julien\anaconda3\include/pytime.h:136:5: warning: 'struct timeval' declared inside parameter list
helloworld.c:201:41: warning: division by zero
helloworld.c:201:12: error: enumerator value for '__pyx_check_sizeof_voidp' is not an integer constant
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
I followed tutorials to install mingw (it works for coding in C in codeblocks so I should have installed it properly) and I verified that Cython was correctly installed in Python libraries. What did I do wrong ??
Ok so the problem was effectively in the compilers.
the problem was because my mingw compiler was not correct : i suggest following
these instructions which you will find at https://wiki.python.org/moin/WindowsCompilers.
/!\ do not forget to install setuptools on your python environment (using the command given works for me)
this should at least allow you to make the basic tutorial for cython

"Couldn't resolve hostname" while installing package in Octave

I have tried installing a package in Octave using this command:
pkg install signal-1.4.0.taz.gz
but I received the following error:
error: pkg: failed to read package 'signal-1.4.0.taz.gz': Couldn't resolve host name
error: called from
pkg at line 429 column 17
Does somebody know what that means?
You have mis-spelled the name of the package's tarball. It is likely signal-1.4.0.tar.gz rather than signal-1.4.0.taz.gz (Note that one has TAR and the other has TAZ in the extension)
pkg install signal-1.4.0.tar.gz
Essentially what is happening, is that Octave is unable to find the file signal-1.4.0.taz.gz on the file system (due to the mis-spelling) so then it attempts to download the file from the internet. When it tries to resolve signal-1.4.0.taz.gz as a URL, DNS name resolution fails giving you the error that you're encountering.
I just had the same issue/error when trying to install the econometrics package on a windows install. In my case, for reasons unknown I was getting the following error:
>> pkg install econometrics-1.1.1.tar.gz
error: pkg: failed to read package 'econometrics-1.1.1.tar.gz': Couldn't resolve host name
error: called from
pkg at line 433 column 17
The only way I managed to get it, was by first downloading the package manually into the current working directory of Octave. (See pwd output.) Only then did the install command work.
pkg install econometrics-1.1.1.tar.gz
pkg load econometrics
I recently have this problem, you need to place the file in the Octave directory and from there rigth clik on the file to copy to clipboard and then paste from there.
example:
to me work to change the document to disc D, and then install like:
pkg install symbolic-win-py-bundle-2.9.0.tar.gz

Octave: Loaded package is not recognized

I have installed package image via pkg install -forge image and after tons of warnings (I am using clang as a C compiler, yeah, I know...) it finished installing.
I then loaded the package with ordinary pkg load image and Octave did not complain. But when I typed help viscircles to get some help on the function, Octave behaved like there was no package image, meaning it returned
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge but has not yet been implemented.
Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
Now I executed the pkg list to see if the package was indeed installed and loaded and yes, it was (there was an asterisk next to image package, which indicates that the certain package is loaded).
I decided to unload all packages and so I did. Now, before loading image again, I executed help viscircles again, but this time I got the next error:
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge which you have installed but not loaded. To load the
package, run 'pkg load image' from the Octave prompt.
Interesting... I loaded the package again and same problem as before. I also downloaded the package manually and reinstalled it, same problems.
And yes, I have Octave 4.0.2, the requirements for image 2.6.2 is version 4.0.0+.
The function viscircles is on development versions of the image package only. It is not part of the current release, version 2.6.2 which you have installed.
The error message:
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge which you have installed but not loaded. To load the
package, run 'pkg load image' from the Octave prompt.
means that the function is not part of Octave and if it is to exist at all, it will be on the image package. It doesn't mean that the image package will actually have it, only that it belongs to it. The error message you get after loading the package:
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge but has not yet been implemented.
Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
tells you the issue. The function viscircles is not implemented on that version of the package.
You can get it from the mercurial repository of the image package though at 75df28049249. Not sure if it will work on Octave 4.0 though.

Install Octave package error

I have tried to install image package but it returned error:
pkg install image-2.4.1.tar.gz
pkg: unable to find the command shell.
error: called from 'shell' in file C:\Octave\Octave-4.0.0\share\octave\4.0.0\m\pkg\private\shell.m near line 42, column 7
How can I solve it?
Octave is trying to execute "sh.exe", but cannot. This exe may come by cygwin or some other tool to allow the execution of Unix style commands.

Octave imread function

I installed latest Octave on Ubuntu 14.04 machine. However, when I tried to run imread command, it showed the following error message:
octave:12> imread('newfile.png')
error: imread: invalid image file: /usr/lib/x86_64-linux-gnu/octave/3.8.1/oct/x86_64-pc-linux-gnu/__magick_read__.oct: failed to load: /usr/lib/x86_64-linux-gnu/octave/3.8.1/oct/x86_64-pc-linux-gnu/__magick_read__.oct: undefined symbol: _ZN6Magick5ColorC1Ehhh
error: called from:
error: /usr/share/octave/3.8.1/m/image/private/__imread__.m at line 181, column 7
error: /usr/share/octave/3.8.1/m/image/private/imageIO.m at line 66, column 26
error: /usr/share/octave/3.8.1/m/image/imread.m at line 107, column 30
Can someone please suggest how to solve it?
Thanks!
Following these steps worked for me [Author: Christoffer Cronström (hymyly)]:
Install the dev packages needed to build octave.
sudo apt-get build-dep octave
Get the official source package. Do this in a clean directory, because it will get polluted.
cd ~/some/suitable/directory
apt-get source octave
Build it. This took roughly an hour for me.
cd octave-3.8.2
dpkg-buildpackage
Either run it from the build directory:
./run-octave
...or most preferably install it over the official octave:
cd ..
sudo dpkg --install octave_3.8.2-4_amd64.deb
From: https://bugs.launchpad.net/ubuntu/+source/octave/+bug/1372202
How did you instal Octave? The error suggests that you're missing GraphicsMagick C++ interface (package libgraphicsmagick++3) but
if you installed Octave from Ubuntu's package manager you should not have had this problem; * if you compiled it yourself, Octave should have disabled imread completely and you'd have a very different error message.
So my guess is that you build it yourself, either with:
your own build of GraphicsMagick++ which are not being loaded anymore, you may need to add their path to the dynamic linker load path (either on /etc/ld.so.conf.d./graphicsmagick or define LD_LIBRARY_PATH);
the libraries from the package manager which you have since accidentally removed (since you did not install Octave from the repositories, your package manager will not know that libgraphicsmagick++ is installed for a reason).
Either way, the solution is easy. Install Octave from Ubuntu's package manager. One of the main reasons package managers exist is to avoid this type of problems, i.e., missing dependencies.