location of octave header files - octave

I am trying to use Octave as an external solver in my C/C++ code.
I read here that one needs to include the octave/oct.h header file. However I am not able to find it on my computer. I have searched everywhere including the octave root directory version 3.0.5.
What should I do?

I found it in my Octave 3.2.2 installation in Windows: C:\Octave\3.2.2_gcc-4.3.0\include\octave-3.2.2\octave.
Are you using another operating system? If so, you may need to install the headers separately. For example, Ubuntu 10.10 has a separate octave3.2-headers package.
If you are using Windows and your Octave installation does not have the headers, you could try upgrading to 3.2.2 or greater. I got the Windows installer from Octave-Forge.

For newer versions on Ubuntu, e.g., Octave 3.8.1, the package you must install to get the headers is now called liboctave-dev

The include folder of the Octave 4.0.0 installed on Ubuntu can be found at /usr/include/octave-4.0.0/octave.

Related

How can i upgrade my Octave version to the latest one?

I have the 4.0.3 Octave version on my machine.
and I would like to upgrade my version using windows.
Can someone tell me please the steps to follow?
Thanks.
If you want to remove v4.0.3, the complete answer will depend on how you installed that version in the first place.
If you used an executable installer, then there should be an 'uninstall' option available. On Windows 10, you can sometimes right click on the shortcut in the startmenu and an Uninstall option will appear. Otherwise you can follow the directions at this link to navigate through the Settings to the Apps & Features window, which lists everything installed and will provide an Uninstall option.
If you used a zip package to 'install' Octave 4.0.3 just by unzipping it to a folder on your hard drive, then no uninstall process is necessary. you can just delete the folder and shortcuts manually.
You can have multiple octave versions installed next to each other, the folders will have version numbers to prevent them from overwriting themselves.
To install the latest version (5.1.0 as of this answer, although 5.2.0 will be released very soon):
You can find the installation files for Windows by going to the Octave download page and clicking 'Windows'. There will be several file options there. Most people choose the first one (octave-5.1.0-w64-installer.exe) for 64bit systems. You can just download that or one of the other .exe versions, execute that program, and follow the prompts. If for some reason you would rather download a zip package and do a manual setup, I suggest you follow the instructions at the Octave for Microsoft Windows Wiki page to make sure everything is configured correctly.

Best solution to have multiple CUDA/cuDNN versions installed on Ubuntu

I am using Conda on Ubuntu 16.04. My objective is to associate each Conda environment to a specific version of CUDA / cuDNN. I had a look around and I found this interesting article, which basically suggests to put different CUDA versions into different folders and then use an environment-specific bash script (run when the environment is activated) to properly set the PATH/LD_LIBRARY_PATH variables (which creates the association with the CUDA version).
This is fine, but when I try to install frameworks such as pytorch using Conda, it forces me to install also the "cudatoolkit" package.
So, a couple of questions:
1) does downloading cudatoolkit mess up my previous CUDA configurations? which version will be used?
2) if using Conda is possible to install "cudatoolkit" and also "cudnn", why not just using conda for everything? Why even needing to apply the instructions of the above mentioned article?
Thank you.
As an answer to the first question, no, downloading and installing another CUDA toolkit won't mess up other configurations. From CUDA toolkit installer, you specify an installation directory, so just pick whatever works for you that is unique to that CUDA version. This won't affect any currently installed CUDA versions. A Pytorch install will look for a CUDA_HOME environment variable as well as in '/usr/local/cuda' (the default CUDA toolkit install dir.), so it's just this environment variable that needs to be changed.
I can't speak for the second part. Perhaps the installation using Conda will use the default installation directory for the CUDA toolkit (seems silly but this is just speculation).

Octave 4.2.1 octave-gui : cannot find libgfortran.so.3

I am currently having an issue with Octave install in Archlinux. I am not able to load the current version of Octave 4.2.1 in Arch. It shows the following message -
/usr/lib/octave/4.2.1/exec/x86_64-pc-linux-gnu/octave-gui: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
This problem with libgfortran.so.3 is not rare. Here are two similar problems happening in R 1 and 2. If somebody using Octave on Archlinux came across this issue, can you share how to resolve it. Thanks.
From the comments it became apparent that the solution from the referenced question R v3.4.0-2 unable to find libgfortran.so.3 on Arch needs to be appended, because the way the older GCC versions will be typically installed in Arch Linux is in a different path.
So, one must find, where the older version is installed, like
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgfortran.so.3
(depending on the exact GCC version)
and then add the version to LD_LIBRARY_PATH or make a symlik of the library from the above path to /usr/lib64/.
I got this issue because I installed earlier additionally openblas-lapack from AUR for better octave matrix multiplication performance. Updating openblas-lapack to newest version in AUR did the trick for me.

CUDA 7.5 install on Mac missing nvrtc

According to the documentation, when I install the CUDA 7.5 Toolkit on my Mac (OSX 10.11) I should get the nvrtc files with it. I do not. Where do I pick up the nvrtc header files and libraries? Were they supposed to be in the bundle and left out? Were the deprecated or replaced with something else?
So the trick is:
1) Install XCode (from the App Store) FIRST. After the App Store is done installing it, you have to go into your Application menu and actually run it and accept the license.
2) Use the Homebrew version:
$ brew install Caskroom/cask/cuda
3) Lastly, you can update your PATH and LD_LIBRARY_PATH to find the new code:
$ export PATH=/usr/local/cuda/bin:${PATH}
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib:${LD_LIBRARY_PATH}
For some reason, simply downloading the package from NVidia and installing it does not get you a complete installation.

Make TortoiseHG use my Python installation

I created some python hooks for Mercurial that use some external libraries (namely jira-python). In Linux, I install the packages using pip. In Windows, however, Mercurial comes with a bundled version of Python. My hooks fail when I run them because the external packages are not installed.
I want to make Mercurial / TortoiseHG use my Python installation so I can control its environment. How can I do that?
You can install Mercurial package for Python:
Mercurial 2.4 Python 2.7 package - x86 Windows
Mercurial 2.4 Python 2.7 package - x64 Windows
For TortoiseHG-specific details I can suggest to inspect %TortoiseHg%\library.zip - it contains (some? all?) needed for TortoiseHG|Mercurial Python's modules, which list you can (try) to extend: "in Where is the Python path for TortoiseHG?" topic Steve Borho wrote:
TortoiseHg's entire python environment is contained within the library.zip that comes packaged
with it.
What I suspect you can do is add a line or two to the top of your reviewboard extension file to add your installed python path to sys.path before trying to import simplejson
Hint for adding python path to sys.path is applicable for you too
Recommendation from Convert Extension page
you'll need to use a Mercurial installed on top of a stand-alone Python, and you may also need to do something like
set HG=python c:\Python25\Scripts\hg
to override the default Win32 binaries if you have those installed also
I have Mercurial installed through pip, and I also have TortoiseHg. My system path selects the Python version first.
I renamed C:\Program Files\TortoiseHg\hg.exe to something else, and then ran TortoiseHg. Everything still worked, but I haven't got a good way of verifying it does what you want. You can give it a shot.